@vueuse/components 12.4.0 → 12.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -29,49 +29,50 @@ function unrefElement(elRef) {
29
29
  }
30
30
 
31
31
  function useEventListener(...args) {
32
- let target;
33
- let events;
34
- let listeners;
35
- let options;
36
- if (typeof args[0] === "string" || Array.isArray(args[0])) {
37
- [events, listeners, options] = args;
38
- target = defaultWindow;
39
- } else {
40
- [target, events, listeners, options] = args;
41
- }
42
- if (!target)
43
- return shared.noop;
44
- events = shared.toArray(events);
45
- listeners = shared.toArray(listeners);
46
32
  const cleanups = [];
47
33
  const cleanup = () => {
48
34
  cleanups.forEach((fn) => fn());
49
35
  cleanups.length = 0;
50
36
  };
51
- const register = (el, event, listener, options2) => {
52
- el.addEventListener(event, listener, options2);
53
- return () => el.removeEventListener(event, listener, options2);
37
+ const register = (el, event, listener, options) => {
38
+ el.addEventListener(event, listener, options);
39
+ return () => el.removeEventListener(event, listener, options);
54
40
  };
55
- const stopWatch = vue.watch(
56
- () => [unrefElement(target), vue.toValue(options)],
57
- ([el, options2]) => {
41
+ const firstParamTargets = vue.computed(() => {
42
+ const test = shared.toArray(vue.toValue(args[0])).filter((e) => e != null);
43
+ return test.every((e) => typeof e !== "string") ? test : undefined;
44
+ });
45
+ const stopWatch = shared.watchImmediate(
46
+ () => {
47
+ var _a, _b;
48
+ return [
49
+ (_b = (_a = firstParamTargets.value) == null ? undefined : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
50
+ shared.toArray(vue.toValue(firstParamTargets.value ? args[1] : args[0])),
51
+ shared.toArray(vue.unref(firstParamTargets.value ? args[2] : args[1])),
52
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
53
+ vue.toValue(firstParamTargets.value ? args[3] : args[2])
54
+ ];
55
+ },
56
+ ([raw_targets, raw_events, raw_listeners, raw_options]) => {
58
57
  cleanup();
59
- if (!el)
58
+ if (!(raw_targets == null ? undefined : raw_targets.length) || !(raw_events == null ? undefined : raw_events.length) || !(raw_listeners == null ? undefined : raw_listeners.length))
60
59
  return;
61
- const optionsClone = shared.isObject(options2) ? { ...options2 } : options2;
60
+ const optionsClone = shared.isObject(raw_options) ? { ...raw_options } : raw_options;
62
61
  cleanups.push(
63
- ...events.flatMap((event) => {
64
- return listeners.map((listener) => register(el, event, listener, optionsClone));
65
- })
62
+ ...raw_targets.flatMap(
63
+ (el) => raw_events.flatMap(
64
+ (event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
65
+ )
66
+ )
66
67
  );
67
68
  },
68
- { immediate: true, flush: "post" }
69
+ { flush: "post" }
69
70
  );
70
71
  const stop = () => {
71
72
  stopWatch();
72
73
  cleanup();
73
74
  };
74
- shared.tryOnScopeDispose(stop);
75
+ shared.tryOnScopeDispose(cleanup);
75
76
  return stop;
76
77
  }
77
78
 
@@ -82,8 +83,9 @@ function onClickOutside(target, handler, options = {}) {
82
83
  return shared.noop;
83
84
  if (shared.isIOS && !_iOSWorkaround) {
84
85
  _iOSWorkaround = true;
85
- Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", shared.noop));
86
- window.document.documentElement.addEventListener("click", shared.noop);
86
+ const listenerOptions = { passive: true };
87
+ Array.from(window.document.body.children).forEach((el) => useEventListener(el, "click", shared.noop, listenerOptions));
88
+ useEventListener(window.document.documentElement, "click", shared.noop, listenerOptions);
87
89
  }
88
90
  let shouldListen = true;
89
91
  const shouldIgnore = (event) => {
@@ -440,20 +442,12 @@ function useMediaQuery(query, options = {}) {
440
442
  const { window = defaultWindow, ssrWidth = useSSRWidth() } = options;
441
443
  const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
442
444
  const ssrSupport = vue.ref(typeof ssrWidth === "number");
443
- let mediaQuery;
445
+ const mediaQuery = vue.shallowRef();
444
446
  const matches = vue.ref(false);
445
447
  const handler = (event) => {
446
448
  matches.value = event.matches;
447
449
  };
448
- const cleanup = () => {
449
- if (!mediaQuery)
450
- return;
451
- if ("removeEventListener" in mediaQuery)
452
- mediaQuery.removeEventListener("change", handler);
453
- else
454
- mediaQuery.removeListener(handler);
455
- };
456
- const stopWatch = vue.watchEffect(() => {
450
+ vue.watchEffect(() => {
457
451
  if (ssrSupport.value) {
458
452
  ssrSupport.value = !isSupported.value;
459
453
  const queryStrings = vue.toValue(query).split(",");
@@ -474,19 +468,10 @@ function useMediaQuery(query, options = {}) {
474
468
  }
475
469
  if (!isSupported.value)
476
470
  return;
477
- cleanup();
478
- mediaQuery = window.matchMedia(vue.toValue(query));
479
- if ("addEventListener" in mediaQuery)
480
- mediaQuery.addEventListener("change", handler);
481
- else
482
- mediaQuery.addListener(handler);
483
- matches.value = mediaQuery.matches;
484
- });
485
- shared.tryOnScopeDispose(() => {
486
- stopWatch();
487
- cleanup();
488
- mediaQuery = undefined;
471
+ mediaQuery.value = window.matchMedia(vue.toValue(query));
472
+ matches.value = mediaQuery.value.matches;
489
473
  });
474
+ useEventListener(mediaQuery, "change", handler, { passive: true });
490
475
  return vue.computed(() => matches.value);
491
476
  }
492
477
 
package/index.iife.js CHANGED
@@ -26,49 +26,50 @@
26
26
  }
27
27
 
28
28
  function useEventListener(...args) {
29
- let target;
30
- let events;
31
- let listeners;
32
- let options;
33
- if (typeof args[0] === "string" || Array.isArray(args[0])) {
34
- [events, listeners, options] = args;
35
- target = defaultWindow;
36
- } else {
37
- [target, events, listeners, options] = args;
38
- }
39
- if (!target)
40
- return shared.noop;
41
- events = shared.toArray(events);
42
- listeners = shared.toArray(listeners);
43
29
  const cleanups = [];
44
30
  const cleanup = () => {
45
31
  cleanups.forEach((fn) => fn());
46
32
  cleanups.length = 0;
47
33
  };
48
- const register = (el, event, listener, options2) => {
49
- el.addEventListener(event, listener, options2);
50
- return () => el.removeEventListener(event, listener, options2);
34
+ const register = (el, event, listener, options) => {
35
+ el.addEventListener(event, listener, options);
36
+ return () => el.removeEventListener(event, listener, options);
51
37
  };
52
- const stopWatch = vue.watch(
53
- () => [unrefElement(target), vue.toValue(options)],
54
- ([el, options2]) => {
38
+ const firstParamTargets = vue.computed(() => {
39
+ const test = shared.toArray(vue.toValue(args[0])).filter((e) => e != null);
40
+ return test.every((e) => typeof e !== "string") ? test : undefined;
41
+ });
42
+ const stopWatch = shared.watchImmediate(
43
+ () => {
44
+ var _a, _b;
45
+ return [
46
+ (_b = (_a = firstParamTargets.value) == null ? undefined : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
47
+ shared.toArray(vue.toValue(firstParamTargets.value ? args[1] : args[0])),
48
+ shared.toArray(vue.unref(firstParamTargets.value ? args[2] : args[1])),
49
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
50
+ vue.toValue(firstParamTargets.value ? args[3] : args[2])
51
+ ];
52
+ },
53
+ ([raw_targets, raw_events, raw_listeners, raw_options]) => {
55
54
  cleanup();
56
- if (!el)
55
+ if (!(raw_targets == null ? undefined : raw_targets.length) || !(raw_events == null ? undefined : raw_events.length) || !(raw_listeners == null ? undefined : raw_listeners.length))
57
56
  return;
58
- const optionsClone = shared.isObject(options2) ? { ...options2 } : options2;
57
+ const optionsClone = shared.isObject(raw_options) ? { ...raw_options } : raw_options;
59
58
  cleanups.push(
60
- ...events.flatMap((event) => {
61
- return listeners.map((listener) => register(el, event, listener, optionsClone));
62
- })
59
+ ...raw_targets.flatMap(
60
+ (el) => raw_events.flatMap(
61
+ (event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
62
+ )
63
+ )
63
64
  );
64
65
  },
65
- { immediate: true, flush: "post" }
66
+ { flush: "post" }
66
67
  );
67
68
  const stop = () => {
68
69
  stopWatch();
69
70
  cleanup();
70
71
  };
71
- shared.tryOnScopeDispose(stop);
72
+ shared.tryOnScopeDispose(cleanup);
72
73
  return stop;
73
74
  }
74
75
 
@@ -79,8 +80,9 @@
79
80
  return shared.noop;
80
81
  if (shared.isIOS && !_iOSWorkaround) {
81
82
  _iOSWorkaround = true;
82
- Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", shared.noop));
83
- window.document.documentElement.addEventListener("click", shared.noop);
83
+ const listenerOptions = { passive: true };
84
+ Array.from(window.document.body.children).forEach((el) => useEventListener(el, "click", shared.noop, listenerOptions));
85
+ useEventListener(window.document.documentElement, "click", shared.noop, listenerOptions);
84
86
  }
85
87
  let shouldListen = true;
86
88
  const shouldIgnore = (event) => {
@@ -437,20 +439,12 @@
437
439
  const { window = defaultWindow, ssrWidth = useSSRWidth() } = options;
438
440
  const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
439
441
  const ssrSupport = vue.ref(typeof ssrWidth === "number");
440
- let mediaQuery;
442
+ const mediaQuery = vue.shallowRef();
441
443
  const matches = vue.ref(false);
442
444
  const handler = (event) => {
443
445
  matches.value = event.matches;
444
446
  };
445
- const cleanup = () => {
446
- if (!mediaQuery)
447
- return;
448
- if ("removeEventListener" in mediaQuery)
449
- mediaQuery.removeEventListener("change", handler);
450
- else
451
- mediaQuery.removeListener(handler);
452
- };
453
- const stopWatch = vue.watchEffect(() => {
447
+ vue.watchEffect(() => {
454
448
  if (ssrSupport.value) {
455
449
  ssrSupport.value = !isSupported.value;
456
450
  const queryStrings = vue.toValue(query).split(",");
@@ -471,19 +465,10 @@
471
465
  }
472
466
  if (!isSupported.value)
473
467
  return;
474
- cleanup();
475
- mediaQuery = window.matchMedia(vue.toValue(query));
476
- if ("addEventListener" in mediaQuery)
477
- mediaQuery.addEventListener("change", handler);
478
- else
479
- mediaQuery.addListener(handler);
480
- matches.value = mediaQuery.matches;
481
- });
482
- shared.tryOnScopeDispose(() => {
483
- stopWatch();
484
- cleanup();
485
- mediaQuery = undefined;
468
+ mediaQuery.value = window.matchMedia(vue.toValue(query));
469
+ matches.value = mediaQuery.value.matches;
486
470
  });
471
+ useEventListener(mediaQuery, "change", handler, { passive: true });
487
472
  return vue.computed(() => matches.value);
488
473
  }
489
474
 
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- (function(v,C,o,S){"use strict";const ye=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return C.onClickOutside(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),R=S.isClient?window:void 0;function M(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function k(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=R):[t,n,r,a]=e,!t)return S.noop;n=S.toArray(n),r=S.toArray(r);const s=[],i=()=>{s.forEach(u=>u()),s.length=0},l=(u,c,p,U)=>(u.addEventListener(c,p,U),()=>u.removeEventListener(c,p,U)),d=o.watch(()=>[M(t),o.toValue(a)],([u,c])=>{if(i(),!u)return;const p=S.isObject(c)?{...c}:c;s.push(...n.flatMap(U=>r.map(w=>l(u,U,w,p))))},{immediate:!0,flush:"post"}),f=()=>{d(),i()};return S.tryOnScopeDispose(f),f}let Q=!1;function Z(e,t,n={}){const{window:r=R,ignore:a=[],capture:s=!0,detectIframe:i=!1}=n;if(!r)return S.noop;S.isIOS&&!Q&&(Q=!0,Array.from(r.document.body.children).forEach(h=>h.addEventListener("click",S.noop)),r.document.documentElement.addEventListener("click",S.noop));let l=!0;const d=h=>o.toValue(a).some(g=>{if(typeof g=="string")return Array.from(r.document.querySelectorAll(g)).some(m=>m===h.target||h.composedPath().includes(m));{const m=M(g);return m&&(h.target===m||h.composedPath().includes(m))}});function f(h){const g=o.toValue(h);return g&&g.$.subTree.shapeFlag===16}function u(h,g){const m=o.toValue(h),b=m.$.subTree&&m.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(P=>P.el===g.target||g.composedPath().includes(P.el))}const c=h=>{const g=M(e);if(h.target!=null&&!(!(g instanceof Element)&&f(e)&&u(e,h))&&!(!g||g===h.target||h.composedPath().includes(g))){if(h.detail===0&&(l=!d(h)),!l){l=!0;return}t(h)}};let p=!1;const U=[k(r,"click",h=>{p||(p=!0,setTimeout(()=>{p=!1},0),c(h))},{passive:!0,capture:s}),k(r,"pointerdown",h=>{const g=M(e);l=!d(h)&&!!(g&&!h.composedPath().includes(g))},{passive:!0}),i&&k(r,"blur",h=>{setTimeout(()=>{var g;const m=M(e);((g=r.document.activeElement)==null?void 0:g.tagName)==="IFRAME"&&!m?.contains(r.document.activeElement)&&t(h)},0)},{passive:!0})].filter(Boolean);return()=>U.forEach(h=>h())}const ee={mounted(e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=Z(e,t.value,{capture:n});else{const[r,a]=t.value;e.__onClickOutside_stop=Z(e,r,Object.assign({capture:n},a))}},unmounted(e){e.__onClickOutside_stop()}};function ve(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function te(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:a=R,eventName:s="keydown",passive:i=!1,dedupe:l=!1}=r,d=ve(t);return k(a,s,u=>{u.repeat&&o.toValue(l)||d(u)&&n(u)},i)}const we={mounted(e,t){var n,r;const a=(r=(n=t.arg)==null?void 0:n.split(","))!=null?r:!0;if(typeof t.value=="function")te(a,t.value,{target:e});else{const[s,i]=t.value;te(a,s,{target:e,...i})}}},Ue=500,Se=10;function X(e,t,n){var r,a;const s=o.computed(()=>M(e));let i,l,d,f=!1;function u(){i&&(clearTimeout(i),i=void 0),l=void 0,d=void 0,f=!1}function c(m){var b,P,O;const[_,A,y]=[d,l,f];if(u(),!n?.onMouseUp||!A||!_||(b=n?.modifiers)!=null&&b.self&&m.target!==s.value)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const T=m.x-A.x,L=m.y-A.y,W=Math.sqrt(T*T+L*L);n.onMouseUp(m.timeStamp-_,W,y)}function p(m){var b,P,O,_;(b=n?.modifiers)!=null&&b.self&&m.target!==s.value||(u(),(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation(),l={x:m.x,y:m.y},d=m.timeStamp,i=setTimeout(()=>{f=!0,t(m)},(_=n?.delay)!=null?_:Ue))}function U(m){var b,P,O,_;if((b=n?.modifiers)!=null&&b.self&&m.target!==s.value||!l||n?.distanceThreshold===!1)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const A=m.x-l.x,y=m.y-l.y;Math.sqrt(A*A+y*y)>=((_=n?.distanceThreshold)!=null?_:Se)&&u()}const w={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},h=[k(s,"pointerdown",p,w),k(s,"pointermove",U,w),k(s,["pointerup","pointerleave"],c,w)];return()=>h.forEach(m=>m())}const be=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return X(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),ne={mounted(e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},Ce=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:C.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Ee=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(C.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Oe=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(C.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(C.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H="__vueuse_ssr_handlers__",Ve=_e();function _e(){return H in B||(B[H]=B[H]||{}),B[H]}function oe(e,t){return Ve[e]||t}const De=Symbol("vueuse-ssr-width");function Le(){const e=o.hasInjectionContext()?S.injectLocal(De,null):null;return typeof e=="number"?e:void 0}function Me(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function N(e){const t=Me();return o.computed(()=>(t.value,!!e()))}function Te(e,t={}){const{window:n=R,ssrWidth:r=Le()}=t,a=N(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),s=o.ref(typeof r=="number");let i;const l=o.ref(!1),d=c=>{l.value=c.matches},f=()=>{i&&("removeEventListener"in i?i.removeEventListener("change",d):i.removeListener(d))},u=o.watchEffect(()=>{if(s.value){s.value=!a.value;const c=o.toValue(e).split(",");l.value=c.some(p=>{const U=p.includes("not all"),w=p.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=p.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let g=!!(w||h);return w&&g&&(g=r>=S.pxValue(w[1])),h&&g&&(g=r<=S.pxValue(h[1])),U?!g:g});return}a.value&&(f(),i=n.matchMedia(o.toValue(e)),"addEventListener"in i?i.addEventListener("change",d):i.addListener(d),l.value=i.matches)});return S.tryOnScopeDispose(()=>{u(),f(),i=void 0}),o.computed(()=>l.value)}function ke(e){return Te("(prefers-color-scheme: dark)",e)}function Ae(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"?"object":Number.isNaN(e)?"any":"number"}const Re={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()}},re="vueuse-storage";function We(e,t,n,r={}){var a;const{flush:s="pre",deep:i=!0,listenToStorageChanges:l=!0,writeDefaults:d=!0,mergeDefaults:f=!1,shallow:u,window:c=R,eventFilter:p,onError:U=E=>{console.error(E)},initOnMounted:w}=r,h=(u?o.shallowRef:o.ref)(typeof t=="function"?t():t),g=o.computed(()=>o.toValue(e));if(!n)try{n=oe("getDefaultStorage",()=>{var E;return(E=R)==null?void 0:E.localStorage})()}catch(E){U(E)}if(!n)return h;const m=o.toValue(t),b=Ae(m),P=(a=r.serializer)!=null?a:Re[b],{pause:O,resume:_}=S.pausableWatch(h,()=>y(h.value),{flush:s,deep:i,eventFilter:p});o.watch(g,()=>L(),{flush:s}),c&&l&&S.tryOnMounted(()=>{n instanceof Storage?k(c,"storage",L,{passive:!0}):k(c,re,W),w&&L()}),w||L();function A(E,D){if(c){const V={key:g.value,oldValue:E,newValue:D,storageArea:n};c.dispatchEvent(n instanceof Storage?new StorageEvent("storage",V):new CustomEvent(re,{detail:V}))}}function y(E){try{const D=n.getItem(g.value);if(E==null)A(D,null),n.removeItem(g.value);else{const V=P.write(E);D!==V&&(n.setItem(g.value,V),A(D,V))}}catch(D){U(D)}}function T(E){const D=E?E.newValue:n.getItem(g.value);if(D==null)return d&&m!=null&&n.setItem(g.value,P.write(m)),m;if(!E&&f){const V=P.read(D);return typeof f=="function"?f(V,m):b==="object"&&!Array.isArray(V)?{...m,...V}:V}else return typeof D!="string"?D:P.read(D)}function L(E){if(!(E&&E.storageArea!==n)){if(E&&E.key==null){h.value=m;return}if(!(E&&E.key!==g.value)){O();try{E?.newValue!==P.write(h.value)&&(h.value=T(E))}catch(D){U(D)}finally{E?o.nextTick(_):_()}}}}function W(E){L(E.detail)}return h}const ze="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ie(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=R,storage:s,storageKey:i="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:d,emitAuto:f,disableTransition:u=!0}=e,c={auto:"",light:"light",dark:"dark",...e.modes||{}},p=ke({window:a}),U=o.computed(()=>p.value?"dark":"light"),w=d||(i==null?S.toRef(r):We(i,r,s,{window:a,listenToStorageChanges:l})),h=o.computed(()=>w.value==="auto"?U.value:w.value),g=oe("updateHTMLAttrs",(O,_,A)=>{const y=typeof O=="string"?a?.document.querySelector(O):M(O);if(!y)return;const T=new Set,L=new Set;let W=null;if(_==="class"){const D=A.split(/\s/g);Object.values(c).flatMap(V=>(V||"").split(/\s/g)).filter(Boolean).forEach(V=>{D.includes(V)?T.add(V):L.add(V)})}else W={key:_,value:A};if(T.size===0&&L.size===0&&W===null)return;let E;u&&(E=a.document.createElement("style"),E.appendChild(document.createTextNode(ze)),a.document.head.appendChild(E));for(const D of T)y.classList.add(D);for(const D of L)y.classList.remove(D);W&&y.setAttribute(W.key,W.value),u&&(a.getComputedStyle(E).opacity,document.head.removeChild(E))});function m(O){var _;g(t,n,(_=c[O])!=null?_:O)}function b(O){e.onChanged?e.onChanged(O,m):m(O)}o.watch(h,b,{flush:"post",immediate:!0}),S.tryOnMounted(()=>b(h.value));const P=o.computed({get(){return f?w.value:h.value},set(O){w.value=O}});return Object.assign(P,{store:w,system:U,state:h})}const Be=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ie(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),He=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=C.useDark(e),r=o.reactive({isDark:n,toggleDark:S.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Ne=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=C.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),Fe=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(C.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:C.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),Ye=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(C.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),xe=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:C.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var u;return(u=e.handle)!=null?u:n.value}),a=o.computed(()=>{var u;return(u=e.containerElement)!=null?u:void 0}),s=o.computed(()=>!!e.disabled),i=e.storageKey&&C.useStorage(e.storageKey,o.toValue(e.initialValue)||{x:0,y:0},C.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),l=i||e.initialValue||{x:0,y:0},d=(u,c)=>{var p;(p=e.onEnd)==null||p.call(e,u,c),i&&(i.value.x=u.x,i.value.y=u.y)},f=o.reactive(C.useDraggable(n,{...e,handle:r,initialValue:l,onEnd:d,disabled:s,containerElement:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${f.style}`},t.default(f))}}}),Ke=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function K(e,t,n={}){const{window:r=R,...a}=n;let s;const i=N(()=>r&&"MutationObserver"in r),l=()=>{s&&(s.disconnect(),s=void 0)},d=o.computed(()=>{const p=o.toValue(e),U=S.toArray(p).map(M).filter(S.notNullish);return new Set(U)}),f=o.watch(()=>d.value,p=>{l(),i.value&&p.size&&(s=new MutationObserver(t),p.forEach(U=>s.observe(U,a)))},{immediate:!0,flush:"post"}),u=()=>s?.takeRecords(),c=()=>{f(),l()};return S.tryOnScopeDispose(c),{isSupported:i,stop:c,takeRecords:u}}function F(e,t,n={}){const{window:r=R,...a}=n;let s;const i=N(()=>r&&"ResizeObserver"in r),l=()=>{s&&(s.disconnect(),s=void 0)},d=o.computed(()=>{const c=o.toValue(e);return Array.isArray(c)?c.map(p=>M(p)):[M(c)]}),f=o.watch(d,c=>{if(l(),i.value&&r){s=new ResizeObserver(t);for(const p of c)p&&s.observe(p,a)}},{immediate:!0,flush:"post"}),u=()=>{l(),f()};return S.tryOnScopeDispose(u),{isSupported:i,stop:u}}function Ge(e,t={}){const{reset:n=!0,windowResize:r=!0,windowScroll:a=!0,immediate:s=!0,updateTiming:i="sync"}=t,l=o.ref(0),d=o.ref(0),f=o.ref(0),u=o.ref(0),c=o.ref(0),p=o.ref(0),U=o.ref(0),w=o.ref(0);function h(){const m=M(e);if(!m){n&&(l.value=0,d.value=0,f.value=0,u.value=0,c.value=0,p.value=0,U.value=0,w.value=0);return}const b=m.getBoundingClientRect();l.value=b.height,d.value=b.bottom,f.value=b.left,u.value=b.right,c.value=b.top,p.value=b.width,U.value=b.x,w.value=b.y}function g(){i==="sync"?h():i==="next-frame"&&requestAnimationFrame(()=>h())}return F(e,g),o.watch(()=>M(e),m=>!m&&g()),K(e,g,{attributeFilter:["style","class"]}),a&&k("scroll",g,{capture:!0,passive:!0}),r&&k("resize",g,{passive:!0}),S.tryOnMounted(()=>{s&&g()}),{height:l,bottom:d,left:f,right:u,top:c,width:p,x:U,y:w,update:g}}const Je={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,{height:a,bottom:s,left:i,right:l,top:d,width:f,x:u,y:c}=Ge(e,r);o.watch([a,s,i,l,d,f,u,c],()=>n({height:a,bottom:s,left:i,right:l,top:d,width:f,x:u,y:c}))}};function $e(e,t,n={}){const{window:r=R,document:a=r?.document,flush:s="sync"}=n;if(!r||!a)return S.noop;let i;const l=u=>{i?.(),i=u},d=o.watchEffect(()=>{const u=M(e);if(u){const{stop:c}=K(a,p=>{p.map(w=>[...w.removedNodes]).flat().some(w=>w===u||w.contains(u))&&t(p)},{window:r,childList:!0,subtree:!0});l(c)}},{flush:s}),f=()=>{d(),l()};return S.tryOnScopeDispose(f),f}function ae(e,t={}){const{delayEnter:n=0,delayLeave:r=0,triggerOnRemoval:a=!1,window:s=R}=t,i=o.ref(!1);let l;const d=f=>{const u=f?n:r;l&&(clearTimeout(l),l=void 0),u?l=setTimeout(()=>i.value=f,u):i.value=f};return s&&(k(e,"mouseenter",()=>d(!0),{passive:!0}),k(e,"mouseleave",()=>d(!1),{passive:!0}),a&&$e(o.computed(()=>M(e)),()=>d(!1))),i}const qe={mounted(e,t){const n=t.value;if(typeof n=="function"){const r=ae(e);o.watch(r,a=>n(a))}else{const[r,a]=n,s=ae(e,a);o.watch(s,i=>r(i))}}},Qe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementSize(n,{width:e.width,height:e.height},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Ze(e,t={width:0,height:0},n={}){const{window:r=R,box:a="content-box"}=n,s=o.computed(()=>{var c,p;return(p=(c=M(e))==null?void 0:c.namespaceURI)==null?void 0:p.includes("svg")}),i=o.ref(t.width),l=o.ref(t.height),{stop:d}=F(e,([c])=>{const p=a==="border-box"?c.borderBoxSize:a==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(r&&s.value){const U=M(e);if(U){const w=U.getBoundingClientRect();i.value=w.width,l.value=w.height}}else if(p){const U=S.toArray(p);i.value=U.reduce((w,{inlineSize:h})=>w+h,0),l.value=U.reduce((w,{blockSize:h})=>w+h,0)}else i.value=c.contentRect.width,l.value=c.contentRect.height},n);S.tryOnMounted(()=>{const c=M(e);c&&(i.value="offsetWidth"in c?c.offsetWidth:t.width,l.value="offsetHeight"in c?c.offsetHeight:t.height)});const f=o.watch(()=>M(e),c=>{i.value=c?t.width:0,l.value=c?t.height:0});function u(){d(),f()}return{width:i,height:l,stop:u}}const et={mounted(e,t){var n;const r=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],a=typeof t.value=="function"?[]:t.value.slice(1),{width:s,height:i}=Ze(e,...a);o.watch([s,i],([l,d])=>r({width:l,height:d}))}},tt=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:C.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function G(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:s=0,window:i=R,immediate:l=!0}=n,d=N(()=>i&&"IntersectionObserver"in i),f=o.computed(()=>{const w=o.toValue(e);return S.toArray(w).map(M).filter(S.notNullish)});let u=S.noop;const c=o.ref(l),p=d.value?o.watch(()=>[f.value,M(r),c.value],([w,h])=>{if(u(),!c.value||!w.length)return;const g=new IntersectionObserver(t,{root:M(h),rootMargin:a,threshold:s});w.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=S.noop}},{immediate:l,flush:"post"}):S.noop,U=()=>{u(),p(),c.value=!1};return S.tryOnScopeDispose(U),{isSupported:d,isActive:c,pause(){u(),c.value=!1},resume(){c.value=!0},stop:U}}function J(e,t={}){const{window:n=R,scrollTarget:r,threshold:a=0,rootMargin:s}=t,i=o.ref(!1);return G(e,l=>{let d=i.value,f=0;for(const u of l)u.time>=f&&(f=u.time,d=u.isIntersecting);i.value=d},{root:r,window:n,threshold:a,rootMargin:o.toValue(s)}),i}const nt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=J(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=J(e,r);o.watch(a,s=>n(s),{immediate:!0})}}},ot=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(C.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),rt=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),at=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(C.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),st=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(C.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function it(e,t,n){const{immediate:r=!0,delay:a=0,onError:s=S.noop,onSuccess:i=S.noop,resetOnExecute:l=!0,shallow:d=!0,throwError:f}=n??{},u=d?o.shallowRef(t):o.ref(t),c=o.ref(!1),p=o.ref(!1),U=o.shallowRef(void 0);async function w(m=0,...b){l&&(u.value=t),U.value=void 0,c.value=!1,p.value=!0,m>0&&await S.promiseTimeout(m);const P=typeof e=="function"?e(...b):e;try{const O=await P;u.value=O,c.value=!0,i(O)}catch(O){if(U.value=O,s(O),f)throw O}finally{p.value=!1}return u.value}r&&w(a);const h={state:u,isReady:c,isLoading:p,error:U,execute:w};function g(){return new Promise((m,b)=>{S.until(p).toBe(!1).then(()=>m(h)).catch(b)})}return{...h,then(m,b){return g().then(m,b)}}}async function lt(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:s,sizes:i,class:l,loading:d,crossorigin:f,referrerPolicy:u,width:c,height:p,decoding:U,fetchPriority:w,ismap:h,usemap:g}=e;r.src=a,s!=null&&(r.srcset=s),i!=null&&(r.sizes=i),l!=null&&(r.className=l),d!=null&&(r.loading=d),f!=null&&(r.crossOrigin=f),u!=null&&(r.referrerPolicy=u),c!=null&&(r.width=c),p!=null&&(r.height=p),U!=null&&(r.decoding=U),w!=null&&(r.fetchPriority=w),h!=null&&(r.isMap=h),g!=null&&(r.useMap=g),r.onload=()=>t(r),r.onerror=n})}function ut(e,t={}){const n=it(()=>lt(o.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>o.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const ct=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(ut(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function j(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const se=1;function $(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=S.noop,onScroll:s=S.noop,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:l={capture:!1,passive:!0},behavior:d="auto",window:f=R,onError:u=y=>{console.error(y)}}=t,c=o.ref(0),p=o.ref(0),U=o.computed({get(){return c.value},set(y){h(y,void 0)}}),w=o.computed({get(){return p.value},set(y){h(void 0,y)}});function h(y,T){var L,W,E,D;if(!f)return;const V=o.toValue(e);if(!V)return;(E=V instanceof Document?f.document.body:V)==null||E.scrollTo({top:(L=o.toValue(T))!=null?L:w.value,left:(W=o.toValue(y))!=null?W:U.value,behavior:o.toValue(d)});const z=((D=V?.document)==null?void 0:D.documentElement)||V?.documentElement||V;U!=null&&(c.value=z.scrollLeft),w!=null&&(p.value=z.scrollTop)}const g=o.ref(!1),m=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),b=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),P=y=>{g.value&&(g.value=!1,b.left=!1,b.right=!1,b.top=!1,b.bottom=!1,a(y))},O=S.useDebounceFn(P,n+r),_=y=>{var T;if(!f)return;const L=((T=y?.document)==null?void 0:T.documentElement)||y?.documentElement||M(y),{display:W,flexDirection:E,direction:D}=getComputedStyle(L),V=D==="rtl"?-1:1,z=L.scrollLeft;b.left=z<c.value,b.right=z>c.value;const me=z*V<=(i.left||0),pe=z*V+L.clientWidth>=L.scrollWidth-(i.right||0)-se;W==="flex"&&E==="row-reverse"?(m.left=pe,m.right=me):(m.left=me,m.right=pe),c.value=z;let I=L.scrollTop;y===f.document&&!I&&(I=f.document.body.scrollTop),b.top=I<p.value,b.bottom=I>p.value;const he=I<=(i.top||0),ge=I+L.clientHeight>=L.scrollHeight-(i.bottom||0)-se;W==="flex"&&E==="column-reverse"?(m.top=ge,m.bottom=he):(m.top=he,m.bottom=ge),p.value=I},A=y=>{var T;if(!f)return;const L=(T=y.target.documentElement)!=null?T:y.target;_(L),g.value=!0,O(y),s(y)};return k(e,"scroll",n?S.useThrottleFn(A,n,!0,!1):A,l),S.tryOnMounted(()=>{try{const y=o.toValue(e);if(!y)return;_(y)}catch(y){u(y)}}),k(e,"scrollend",P,l),{x:U,y:w,isScrolling:g,arrivedState:m,directions:b,measure(){const y=o.toValue(e);f&&y&&_(y)}}}function ie(e,t,n={}){var r;const{direction:a="bottom",interval:s=100,canLoadMore:i=()=>!0}=n,l=o.reactive($(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),d=o.ref(),f=o.computed(()=>!!d.value),u=o.computed(()=>j(o.toValue(e))),c=J(u);function p(){if(l.measure(),!u.value||!c.value||!i(u.value))return;const{scrollHeight:w,clientHeight:h,scrollWidth:g,clientWidth:m}=u.value,b=a==="bottom"||a==="top"?w<=h:g<=m;(l.arrivedState[a]||b)&&(d.value||(d.value=Promise.all([t(l),new Promise(P=>setTimeout(P,s))]).finally(()=>{d.value=null,o.nextTick(()=>p())})))}const U=o.watch(()=>[l.arrivedState[a],c.value],p,{immediate:!0});return S.tryOnUnmounted(U),{isLoading:f,reset(){o.nextTick(()=>p())}}}const ft={mounted(e,t){typeof t.value=="function"?ie(e,t.value):ie(e,...t.value)}},dt={mounted(e,t){typeof t.value=="function"?G(e,t.value):G(e,...t.value)}},mt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(C.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),ht={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function gt(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:r=!1,initialValue:a={x:0,y:0},window:s=R,target:i=s,scroll:l=!0,eventFilter:d}=e;let f=null,u=0,c=0;const p=o.ref(a.x),U=o.ref(a.y),w=o.ref(null),h=typeof t=="function"?t:ht[t],g=y=>{const T=h(y);f=y,T&&([p.value,U.value]=T,w.value="mouse"),s&&(u=s.scrollX,c=s.scrollY)},m=y=>{if(y.touches.length>0){const T=h(y.touches[0]);T&&([p.value,U.value]=T,w.value="touch")}},b=()=>{if(!f||!s)return;const y=h(f);f instanceof MouseEvent&&y&&(p.value=y[0]+s.scrollX-u,U.value=y[1]+s.scrollY-c)},P=()=>{p.value=a.x,U.value=a.y},O=d?y=>d(()=>g(y),{}):y=>g(y),_=d?y=>d(()=>m(y),{}):y=>m(y),A=d?()=>d(()=>b(),{}):()=>b();if(i){const y={passive:!0};k(i,["mousemove","dragover"],O,y),n&&t!=="movement"&&(k(i,["touchstart","touchmove"],_,y),r&&k(i,"touchend",P,y)),l&&t==="page"&&k(s,"scroll",A,y)}return{x:p,y:U,sourceType:w}}function yt(e,t={}){const{handleOutside:n=!0,window:r=R}=t,a=t.type||"page",{x:s,y:i,sourceType:l}=gt(t),d=o.ref(e??r?.document.body),f=o.ref(0),u=o.ref(0),c=o.ref(0),p=o.ref(0),U=o.ref(0),w=o.ref(0),h=o.ref(!0);let g=()=>{};return r&&(g=o.watch([d,s,i],()=>{const m=M(d);if(!m||!(m instanceof Element))return;const{left:b,top:P,width:O,height:_}=m.getBoundingClientRect();c.value=b+(a==="page"?r.pageXOffset:0),p.value=P+(a==="page"?r.pageYOffset:0),U.value=_,w.value=O;const A=s.value-c.value,y=i.value-p.value;h.value=O===0||_===0||A<0||y<0||A>O||y>_,(n||!h.value)&&(f.value=A,u.value=y)},{immediate:!0}),k(document,"mouseleave",()=>h.value=!0,{passive:!0})),{x:s,y:i,sourceType:l,elementX:f,elementY:u,elementPositionX:c,elementPositionY:p,elementHeight:U,elementWidth:w,isOutside:h,stop:g}}const vt={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,a=S.reactiveOmit(o.reactive(yt(e,r)),"stop");o.watch(a,s=>n(s))}},wt=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Ut=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(C.useNetwork());return()=>{if(t.default)return t.default(n)}}}),St=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(C.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=S.toRef(e,"object"),r=C.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),Ct=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const r=o.reactive(C.useOffsetPagination({...e,onPageChange(...a){var s;(s=e.onPageChange)==null||s.call(e,...a),n("page-change",...a)},onPageSizeChange(...a){var s;(s=e.onPageSizeChange)==null||s.call(e,...a),n("page-size-change",...a)},onPageCountChange(...a){var s;(s=e.onPageCountChange)==null||s.call(e,...a),n("page-count-change",...a)}}));return()=>{if(t.default)return t.default(r)}}}),Et=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:C.useOnline()});return()=>{if(t.default)return t.default(n)}}}),Ot=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:C.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),Pt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.ref(null),r=o.reactive(C.usePointer({...e,target:e.target==="self"?n:R}));return()=>{if(t.default)return t.default(r,{ref:n})}}}),Vt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),_t=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:C.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),Dt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:C.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),Lt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:C.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:C.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:C.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:C.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),At={mounted(e,t){typeof t.value=="function"?F(e,t.value):F(e,...t.value)}};function Y(e,t,n={}){const{window:r=R,initialValue:a,observe:s=!1}=n,i=o.ref(a),l=o.computed(()=>{var f;return M(t)||((f=r?.document)==null?void 0:f.documentElement)});function d(){var f;const u=o.toValue(e),c=o.toValue(l);if(c&&r&&u){const p=(f=r.getComputedStyle(c).getPropertyValue(u))==null?void 0:f.trim();i.value=p||a}}return s&&K(l,d,{attributeFilter:["style","class"],window:r}),o.watch([l,()=>o.toValue(e)],(f,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),d()},{immediate:!0}),o.watch(i,f=>{var u;const c=o.toValue(e);(u=l.value)!=null&&u.style&&c&&(f==null?l.value.style.removeProperty(c):l.value.style.setProperty(c,f))}),i}const le="--vueuse-safe-area-top",ue="--vueuse-safe-area-right",ce="--vueuse-safe-area-bottom",fe="--vueuse-safe-area-left";function Rt(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(S.isClient){const s=Y(le),i=Y(ue),l=Y(ce),d=Y(fe);s.value="env(safe-area-inset-top, 0px)",i.value="env(safe-area-inset-right, 0px)",l.value="env(safe-area-inset-bottom, 0px)",d.value="env(safe-area-inset-left, 0px)",a(),k("resize",S.useDebounceFn(a),{passive:!0})}function a(){e.value=x(le),t.value=x(ue),n.value=x(ce),r.value=x(fe)}return{top:e,right:t,bottom:n,left:r,update:a}}function x(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const Wt=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:r,bottom:a,left:s}=Rt();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?r.value:"",paddingBottom:e.bottom?a.value:"",paddingLeft:e.left?s.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),zt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=$(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=$(e,{...r,onScroll(s){var i;(i=r.onScroll)==null||i.call(r,s),n(a)},onStop(s){var i;(i=r.onStop)==null||i.call(r,s),n(a)}})}}};function de(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:de(n)}}function It(e){const t=e||window.event,n=t.target;return de(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const q=new WeakMap;function Bt(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(S.toRef(e),l=>{const d=j(o.toValue(l));if(d){const f=d;if(q.get(f)||q.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(a=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const s=()=>{const l=j(o.toValue(e));!l||n.value||(S.isIOS&&(r=k(l,"touchmove",d=>{It(d)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},i=()=>{const l=j(o.toValue(e));!l||!n.value||(S.isIOS&&r?.(),l.style.overflow=a,q.delete(l),n.value=!1)};return S.tryOnScopeDispose(i),o.computed({get(){return n.value},set(l){l?s():i()}})}function Ht(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Bt(n,r.value);o.watch(t,s=>a.value=s)}}const Nt=Ht(),Ft=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(C.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),jt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(C.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Yt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:r}=o.toRefs(e),{list:a,containerProps:s,wrapperProps:i,scrollTo:l}=C.useVirtualList(r,e.options);return n({scrollTo:l}),s.style&&typeof s.style=="object"&&!Array.isArray(s.style)&&(s.style.height=e.height||"300px"),()=>o.h("div",{...s},[o.h("div",{...i.value},a.value.map(d=>o.h("div",{style:{overflow:"hidden",height:d.height}},t.default?t.default(d):"Please set content!")))])}}),xt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:C.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Xt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(C.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});v.OnClickOutside=ye,v.OnLongPress=be,v.UseActiveElement=Ce,v.UseBattery=Ee,v.UseBrowserLocation=Oe,v.UseClipboard=Pe,v.UseColorMode=Be,v.UseDark=He,v.UseDeviceMotion=Ne,v.UseDeviceOrientation=Fe,v.UseDevicePixelRatio=je,v.UseDevicesList=Ye,v.UseDocumentVisibility=xe,v.UseDraggable=Xe,v.UseElementBounding=Ke,v.UseElementSize=Qe,v.UseElementVisibility=tt,v.UseEyeDropper=ot,v.UseFullscreen=rt,v.UseGeolocation=at,v.UseIdle=st,v.UseImage=ct,v.UseMouse=mt,v.UseMouseInElement=pt,v.UseMousePressed=wt,v.UseNetwork=Ut,v.UseNow=St,v.UseObjectUrl=bt,v.UseOffsetPagination=Ct,v.UseOnline=Et,v.UsePageLeave=Ot,v.UsePointer=Pt,v.UsePointerLock=Vt,v.UsePreferredColorScheme=_t,v.UsePreferredContrast=Dt,v.UsePreferredDark=Lt,v.UsePreferredLanguages=Mt,v.UsePreferredReducedMotion=Tt,v.UsePreferredReducedTransparency=kt,v.UseScreenSafeArea=Wt,v.UseTimeAgo=Ft,v.UseTimestamp=jt,v.UseVirtualList=Yt,v.UseWindowFocus=xt,v.UseWindowSize=Xt,v.VOnClickOutside=ee,v.VOnLongPress=ne,v.vElementBounding=Je,v.vElementHover=qe,v.vElementSize=et,v.vElementVisibility=nt,v.vInfiniteScroll=ft,v.vIntersectionObserver=dt,v.vMouseInElement=vt,v.vOnClickOutside=ee,v.vOnKeyStroke=we,v.vOnLongPress=ne,v.vResizeObserver=At,v.vScroll=zt,v.vScrollLock=Nt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
1
+ (function(w,C,o,S){"use strict";const ye=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return C.onClickOutside(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),A=S.isClient?window:void 0;function k(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function M(...e){const t=[],n=()=>{t.forEach(s=>s()),t.length=0},r=(s,f,c,u)=>(s.addEventListener(f,c,u),()=>s.removeEventListener(f,c,u)),a=o.computed(()=>{const s=S.toArray(o.toValue(e[0])).filter(f=>f!=null);return s.every(f=>typeof f!="string")?s:void 0}),l=S.watchImmediate(()=>{var s,f;return[(f=(s=a.value)==null?void 0:s.map(c=>k(c)))!=null?f:[A].filter(c=>c!=null),S.toArray(o.toValue(a.value?e[1]:e[0])),S.toArray(o.unref(a.value?e[2]:e[1])),o.toValue(a.value?e[3]:e[2])]},([s,f,c,u])=>{if(n(),!s?.length||!f?.length||!c?.length)return;const d=S.isObject(u)?{...u}:u;t.push(...s.flatMap(p=>f.flatMap(U=>c.map(v=>r(p,U,v,d)))))},{flush:"post"}),i=()=>{l(),n()};return S.tryOnScopeDispose(n),i}let Q=!1;function Z(e,t,n={}){const{window:r=A,ignore:a=[],capture:l=!0,detectIframe:i=!1}=n;if(!r)return S.noop;if(S.isIOS&&!Q){Q=!0;const h={passive:!0};Array.from(r.document.body.children).forEach(y=>M(y,"click",S.noop,h)),M(r.document.documentElement,"click",S.noop,h)}let s=!0;const f=h=>o.toValue(a).some(y=>{if(typeof y=="string")return Array.from(r.document.querySelectorAll(y)).some(m=>m===h.target||h.composedPath().includes(m));{const m=k(y);return m&&(h.target===m||h.composedPath().includes(m))}});function c(h){const y=o.toValue(h);return y&&y.$.subTree.shapeFlag===16}function u(h,y){const m=o.toValue(h),b=m.$.subTree&&m.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(P=>P.el===y.target||y.composedPath().includes(P.el))}const d=h=>{const y=k(e);if(h.target!=null&&!(!(y instanceof Element)&&c(e)&&u(e,h))&&!(!y||y===h.target||h.composedPath().includes(y))){if(h.detail===0&&(s=!f(h)),!s){s=!0;return}t(h)}};let p=!1;const U=[M(r,"click",h=>{p||(p=!0,setTimeout(()=>{p=!1},0),d(h))},{passive:!0,capture:l}),M(r,"pointerdown",h=>{const y=k(e);s=!f(h)&&!!(y&&!h.composedPath().includes(y))},{passive:!0}),i&&M(r,"blur",h=>{setTimeout(()=>{var y;const m=k(e);((y=r.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!m?.contains(r.document.activeElement)&&t(h)},0)},{passive:!0})].filter(Boolean);return()=>U.forEach(h=>h())}const ee={mounted(e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=Z(e,t.value,{capture:n});else{const[r,a]=t.value;e.__onClickOutside_stop=Z(e,r,Object.assign({capture:n},a))}},unmounted(e){e.__onClickOutside_stop()}};function ve(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function te(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:a=A,eventName:l="keydown",passive:i=!1,dedupe:s=!1}=r,f=ve(t);return M(a,l,u=>{u.repeat&&o.toValue(s)||f(u)&&n(u)},i)}const we={mounted(e,t){var n,r;const a=(r=(n=t.arg)==null?void 0:n.split(","))!=null?r:!0;if(typeof t.value=="function")te(a,t.value,{target:e});else{const[l,i]=t.value;te(a,l,{target:e,...i})}}},Ue=500,Se=10;function X(e,t,n){var r,a;const l=o.computed(()=>k(e));let i,s,f,c=!1;function u(){i&&(clearTimeout(i),i=void 0),s=void 0,f=void 0,c=!1}function d(m){var b,P,O;const[D,R,g]=[f,s,c];if(u(),!n?.onMouseUp||!R||!D||(b=n?.modifiers)!=null&&b.self&&m.target!==l.value)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const L=m.x-R.x,T=m.y-R.y,I=Math.sqrt(L*L+T*T);n.onMouseUp(m.timeStamp-D,I,g)}function p(m){var b,P,O,D;(b=n?.modifiers)!=null&&b.self&&m.target!==l.value||(u(),(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation(),s={x:m.x,y:m.y},f=m.timeStamp,i=setTimeout(()=>{c=!0,t(m)},(D=n?.delay)!=null?D:Ue))}function U(m){var b,P,O,D;if((b=n?.modifiers)!=null&&b.self&&m.target!==l.value||!s||n?.distanceThreshold===!1)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const R=m.x-s.x,g=m.y-s.y;Math.sqrt(R*R+g*g)>=((D=n?.distanceThreshold)!=null?D:Se)&&u()}const v={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},h=[M(l,"pointerdown",p,v),M(l,"pointermove",U,v),M(l,["pointerup","pointerleave"],d,v)];return()=>h.forEach(m=>m())}const be=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return X(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),ne={mounted(e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},Ce=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:C.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Ee=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(C.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Oe=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(C.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(C.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H="__vueuse_ssr_handlers__",Ve=De();function De(){return H in B||(B[H]=B[H]||{}),B[H]}function oe(e,t){return Ve[e]||t}const _e=Symbol("vueuse-ssr-width");function Me(){const e=o.hasInjectionContext()?S.injectLocal(_e,null):null;return typeof e=="number"?e:void 0}function Te(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function N(e){const t=Te();return o.computed(()=>(t.value,!!e()))}function ke(e,t={}){const{window:n=A,ssrWidth:r=Me()}=t,a=N(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),l=o.ref(typeof r=="number"),i=o.shallowRef(),s=o.ref(!1),f=c=>{s.value=c.matches};return o.watchEffect(()=>{if(l.value){l.value=!a.value;const c=o.toValue(e).split(",");s.value=c.some(u=>{const d=u.includes("not all"),p=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),U=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let v=!!(p||U);return p&&v&&(v=r>=S.pxValue(p[1])),U&&v&&(v=r<=S.pxValue(U[1])),d?!v:v});return}a.value&&(i.value=n.matchMedia(o.toValue(e)),s.value=i.value.matches)}),M(i,"change",f,{passive:!0}),o.computed(()=>s.value)}function Le(e){return ke("(prefers-color-scheme: dark)",e)}function Re(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"?"object":Number.isNaN(e)?"any":"number"}const Ae={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()}},re="vueuse-storage";function Ie(e,t,n,r={}){var a;const{flush:l="pre",deep:i=!0,listenToStorageChanges:s=!0,writeDefaults:f=!0,mergeDefaults:c=!1,shallow:u,window:d=A,eventFilter:p,onError:U=E=>{console.error(E)},initOnMounted:v}=r,h=(u?o.shallowRef:o.ref)(typeof t=="function"?t():t),y=o.computed(()=>o.toValue(e));if(!n)try{n=oe("getDefaultStorage",()=>{var E;return(E=A)==null?void 0:E.localStorage})()}catch(E){U(E)}if(!n)return h;const m=o.toValue(t),b=Re(m),P=(a=r.serializer)!=null?a:Ae[b],{pause:O,resume:D}=S.pausableWatch(h,()=>g(h.value),{flush:l,deep:i,eventFilter:p});o.watch(y,()=>T(),{flush:l}),d&&s&&S.tryOnMounted(()=>{n instanceof Storage?M(d,"storage",T,{passive:!0}):M(d,re,I),v&&T()}),v||T();function R(E,_){if(d){const V={key:y.value,oldValue:E,newValue:_,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",V):new CustomEvent(re,{detail:V}))}}function g(E){try{const _=n.getItem(y.value);if(E==null)R(_,null),n.removeItem(y.value);else{const V=P.write(E);_!==V&&(n.setItem(y.value,V),R(_,V))}}catch(_){U(_)}}function L(E){const _=E?E.newValue:n.getItem(y.value);if(_==null)return f&&m!=null&&n.setItem(y.value,P.write(m)),m;if(!E&&c){const V=P.read(_);return typeof c=="function"?c(V,m):b==="object"&&!Array.isArray(V)?{...m,...V}:V}else return typeof _!="string"?_:P.read(_)}function T(E){if(!(E&&E.storageArea!==n)){if(E&&E.key==null){h.value=m;return}if(!(E&&E.key!==y.value)){O();try{E?.newValue!==P.write(h.value)&&(h.value=L(E))}catch(_){U(_)}finally{E?o.nextTick(D):D()}}}}function I(E){T(E.detail)}return h}const ze="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function We(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=A,storage:l,storageKey:i="vueuse-color-scheme",listenToStorageChanges:s=!0,storageRef:f,emitAuto:c,disableTransition:u=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},p=Le({window:a}),U=o.computed(()=>p.value?"dark":"light"),v=f||(i==null?S.toRef(r):Ie(i,r,l,{window:a,listenToStorageChanges:s})),h=o.computed(()=>v.value==="auto"?U.value:v.value),y=oe("updateHTMLAttrs",(O,D,R)=>{const g=typeof O=="string"?a?.document.querySelector(O):k(O);if(!g)return;const L=new Set,T=new Set;let I=null;if(D==="class"){const _=R.split(/\s/g);Object.values(d).flatMap(V=>(V||"").split(/\s/g)).filter(Boolean).forEach(V=>{_.includes(V)?L.add(V):T.add(V)})}else I={key:D,value:R};if(L.size===0&&T.size===0&&I===null)return;let E;u&&(E=a.document.createElement("style"),E.appendChild(document.createTextNode(ze)),a.document.head.appendChild(E));for(const _ of L)g.classList.add(_);for(const _ of T)g.classList.remove(_);I&&g.setAttribute(I.key,I.value),u&&(a.getComputedStyle(E).opacity,document.head.removeChild(E))});function m(O){var D;y(t,n,(D=d[O])!=null?D:O)}function b(O){e.onChanged?e.onChanged(O,m):m(O)}o.watch(h,b,{flush:"post",immediate:!0}),S.tryOnMounted(()=>b(h.value));const P=o.computed({get(){return c?v.value:h.value},set(O){v.value=O}});return Object.assign(P,{store:v,system:U,state:h})}const Be=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=We(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),He=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=C.useDark(e),r=o.reactive({isDark:n,toggleDark:S.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Ne=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=C.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),Fe=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(C.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:C.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),Ye=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(C.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),xe=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:C.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var u;return(u=e.handle)!=null?u:n.value}),a=o.computed(()=>{var u;return(u=e.containerElement)!=null?u:void 0}),l=o.computed(()=>!!e.disabled),i=e.storageKey&&C.useStorage(e.storageKey,o.toValue(e.initialValue)||{x:0,y:0},C.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),s=i||e.initialValue||{x:0,y:0},f=(u,d)=>{var p;(p=e.onEnd)==null||p.call(e,u,d),i&&(i.value.x=u.x,i.value.y=u.y)},c=o.reactive(C.useDraggable(n,{...e,handle:r,initialValue:s,onEnd:f,disabled:l,containerElement:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${c.style}`},t.default(c))}}}),Ke=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function K(e,t,n={}){const{window:r=A,...a}=n;let l;const i=N(()=>r&&"MutationObserver"in r),s=()=>{l&&(l.disconnect(),l=void 0)},f=o.computed(()=>{const p=o.toValue(e),U=S.toArray(p).map(k).filter(S.notNullish);return new Set(U)}),c=o.watch(()=>f.value,p=>{s(),i.value&&p.size&&(l=new MutationObserver(t),p.forEach(U=>l.observe(U,a)))},{immediate:!0,flush:"post"}),u=()=>l?.takeRecords(),d=()=>{c(),s()};return S.tryOnScopeDispose(d),{isSupported:i,stop:d,takeRecords:u}}function F(e,t,n={}){const{window:r=A,...a}=n;let l;const i=N(()=>r&&"ResizeObserver"in r),s=()=>{l&&(l.disconnect(),l=void 0)},f=o.computed(()=>{const d=o.toValue(e);return Array.isArray(d)?d.map(p=>k(p)):[k(d)]}),c=o.watch(f,d=>{if(s(),i.value&&r){l=new ResizeObserver(t);for(const p of d)p&&l.observe(p,a)}},{immediate:!0,flush:"post"}),u=()=>{s(),c()};return S.tryOnScopeDispose(u),{isSupported:i,stop:u}}function Ge(e,t={}){const{reset:n=!0,windowResize:r=!0,windowScroll:a=!0,immediate:l=!0,updateTiming:i="sync"}=t,s=o.ref(0),f=o.ref(0),c=o.ref(0),u=o.ref(0),d=o.ref(0),p=o.ref(0),U=o.ref(0),v=o.ref(0);function h(){const m=k(e);if(!m){n&&(s.value=0,f.value=0,c.value=0,u.value=0,d.value=0,p.value=0,U.value=0,v.value=0);return}const b=m.getBoundingClientRect();s.value=b.height,f.value=b.bottom,c.value=b.left,u.value=b.right,d.value=b.top,p.value=b.width,U.value=b.x,v.value=b.y}function y(){i==="sync"?h():i==="next-frame"&&requestAnimationFrame(()=>h())}return F(e,y),o.watch(()=>k(e),m=>!m&&y()),K(e,y,{attributeFilter:["style","class"]}),a&&M("scroll",y,{capture:!0,passive:!0}),r&&M("resize",y,{passive:!0}),S.tryOnMounted(()=>{l&&y()}),{height:s,bottom:f,left:c,right:u,top:d,width:p,x:U,y:v,update:y}}const Je={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,{height:a,bottom:l,left:i,right:s,top:f,width:c,x:u,y:d}=Ge(e,r);o.watch([a,l,i,s,f,c,u,d],()=>n({height:a,bottom:l,left:i,right:s,top:f,width:c,x:u,y:d}))}};function $e(e,t,n={}){const{window:r=A,document:a=r?.document,flush:l="sync"}=n;if(!r||!a)return S.noop;let i;const s=u=>{i?.(),i=u},f=o.watchEffect(()=>{const u=k(e);if(u){const{stop:d}=K(a,p=>{p.map(v=>[...v.removedNodes]).flat().some(v=>v===u||v.contains(u))&&t(p)},{window:r,childList:!0,subtree:!0});s(d)}},{flush:l}),c=()=>{f(),s()};return S.tryOnScopeDispose(c),c}function ae(e,t={}){const{delayEnter:n=0,delayLeave:r=0,triggerOnRemoval:a=!1,window:l=A}=t,i=o.ref(!1);let s;const f=c=>{const u=c?n:r;s&&(clearTimeout(s),s=void 0),u?s=setTimeout(()=>i.value=c,u):i.value=c};return l&&(M(e,"mouseenter",()=>f(!0),{passive:!0}),M(e,"mouseleave",()=>f(!1),{passive:!0}),a&&$e(o.computed(()=>k(e)),()=>f(!1))),i}const qe={mounted(e,t){const n=t.value;if(typeof n=="function"){const r=ae(e);o.watch(r,a=>n(a))}else{const[r,a]=n,l=ae(e,a);o.watch(l,i=>r(i))}}},Qe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementSize(n,{width:e.width,height:e.height},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Ze(e,t={width:0,height:0},n={}){const{window:r=A,box:a="content-box"}=n,l=o.computed(()=>{var d,p;return(p=(d=k(e))==null?void 0:d.namespaceURI)==null?void 0:p.includes("svg")}),i=o.ref(t.width),s=o.ref(t.height),{stop:f}=F(e,([d])=>{const p=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(r&&l.value){const U=k(e);if(U){const v=U.getBoundingClientRect();i.value=v.width,s.value=v.height}}else if(p){const U=S.toArray(p);i.value=U.reduce((v,{inlineSize:h})=>v+h,0),s.value=U.reduce((v,{blockSize:h})=>v+h,0)}else i.value=d.contentRect.width,s.value=d.contentRect.height},n);S.tryOnMounted(()=>{const d=k(e);d&&(i.value="offsetWidth"in d?d.offsetWidth:t.width,s.value="offsetHeight"in d?d.offsetHeight:t.height)});const c=o.watch(()=>k(e),d=>{i.value=d?t.width:0,s.value=d?t.height:0});function u(){f(),c()}return{width:i,height:s,stop:u}}const et={mounted(e,t){var n;const r=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],a=typeof t.value=="function"?[]:t.value.slice(1),{width:l,height:i}=Ze(e,...a);o.watch([l,i],([s,f])=>r({width:s,height:f}))}},tt=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:C.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function G(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:l=0,window:i=A,immediate:s=!0}=n,f=N(()=>i&&"IntersectionObserver"in i),c=o.computed(()=>{const v=o.toValue(e);return S.toArray(v).map(k).filter(S.notNullish)});let u=S.noop;const d=o.ref(s),p=f.value?o.watch(()=>[c.value,k(r),d.value],([v,h])=>{if(u(),!d.value||!v.length)return;const y=new IntersectionObserver(t,{root:k(h),rootMargin:a,threshold:l});v.forEach(m=>m&&y.observe(m)),u=()=>{y.disconnect(),u=S.noop}},{immediate:s,flush:"post"}):S.noop,U=()=>{u(),p(),d.value=!1};return S.tryOnScopeDispose(U),{isSupported:f,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:U}}function J(e,t={}){const{window:n=A,scrollTarget:r,threshold:a=0,rootMargin:l}=t,i=o.ref(!1);return G(e,s=>{let f=i.value,c=0;for(const u of s)u.time>=c&&(c=u.time,f=u.isIntersecting);i.value=f},{root:r,window:n,threshold:a,rootMargin:o.toValue(l)}),i}const nt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=J(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=J(e,r);o.watch(a,l=>n(l),{immediate:!0})}}},ot=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(C.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),rt=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),at=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(C.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),st=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(C.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function lt(e,t,n){const{immediate:r=!0,delay:a=0,onError:l=S.noop,onSuccess:i=S.noop,resetOnExecute:s=!0,shallow:f=!0,throwError:c}=n??{},u=f?o.shallowRef(t):o.ref(t),d=o.ref(!1),p=o.ref(!1),U=o.shallowRef(void 0);async function v(m=0,...b){s&&(u.value=t),U.value=void 0,d.value=!1,p.value=!0,m>0&&await S.promiseTimeout(m);const P=typeof e=="function"?e(...b):e;try{const O=await P;u.value=O,d.value=!0,i(O)}catch(O){if(U.value=O,l(O),c)throw O}finally{p.value=!1}return u.value}r&&v(a);const h={state:u,isReady:d,isLoading:p,error:U,execute:v};function y(){return new Promise((m,b)=>{S.until(p).toBe(!1).then(()=>m(h)).catch(b)})}return{...h,then(m,b){return y().then(m,b)}}}async function it(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:l,sizes:i,class:s,loading:f,crossorigin:c,referrerPolicy:u,width:d,height:p,decoding:U,fetchPriority:v,ismap:h,usemap:y}=e;r.src=a,l!=null&&(r.srcset=l),i!=null&&(r.sizes=i),s!=null&&(r.className=s),f!=null&&(r.loading=f),c!=null&&(r.crossOrigin=c),u!=null&&(r.referrerPolicy=u),d!=null&&(r.width=d),p!=null&&(r.height=p),U!=null&&(r.decoding=U),v!=null&&(r.fetchPriority=v),h!=null&&(r.isMap=h),y!=null&&(r.useMap=y),r.onload=()=>t(r),r.onerror=n})}function ut(e,t={}){const n=lt(()=>it(o.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>o.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const ct=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(ut(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function j(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const se=1;function $(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=S.noop,onScroll:l=S.noop,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:f="auto",window:c=A,onError:u=g=>{console.error(g)}}=t,d=o.ref(0),p=o.ref(0),U=o.computed({get(){return d.value},set(g){h(g,void 0)}}),v=o.computed({get(){return p.value},set(g){h(void 0,g)}});function h(g,L){var T,I,E,_;if(!c)return;const V=o.toValue(e);if(!V)return;(E=V instanceof Document?c.document.body:V)==null||E.scrollTo({top:(T=o.toValue(L))!=null?T:v.value,left:(I=o.toValue(g))!=null?I:U.value,behavior:o.toValue(f)});const z=((_=V?.document)==null?void 0:_.documentElement)||V?.documentElement||V;U!=null&&(d.value=z.scrollLeft),v!=null&&(p.value=z.scrollTop)}const y=o.ref(!1),m=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),b=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),P=g=>{y.value&&(y.value=!1,b.left=!1,b.right=!1,b.top=!1,b.bottom=!1,a(g))},O=S.useDebounceFn(P,n+r),D=g=>{var L;if(!c)return;const T=((L=g?.document)==null?void 0:L.documentElement)||g?.documentElement||k(g),{display:I,flexDirection:E,direction:_}=getComputedStyle(T),V=_==="rtl"?-1:1,z=T.scrollLeft;b.left=z<d.value,b.right=z>d.value;const me=z*V<=(i.left||0),pe=z*V+T.clientWidth>=T.scrollWidth-(i.right||0)-se;I==="flex"&&E==="row-reverse"?(m.left=pe,m.right=me):(m.left=me,m.right=pe),d.value=z;let W=T.scrollTop;g===c.document&&!W&&(W=c.document.body.scrollTop),b.top=W<p.value,b.bottom=W>p.value;const he=W<=(i.top||0),ge=W+T.clientHeight>=T.scrollHeight-(i.bottom||0)-se;I==="flex"&&E==="column-reverse"?(m.top=ge,m.bottom=he):(m.top=he,m.bottom=ge),p.value=W},R=g=>{var L;if(!c)return;const T=(L=g.target.documentElement)!=null?L:g.target;D(T),y.value=!0,O(g),l(g)};return M(e,"scroll",n?S.useThrottleFn(R,n,!0,!1):R,s),S.tryOnMounted(()=>{try{const g=o.toValue(e);if(!g)return;D(g)}catch(g){u(g)}}),M(e,"scrollend",P,s),{x:U,y:v,isScrolling:y,arrivedState:m,directions:b,measure(){const g=o.toValue(e);c&&g&&D(g)}}}function le(e,t,n={}){var r;const{direction:a="bottom",interval:l=100,canLoadMore:i=()=>!0}=n,s=o.reactive($(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),f=o.ref(),c=o.computed(()=>!!f.value),u=o.computed(()=>j(o.toValue(e))),d=J(u);function p(){if(s.measure(),!u.value||!d.value||!i(u.value))return;const{scrollHeight:v,clientHeight:h,scrollWidth:y,clientWidth:m}=u.value,b=a==="bottom"||a==="top"?v<=h:y<=m;(s.arrivedState[a]||b)&&(f.value||(f.value=Promise.all([t(s),new Promise(P=>setTimeout(P,l))]).finally(()=>{f.value=null,o.nextTick(()=>p())})))}const U=o.watch(()=>[s.arrivedState[a],d.value],p,{immediate:!0});return S.tryOnUnmounted(U),{isLoading:c,reset(){o.nextTick(()=>p())}}}const ft={mounted(e,t){typeof t.value=="function"?le(e,t.value):le(e,...t.value)}},dt={mounted(e,t){typeof t.value=="function"?G(e,t.value):G(e,...t.value)}},mt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(C.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),ht={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function gt(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:r=!1,initialValue:a={x:0,y:0},window:l=A,target:i=l,scroll:s=!0,eventFilter:f}=e;let c=null,u=0,d=0;const p=o.ref(a.x),U=o.ref(a.y),v=o.ref(null),h=typeof t=="function"?t:ht[t],y=g=>{const L=h(g);c=g,L&&([p.value,U.value]=L,v.value="mouse"),l&&(u=l.scrollX,d=l.scrollY)},m=g=>{if(g.touches.length>0){const L=h(g.touches[0]);L&&([p.value,U.value]=L,v.value="touch")}},b=()=>{if(!c||!l)return;const g=h(c);c instanceof MouseEvent&&g&&(p.value=g[0]+l.scrollX-u,U.value=g[1]+l.scrollY-d)},P=()=>{p.value=a.x,U.value=a.y},O=f?g=>f(()=>y(g),{}):g=>y(g),D=f?g=>f(()=>m(g),{}):g=>m(g),R=f?()=>f(()=>b(),{}):()=>b();if(i){const g={passive:!0};M(i,["mousemove","dragover"],O,g),n&&t!=="movement"&&(M(i,["touchstart","touchmove"],D,g),r&&M(i,"touchend",P,g)),s&&t==="page"&&M(l,"scroll",R,g)}return{x:p,y:U,sourceType:v}}function yt(e,t={}){const{handleOutside:n=!0,window:r=A}=t,a=t.type||"page",{x:l,y:i,sourceType:s}=gt(t),f=o.ref(e??r?.document.body),c=o.ref(0),u=o.ref(0),d=o.ref(0),p=o.ref(0),U=o.ref(0),v=o.ref(0),h=o.ref(!0);let y=()=>{};return r&&(y=o.watch([f,l,i],()=>{const m=k(f);if(!m||!(m instanceof Element))return;const{left:b,top:P,width:O,height:D}=m.getBoundingClientRect();d.value=b+(a==="page"?r.pageXOffset:0),p.value=P+(a==="page"?r.pageYOffset:0),U.value=D,v.value=O;const R=l.value-d.value,g=i.value-p.value;h.value=O===0||D===0||R<0||g<0||R>O||g>D,(n||!h.value)&&(c.value=R,u.value=g)},{immediate:!0}),M(document,"mouseleave",()=>h.value=!0,{passive:!0})),{x:l,y:i,sourceType:s,elementX:c,elementY:u,elementPositionX:d,elementPositionY:p,elementHeight:U,elementWidth:v,isOutside:h,stop:y}}const vt={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,a=S.reactiveOmit(o.reactive(yt(e,r)),"stop");o.watch(a,l=>n(l))}},wt=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Ut=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(C.useNetwork());return()=>{if(t.default)return t.default(n)}}}),St=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(C.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=S.toRef(e,"object"),r=C.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),Ct=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const r=o.reactive(C.useOffsetPagination({...e,onPageChange(...a){var l;(l=e.onPageChange)==null||l.call(e,...a),n("page-change",...a)},onPageSizeChange(...a){var l;(l=e.onPageSizeChange)==null||l.call(e,...a),n("page-size-change",...a)},onPageCountChange(...a){var l;(l=e.onPageCountChange)==null||l.call(e,...a),n("page-count-change",...a)}}));return()=>{if(t.default)return t.default(r)}}}),Et=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:C.useOnline()});return()=>{if(t.default)return t.default(n)}}}),Ot=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:C.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),Pt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.ref(null),r=o.reactive(C.usePointer({...e,target:e.target==="self"?n:A}));return()=>{if(t.default)return t.default(r,{ref:n})}}}),Vt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Dt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:C.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),_t=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:C.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:C.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:C.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:C.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),Lt=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:C.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),Rt={mounted(e,t){typeof t.value=="function"?F(e,t.value):F(e,...t.value)}};function Y(e,t,n={}){const{window:r=A,initialValue:a,observe:l=!1}=n,i=o.ref(a),s=o.computed(()=>{var c;return k(t)||((c=r?.document)==null?void 0:c.documentElement)});function f(){var c;const u=o.toValue(e),d=o.toValue(s);if(d&&r&&u){const p=(c=r.getComputedStyle(d).getPropertyValue(u))==null?void 0:c.trim();i.value=p||a}}return l&&K(s,f,{attributeFilter:["style","class"],window:r}),o.watch([s,()=>o.toValue(e)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),f()},{immediate:!0}),o.watch(i,c=>{var u;const d=o.toValue(e);(u=s.value)!=null&&u.style&&d&&(c==null?s.value.style.removeProperty(d):s.value.style.setProperty(d,c))}),i}const ie="--vueuse-safe-area-top",ue="--vueuse-safe-area-right",ce="--vueuse-safe-area-bottom",fe="--vueuse-safe-area-left";function At(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(S.isClient){const l=Y(ie),i=Y(ue),s=Y(ce),f=Y(fe);l.value="env(safe-area-inset-top, 0px)",i.value="env(safe-area-inset-right, 0px)",s.value="env(safe-area-inset-bottom, 0px)",f.value="env(safe-area-inset-left, 0px)",a(),M("resize",S.useDebounceFn(a),{passive:!0})}function a(){e.value=x(ie),t.value=x(ue),n.value=x(ce),r.value=x(fe)}return{top:e,right:t,bottom:n,left:r,update:a}}function x(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const It=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:r,bottom:a,left:l}=At();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?r.value:"",paddingBottom:e.bottom?a.value:"",paddingLeft:e.left?l.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),zt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=$(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=$(e,{...r,onScroll(l){var i;(i=r.onScroll)==null||i.call(r,l),n(a)},onStop(l){var i;(i=r.onStop)==null||i.call(r,l),n(a)}})}}};function de(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:de(n)}}function Wt(e){const t=e||window.event,n=t.target;return de(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const q=new WeakMap;function Bt(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(S.toRef(e),s=>{const f=j(o.toValue(s));if(f){const c=f;if(q.get(c)||q.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(a=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const l=()=>{const s=j(o.toValue(e));!s||n.value||(S.isIOS&&(r=M(s,"touchmove",f=>{Wt(f)},{passive:!1})),s.style.overflow="hidden",n.value=!0)},i=()=>{const s=j(o.toValue(e));!s||!n.value||(S.isIOS&&r?.(),s.style.overflow=a,q.delete(s),n.value=!1)};return S.tryOnScopeDispose(i),o.computed({get(){return n.value},set(s){s?l():i()}})}function Ht(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Bt(n,r.value);o.watch(t,l=>a.value=l)}}const Nt=Ht(),Ft=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(C.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),jt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(C.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Yt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:r}=o.toRefs(e),{list:a,containerProps:l,wrapperProps:i,scrollTo:s}=C.useVirtualList(r,e.options);return n({scrollTo:s}),l.style&&typeof l.style=="object"&&!Array.isArray(l.style)&&(l.style.height=e.height||"300px"),()=>o.h("div",{...l},[o.h("div",{...i.value},a.value.map(f=>o.h("div",{style:{overflow:"hidden",height:f.height}},t.default?t.default(f):"Please set content!")))])}}),xt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:C.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Xt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(C.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});w.OnClickOutside=ye,w.OnLongPress=be,w.UseActiveElement=Ce,w.UseBattery=Ee,w.UseBrowserLocation=Oe,w.UseClipboard=Pe,w.UseColorMode=Be,w.UseDark=He,w.UseDeviceMotion=Ne,w.UseDeviceOrientation=Fe,w.UseDevicePixelRatio=je,w.UseDevicesList=Ye,w.UseDocumentVisibility=xe,w.UseDraggable=Xe,w.UseElementBounding=Ke,w.UseElementSize=Qe,w.UseElementVisibility=tt,w.UseEyeDropper=ot,w.UseFullscreen=rt,w.UseGeolocation=at,w.UseIdle=st,w.UseImage=ct,w.UseMouse=mt,w.UseMouseInElement=pt,w.UseMousePressed=wt,w.UseNetwork=Ut,w.UseNow=St,w.UseObjectUrl=bt,w.UseOffsetPagination=Ct,w.UseOnline=Et,w.UsePageLeave=Ot,w.UsePointer=Pt,w.UsePointerLock=Vt,w.UsePreferredColorScheme=Dt,w.UsePreferredContrast=_t,w.UsePreferredDark=Mt,w.UsePreferredLanguages=Tt,w.UsePreferredReducedMotion=kt,w.UsePreferredReducedTransparency=Lt,w.UseScreenSafeArea=It,w.UseTimeAgo=Ft,w.UseTimestamp=jt,w.UseVirtualList=Yt,w.UseWindowFocus=xt,w.UseWindowSize=Xt,w.VOnClickOutside=ee,w.VOnLongPress=ne,w.vElementBounding=Je,w.vElementHover=qe,w.vElementSize=et,w.vElementVisibility=nt,w.vInfiniteScroll=ft,w.vIntersectionObserver=dt,w.vMouseInElement=vt,w.vOnClickOutside=ee,w.vOnKeyStroke=we,w.vOnLongPress=ne,w.vResizeObserver=Rt,w.vScroll=zt,w.vScrollLock=Nt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { onClickOutside as onClickOutside$1, useActiveElement, useBattery, useBrowserLocation, useClipboard, useDark, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDocumentVisibility, useStorage as useStorage$1, isClient as isClient$1, useDraggable, useElementBounding as useElementBounding$1, useElementSize as useElementSize$1, useElementVisibility as useElementVisibility$1, useEyeDropper, useFullscreen, useGeolocation, useIdle, useMouse as useMouse$1, useMouseInElement as useMouseInElement$1, useMousePressed, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, usePointer, usePointerLock, usePreferredColorScheme, usePreferredContrast, usePreferredDark as usePreferredDark$1, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, useTimeAgo, useTimestamp, useVirtualList, useWindowFocus, useWindowSize } from '@vueuse/core';
2
- import { defineComponent, ref, h, toValue, watch, computed, reactive, hasInjectionContext, getCurrentInstance, onMounted, watchEffect, shallowRef, nextTick, toRefs } from 'vue';
3
- import { isClient, noop, toArray, isObject, tryOnScopeDispose, isIOS, injectLocal, pxValue, pausableWatch, tryOnMounted, toRef, useToggle, notNullish, promiseTimeout, until, useDebounceFn, useThrottleFn, tryOnUnmounted, reactiveOmit } from '@vueuse/shared';
2
+ import { defineComponent, ref, h, toValue, computed, unref, reactive, hasInjectionContext, getCurrentInstance, onMounted, shallowRef, watchEffect, watch, nextTick, toRefs } from 'vue';
3
+ import { isClient, toArray, watchImmediate, isObject, tryOnScopeDispose, noop, isIOS, injectLocal, pxValue, pausableWatch, tryOnMounted, toRef, useToggle, notNullish, promiseTimeout, until, useDebounceFn, useThrottleFn, tryOnUnmounted, reactiveOmit } from '@vueuse/shared';
4
4
 
5
5
  const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
6
6
  name: "OnClickOutside",
@@ -27,49 +27,50 @@ function unrefElement(elRef) {
27
27
  }
28
28
 
29
29
  function useEventListener(...args) {
30
- let target;
31
- let events;
32
- let listeners;
33
- let options;
34
- if (typeof args[0] === "string" || Array.isArray(args[0])) {
35
- [events, listeners, options] = args;
36
- target = defaultWindow;
37
- } else {
38
- [target, events, listeners, options] = args;
39
- }
40
- if (!target)
41
- return noop;
42
- events = toArray(events);
43
- listeners = toArray(listeners);
44
30
  const cleanups = [];
45
31
  const cleanup = () => {
46
32
  cleanups.forEach((fn) => fn());
47
33
  cleanups.length = 0;
48
34
  };
49
- const register = (el, event, listener, options2) => {
50
- el.addEventListener(event, listener, options2);
51
- return () => el.removeEventListener(event, listener, options2);
35
+ const register = (el, event, listener, options) => {
36
+ el.addEventListener(event, listener, options);
37
+ return () => el.removeEventListener(event, listener, options);
52
38
  };
53
- const stopWatch = watch(
54
- () => [unrefElement(target), toValue(options)],
55
- ([el, options2]) => {
39
+ const firstParamTargets = computed(() => {
40
+ const test = toArray(toValue(args[0])).filter((e) => e != null);
41
+ return test.every((e) => typeof e !== "string") ? test : undefined;
42
+ });
43
+ const stopWatch = watchImmediate(
44
+ () => {
45
+ var _a, _b;
46
+ return [
47
+ (_b = (_a = firstParamTargets.value) == null ? undefined : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
48
+ toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
49
+ toArray(unref(firstParamTargets.value ? args[2] : args[1])),
50
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
51
+ toValue(firstParamTargets.value ? args[3] : args[2])
52
+ ];
53
+ },
54
+ ([raw_targets, raw_events, raw_listeners, raw_options]) => {
56
55
  cleanup();
57
- if (!el)
56
+ if (!(raw_targets == null ? undefined : raw_targets.length) || !(raw_events == null ? undefined : raw_events.length) || !(raw_listeners == null ? undefined : raw_listeners.length))
58
57
  return;
59
- const optionsClone = isObject(options2) ? { ...options2 } : options2;
58
+ const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
60
59
  cleanups.push(
61
- ...events.flatMap((event) => {
62
- return listeners.map((listener) => register(el, event, listener, optionsClone));
63
- })
60
+ ...raw_targets.flatMap(
61
+ (el) => raw_events.flatMap(
62
+ (event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
63
+ )
64
+ )
64
65
  );
65
66
  },
66
- { immediate: true, flush: "post" }
67
+ { flush: "post" }
67
68
  );
68
69
  const stop = () => {
69
70
  stopWatch();
70
71
  cleanup();
71
72
  };
72
- tryOnScopeDispose(stop);
73
+ tryOnScopeDispose(cleanup);
73
74
  return stop;
74
75
  }
75
76
 
@@ -80,8 +81,9 @@ function onClickOutside(target, handler, options = {}) {
80
81
  return noop;
81
82
  if (isIOS && !_iOSWorkaround) {
82
83
  _iOSWorkaround = true;
83
- Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", noop));
84
- window.document.documentElement.addEventListener("click", noop);
84
+ const listenerOptions = { passive: true };
85
+ Array.from(window.document.body.children).forEach((el) => useEventListener(el, "click", noop, listenerOptions));
86
+ useEventListener(window.document.documentElement, "click", noop, listenerOptions);
85
87
  }
86
88
  let shouldListen = true;
87
89
  const shouldIgnore = (event) => {
@@ -438,20 +440,12 @@ function useMediaQuery(query, options = {}) {
438
440
  const { window = defaultWindow, ssrWidth = useSSRWidth() } = options;
439
441
  const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
440
442
  const ssrSupport = ref(typeof ssrWidth === "number");
441
- let mediaQuery;
443
+ const mediaQuery = shallowRef();
442
444
  const matches = ref(false);
443
445
  const handler = (event) => {
444
446
  matches.value = event.matches;
445
447
  };
446
- const cleanup = () => {
447
- if (!mediaQuery)
448
- return;
449
- if ("removeEventListener" in mediaQuery)
450
- mediaQuery.removeEventListener("change", handler);
451
- else
452
- mediaQuery.removeListener(handler);
453
- };
454
- const stopWatch = watchEffect(() => {
448
+ watchEffect(() => {
455
449
  if (ssrSupport.value) {
456
450
  ssrSupport.value = !isSupported.value;
457
451
  const queryStrings = toValue(query).split(",");
@@ -472,19 +466,10 @@ function useMediaQuery(query, options = {}) {
472
466
  }
473
467
  if (!isSupported.value)
474
468
  return;
475
- cleanup();
476
- mediaQuery = window.matchMedia(toValue(query));
477
- if ("addEventListener" in mediaQuery)
478
- mediaQuery.addEventListener("change", handler);
479
- else
480
- mediaQuery.addListener(handler);
481
- matches.value = mediaQuery.matches;
482
- });
483
- tryOnScopeDispose(() => {
484
- stopWatch();
485
- cleanup();
486
- mediaQuery = undefined;
469
+ mediaQuery.value = window.matchMedia(toValue(query));
470
+ matches.value = mediaQuery.value.matches;
487
471
  });
472
+ useEventListener(mediaQuery, "change", handler, { passive: true });
488
473
  return computed(() => matches.value);
489
474
  }
490
475
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vueuse/components",
3
3
  "type": "module",
4
- "version": "12.4.0",
4
+ "version": "12.5.0",
5
5
  "description": "Renderless components for VueUse",
6
6
  "author": "Jacob Clevenger<https://github.com/wheatjs>",
7
7
  "license": "MIT",
@@ -42,8 +42,8 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "vue": "^3.5.13",
45
- "@vueuse/core": "12.4.0",
46
- "@vueuse/shared": "12.4.0"
45
+ "@vueuse/core": "12.5.0",
46
+ "@vueuse/shared": "12.5.0"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild"