@vueuse/components 11.0.0-beta.1 → 11.0.0-beta.2

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.d.ts CHANGED
@@ -13,7 +13,7 @@ interface RenderableComponent {
13
13
  *
14
14
  * @default 'div'
15
15
  */
16
- as?: Object | string;
16
+ as?: object | string;
17
17
  }
18
18
 
19
19
  type VueInstance = ComponentPublicInstance;
@@ -63,9 +63,9 @@ interface OnKeyStrokeOptions {
63
63
  dedupe?: MaybeRefOrGetter<boolean>;
64
64
  }
65
65
 
66
- type BindingValueFunction$7 = (event: KeyboardEvent) => void;
67
- type BindingValueArray$6 = [BindingValueFunction$7, OnKeyStrokeOptions];
68
- declare const vOnKeyStroke: ObjectDirective<HTMLElement, BindingValueFunction$7 | BindingValueArray$6>;
66
+ type BindingValueFunction$8 = (event: KeyboardEvent) => void;
67
+ type BindingValueArray$7 = [BindingValueFunction$8, OnKeyStrokeOptions];
68
+ declare const vOnKeyStroke: ObjectDirective<HTMLElement, BindingValueFunction$8 | BindingValueArray$7>;
69
69
 
70
70
  interface OnLongPressOptions {
71
71
  /**
@@ -102,12 +102,12 @@ interface OnLongPressProps extends RenderableComponent {
102
102
  }
103
103
  declare const OnLongPress: vue_demi.DefineComponent<OnLongPressProps, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<OnLongPressProps>, {}, {}>;
104
104
 
105
- type BindingValueFunction$6 = (evt: PointerEvent) => void;
106
- type BindingValueArray$5 = [
107
- BindingValueFunction$6,
105
+ type BindingValueFunction$7 = (evt: PointerEvent) => void;
106
+ type BindingValueArray$6 = [
107
+ BindingValueFunction$7,
108
108
  OnLongPressOptions
109
109
  ];
110
- declare const vOnLongPress: ObjectDirective<HTMLElement, BindingValueFunction$6 | BindingValueArray$5>;
110
+ declare const vOnLongPress: ObjectDirective<HTMLElement, BindingValueFunction$7 | BindingValueArray$6>;
111
111
 
112
112
  declare const UseActiveElement: vue_demi.DefineComponent<{}, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
113
113
  [key: string]: any;
@@ -295,6 +295,18 @@ interface UseDraggableProps extends UseDraggableOptions, RenderableComponent {
295
295
  }
296
296
  declare const UseDraggable: vue_demi.DefineComponent<UseDraggableProps, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<UseDraggableProps>, {}, {}>;
297
297
 
298
+ interface ResizeObserverSize {
299
+ readonly inlineSize: number;
300
+ readonly blockSize: number;
301
+ }
302
+ interface ResizeObserverEntry {
303
+ readonly target: Element;
304
+ readonly contentRect: DOMRectReadOnly;
305
+ readonly borderBoxSize?: ReadonlyArray<ResizeObserverSize>;
306
+ readonly contentBoxSize?: ReadonlyArray<ResizeObserverSize>;
307
+ readonly devicePixelContentBoxSize?: ReadonlyArray<ResizeObserverSize>;
308
+ }
309
+ type ResizeObserverCallback = (entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver) => void;
298
310
  interface UseResizeObserverOptions extends ConfigurableWindow {
299
311
  /**
300
312
  * Sets which box model the observer will observe changes to. Possible values
@@ -304,11 +316,22 @@ interface UseResizeObserverOptions extends ConfigurableWindow {
304
316
  */
305
317
  box?: ResizeObserverBoxOptions;
306
318
  }
319
+ declare class ResizeObserver {
320
+ constructor(callback: ResizeObserverCallback);
321
+ disconnect(): void;
322
+ observe(target: Element, options?: UseResizeObserverOptions): void;
323
+ unobserve(target: Element): void;
324
+ }
307
325
 
308
326
  declare const UseElementBounding: vue_demi.DefineComponent<UseResizeObserverOptions & RenderableComponent, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<UseResizeObserverOptions & RenderableComponent>, {}, {}>;
309
327
 
310
- type BindingValueFunction$5 = (state: boolean) => void;
311
- declare const vElementHover: ObjectDirective<HTMLElement, BindingValueFunction$5>;
328
+ interface UseElementHoverOptions extends ConfigurableWindow {
329
+ delayEnter?: number;
330
+ delayLeave?: number;
331
+ }
332
+
333
+ type BindingValueFunction$6 = (state: boolean) => void;
334
+ declare const vElementHover: ObjectDirective<HTMLElement, BindingValueFunction$6 | [handler: BindingValueFunction$6, options: UseElementHoverOptions]>;
312
335
 
313
336
  declare const UseElementSize: vue_demi.DefineComponent<ElementSize$1 & UseResizeObserverOptions & RenderableComponent, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<ElementSize$1 & UseResizeObserverOptions & RenderableComponent>, {}, {}>;
314
337
 
@@ -328,10 +351,10 @@ declare function useElementSize(target: MaybeComputedElementRef, initialSize?: E
328
351
  };
329
352
 
330
353
  type RemoveFirstFromTuple<T extends any[]> = T['length'] extends 0 ? undefined : (((...b: T) => void) extends (a: any, ...b: infer I) => void ? I : []);
331
- type BindingValueFunction$4 = (size: ElementSize) => void;
354
+ type BindingValueFunction$5 = (size: ElementSize) => void;
332
355
  type VElementSizeOptions = RemoveFirstFromTuple<Parameters<typeof useElementSize>>;
333
- type BindingValueArray$4 = [BindingValueFunction$4, ...VElementSizeOptions];
334
- declare const vElementSize: ObjectDirective<HTMLElement, BindingValueFunction$4 | BindingValueArray$4>;
356
+ type BindingValueArray$5 = [BindingValueFunction$5, ...VElementSizeOptions];
357
+ declare const vElementSize: ObjectDirective<HTMLElement, BindingValueFunction$5 | BindingValueArray$5>;
335
358
 
336
359
  declare const UseElementVisibility: vue_demi.DefineComponent<RenderableComponent, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<RenderableComponent>, {}, {}>;
337
360
 
@@ -352,6 +375,7 @@ interface UseIntersectionObserverOptions extends ConfigurableWindow {
352
375
  rootMargin?: string;
353
376
  /**
354
377
  * Either a single number or an array of numbers between 0.0 and 1.
378
+ * @default 0
355
379
  */
356
380
  threshold?: number | number[];
357
381
  }
@@ -360,9 +384,9 @@ interface UseElementVisibilityOptions extends ConfigurableWindow, Pick<UseInters
360
384
  scrollTarget?: MaybeRefOrGetter<HTMLElement | undefined | null>;
361
385
  }
362
386
 
363
- type BindingValueFunction$3 = (state: boolean) => void;
364
- type BindingValueArray$3 = [BindingValueFunction$3, UseElementVisibilityOptions];
365
- declare const vElementVisibility: ObjectDirective<HTMLElement, BindingValueFunction$3 | BindingValueArray$3>;
387
+ type BindingValueFunction$4 = (state: boolean) => void;
388
+ type BindingValueArray$4 = [BindingValueFunction$4, UseElementVisibilityOptions];
389
+ declare const vElementVisibility: ObjectDirective<HTMLElement, BindingValueFunction$4 | BindingValueArray$4>;
366
390
 
367
391
  declare const UseEyeDropper: vue_demi.DefineComponent<{
368
392
  sRGBHex: StringConstructor;
@@ -518,15 +542,16 @@ interface UseInfiniteScrollOptions<T extends InfiniteScrollElement = InfiniteScr
518
542
  */
519
543
  declare function useInfiniteScroll<T extends InfiniteScrollElement>(element: MaybeRefOrGetter<T>, onLoadMore: (state: UnwrapNestedRefs<ReturnType<typeof useScroll>>) => Awaitable<void>, options?: UseInfiniteScrollOptions<T>): {
520
544
  isLoading: vue_demi.ComputedRef<boolean>;
545
+ reset(): void;
521
546
  };
522
547
 
523
- type BindingValueFunction$2 = Parameters<typeof useInfiniteScroll>[1];
524
- type BindingValueArray$2 = [BindingValueFunction$2, UseInfiniteScrollOptions];
525
- declare const vInfiniteScroll: ObjectDirective<HTMLElement, BindingValueFunction$2 | BindingValueArray$2>;
548
+ type BindingValueFunction$3 = Parameters<typeof useInfiniteScroll>[1];
549
+ type BindingValueArray$3 = [BindingValueFunction$3, UseInfiniteScrollOptions];
550
+ declare const vInfiniteScroll: ObjectDirective<HTMLElement, BindingValueFunction$3 | BindingValueArray$3>;
526
551
 
527
- type BindingValueFunction$1 = IntersectionObserverCallback;
528
- type BindingValueArray$1 = [BindingValueFunction$1, UseIntersectionObserverOptions];
529
- declare const vIntersectionObserver: ObjectDirective<HTMLElement, BindingValueFunction$1 | BindingValueArray$1>;
552
+ type BindingValueFunction$2 = IntersectionObserverCallback;
553
+ type BindingValueArray$2 = [BindingValueFunction$2, UseIntersectionObserverOptions];
554
+ declare const vIntersectionObserver: ObjectDirective<HTMLElement, BindingValueFunction$2 | BindingValueArray$2>;
530
555
 
531
556
  declare const UseMouse: vue_demi.DefineComponent<UseMouseOptions, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<UseMouseOptions>, {}, {}>;
532
557
 
@@ -594,9 +619,9 @@ declare const UsePageLeave: vue_demi.DefineComponent<{}, () => vue_demi.VNode<vu
594
619
  }>[] | undefined, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<vue_demi.ExtractPropTypes<{}>>, {}, {}>;
595
620
 
596
621
  declare const UsePointer: vue_demi.DefineComponent<Omit<UsePointerOptions, "target"> & {
597
- target: 'window' | 'self';
622
+ target: "window" | "self";
598
623
  }, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<Omit<UsePointerOptions, "target"> & {
599
- target: 'window' | 'self';
624
+ target: "window" | "self";
600
625
  }>, {}, {}>;
601
626
 
602
627
  declare const UsePointerLock: vue_demi.DefineComponent<RenderableComponent, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<RenderableComponent>, {}, {}>;
@@ -621,6 +646,10 @@ declare const UsePreferredReducedMotion: vue_demi.DefineComponent<{}, () => vue_
621
646
  [key: string]: any;
622
647
  }>[] | undefined, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<vue_demi.ExtractPropTypes<{}>>, {}, {}>;
623
648
 
649
+ type BindingValueFunction$1 = ResizeObserverCallback;
650
+ type BindingValueArray$1 = [BindingValueFunction$1, UseResizeObserverOptions];
651
+ declare const vResizeObserver: ObjectDirective<HTMLElement, BindingValueFunction$1 | BindingValueArray$1>;
652
+
624
653
  declare const UseScreenSafeArea: vue_demi.DefineComponent<{
625
654
  top: BooleanConstructor;
626
655
  right: BooleanConstructor;
@@ -681,4 +710,4 @@ declare const UseWindowFocus: vue_demi.DefineComponent<{}, () => vue_demi.VNode<
681
710
 
682
711
  declare const UseWindowSize: vue_demi.DefineComponent<UseWindowSizeOptions, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.PublicProps, Readonly<UseWindowSizeOptions>, {}, {}>;
683
712
 
684
- export { OnClickOutside, type OnClickOutsideProps, OnLongPress, type OnLongPressProps, UseActiveElement, UseBattery, UseBrowserLocation, UseClipboard, UseColorMode, UseDark, UseDeviceMotion, UseDeviceOrientation, UseDevicePixelRatio, UseDevicesList, UseDocumentVisibility, UseDraggable, type UseDraggableProps, UseElementBounding, UseElementSize, UseElementVisibility, UseEyeDropper, UseFullscreen, UseGeolocation, UseIdle, UseImage, UseMouse, UseMouseInElement, UseMousePressed, UseNetwork, UseNow, UseObjectUrl, type UseObjectUrlProps, UseOffsetPagination, UseOnline, UsePageLeave, UsePointer, UsePointerLock, UsePreferredColorScheme, UsePreferredContrast, UsePreferredDark, UsePreferredLanguages, UsePreferredReducedMotion, UseScreenSafeArea, UseTimeAgo, UseTimestamp, UseVirtualList, type UseVirtualListProps, UseWindowFocus, UseWindowSize, vOnClickOutside as VOnClickOutside, vOnLongPress as VOnLongPress, vElementHover, vElementSize, vElementVisibility, vInfiniteScroll, vIntersectionObserver, vOnClickOutside, vOnKeyStroke, vOnLongPress, vScroll, vScrollLock };
713
+ export { OnClickOutside, type OnClickOutsideProps, OnLongPress, type OnLongPressProps, UseActiveElement, UseBattery, UseBrowserLocation, UseClipboard, UseColorMode, UseDark, UseDeviceMotion, UseDeviceOrientation, UseDevicePixelRatio, UseDevicesList, UseDocumentVisibility, UseDraggable, type UseDraggableProps, UseElementBounding, UseElementSize, UseElementVisibility, UseEyeDropper, UseFullscreen, UseGeolocation, UseIdle, UseImage, UseMouse, UseMouseInElement, UseMousePressed, UseNetwork, UseNow, UseObjectUrl, type UseObjectUrlProps, UseOffsetPagination, UseOnline, UsePageLeave, UsePointer, UsePointerLock, UsePreferredColorScheme, UsePreferredContrast, UsePreferredDark, UsePreferredLanguages, UsePreferredReducedMotion, UseScreenSafeArea, UseTimeAgo, UseTimestamp, UseVirtualList, type UseVirtualListProps, UseWindowFocus, UseWindowSize, vOnClickOutside as VOnClickOutside, vOnLongPress as VOnLongPress, vElementHover, vElementSize, vElementVisibility, vInfiniteScroll, vIntersectionObserver, vOnClickOutside, vOnKeyStroke, vOnLongPress, vResizeObserver, vScroll, vScrollLock };
package/index.iife.js CHANGED
@@ -584,8 +584,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
584
584
  );
585
585
  if (window && listenToStorageChanges) {
586
586
  shared.tryOnMounted(() => {
587
- useEventListener(window, "storage", update);
588
- useEventListener(window, customStorageEventName, updateFromCustomEvent);
587
+ if (storage instanceof Storage)
588
+ useEventListener(window, "storage", update);
589
+ else
590
+ useEventListener(window, customStorageEventName, updateFromCustomEvent);
589
591
  if (initOnMounted)
590
592
  update();
591
593
  });
@@ -593,7 +595,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
593
595
  if (!initOnMounted)
594
596
  update();
595
597
  function dispatchWriteEvent(oldValue, newValue) {
596
- if (window) {
598
+ if (window && !(storage instanceof Storage)) {
597
599
  window.dispatchEvent(new CustomEvent(customStorageEventName, {
598
600
  detail: {
599
601
  key,
@@ -726,6 +728,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
726
728
  return useMediaQuery("(prefers-color-scheme: dark)", options);
727
729
  }
728
730
 
731
+ const CSS_DISABLE_TRANS = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
729
732
  function useColorMode(options = {}) {
730
733
  const {
731
734
  selector = "html",
@@ -755,23 +758,36 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
755
758
  const el = typeof selector2 === "string" ? window == null ? void 0 : window.document.querySelector(selector2) : unrefElement(selector2);
756
759
  if (!el)
757
760
  return;
758
- let style;
759
- if (disableTransition) {
760
- style = window.document.createElement("style");
761
- const styleString = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
762
- style.appendChild(document.createTextNode(styleString));
763
- window.document.head.appendChild(style);
764
- }
761
+ const classesToAdd = /* @__PURE__ */ new Set();
762
+ const classesToRemove = /* @__PURE__ */ new Set();
763
+ let attributeToChange = null;
765
764
  if (attribute2 === "class") {
766
765
  const current = value.split(/\s/g);
767
766
  Object.values(modes).flatMap((i) => (i || "").split(/\s/g)).filter(Boolean).forEach((v) => {
768
767
  if (current.includes(v))
769
- el.classList.add(v);
768
+ classesToAdd.add(v);
770
769
  else
771
- el.classList.remove(v);
770
+ classesToRemove.add(v);
772
771
  });
773
772
  } else {
774
- el.setAttribute(attribute2, value);
773
+ attributeToChange = { key: attribute2, value };
774
+ }
775
+ if (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null)
776
+ return;
777
+ let style;
778
+ if (disableTransition) {
779
+ style = window.document.createElement("style");
780
+ style.appendChild(document.createTextNode(CSS_DISABLE_TRANS));
781
+ window.document.head.appendChild(style);
782
+ }
783
+ for (const c of classesToAdd) {
784
+ el.classList.add(c);
785
+ }
786
+ for (const c of classesToRemove) {
787
+ el.classList.remove(c);
788
+ }
789
+ if (attributeToChange) {
790
+ el.setAttribute(attributeToChange.key, attributeToChange.value);
775
791
  }
776
792
  if (disableTransition) {
777
793
  window.getComputedStyle(style).opacity;
@@ -915,7 +931,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
915
931
  "onStart",
916
932
  "onMove",
917
933
  "onEnd",
918
- "disabled"
934
+ "disabled",
935
+ "buttons"
919
936
  ],
920
937
  setup(props, { slots }) {
921
938
  const target = vueDemi.ref();
@@ -993,9 +1010,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
993
1010
 
994
1011
  const vElementHover = {
995
1012
  [shared.directiveHooks.mounted](el, binding) {
996
- if (typeof binding.value === "function") {
1013
+ const value = binding.value;
1014
+ if (typeof value === "function") {
997
1015
  const isHovered = useElementHover(el);
998
- vueDemi.watch(isHovered, (v) => binding.value(v));
1016
+ vueDemi.watch(isHovered, (v) => value(v));
1017
+ } else {
1018
+ const [handler, options] = value;
1019
+ const isHovered = useElementHover(el, options);
1020
+ vueDemi.watch(isHovered, (v) => handler(v));
999
1021
  }
1000
1022
  }
1001
1023
  };
@@ -1023,15 +1045,20 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1023
1045
  observer = void 0;
1024
1046
  }
1025
1047
  };
1026
- const targets = vueDemi.computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
1048
+ const targets = vueDemi.computed(() => {
1049
+ const _targets = shared.toValue(target);
1050
+ return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
1051
+ });
1027
1052
  const stopWatch = vueDemi.watch(
1028
1053
  targets,
1029
1054
  (els) => {
1030
1055
  cleanup();
1031
1056
  if (isSupported.value && window) {
1032
1057
  observer = new ResizeObserver(callback);
1033
- for (const _el of els)
1034
- _el && observer.observe(_el, observerOptions);
1058
+ for (const _el of els) {
1059
+ if (_el)
1060
+ observer.observe(_el, observerOptions);
1061
+ }
1035
1062
  }
1036
1063
  },
1037
1064
  { immediate: true, flush: "post" }
@@ -1133,7 +1160,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1133
1160
  const {
1134
1161
  root,
1135
1162
  rootMargin = "0px",
1136
- threshold = 0.1,
1163
+ threshold = 0,
1137
1164
  window = defaultWindow,
1138
1165
  immediate = true
1139
1166
  } = options;
@@ -1622,7 +1649,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1622
1649
  { immediate: true }
1623
1650
  );
1624
1651
  return {
1625
- isLoading
1652
+ isLoading,
1653
+ reset() {
1654
+ vueDemi.nextTick(() => checkAndLoad());
1655
+ }
1626
1656
  };
1627
1657
  }
1628
1658
 
@@ -1885,6 +1915,15 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1885
1915
  }
1886
1916
  });
1887
1917
 
1918
+ const vResizeObserver = {
1919
+ [shared.directiveHooks.mounted](el, binding) {
1920
+ if (typeof binding.value === "function")
1921
+ useResizeObserver(el, binding.value);
1922
+ else
1923
+ useResizeObserver(el, ...binding.value);
1924
+ }
1925
+ };
1926
+
1888
1927
  function useMutationObserver(target, callback, options = {}) {
1889
1928
  const { window = defaultWindow, ...mutationOptions } = options;
1890
1929
  let observer;
@@ -1927,7 +1966,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1927
1966
  }
1928
1967
 
1929
1968
  function useCssVar(prop, target, options = {}) {
1930
- const { window = defaultWindow, initialValue = "", observe = false } = options;
1969
+ const { window = defaultWindow, initialValue, observe = false } = options;
1931
1970
  const variable = vueDemi.ref(initialValue);
1932
1971
  const elRef = vueDemi.computed(() => {
1933
1972
  var _a;
@@ -1937,7 +1976,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1937
1976
  var _a;
1938
1977
  const key = shared.toValue(prop);
1939
1978
  const el = shared.toValue(elRef);
1940
- if (el && window) {
1979
+ if (el && window && key) {
1941
1980
  const value = (_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim();
1942
1981
  variable.value = value || initialValue;
1943
1982
  }
@@ -1950,15 +1989,24 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1950
1989
  }
1951
1990
  vueDemi.watch(
1952
1991
  [elRef, () => shared.toValue(prop)],
1953
- updateCssVar,
1992
+ (_, old) => {
1993
+ if (old[0] && old[1] && window)
1994
+ window.getComputedStyle(old[0]).removeProperty(old[1]);
1995
+ updateCssVar();
1996
+ },
1954
1997
  { immediate: true }
1955
1998
  );
1956
1999
  vueDemi.watch(
1957
2000
  variable,
1958
2001
  (val) => {
1959
2002
  var _a;
1960
- if ((_a = elRef.value) == null ? void 0 : _a.style)
1961
- elRef.value.style.setProperty(shared.toValue(prop), val);
2003
+ const raw_prop = shared.toValue(prop);
2004
+ if (((_a = elRef.value) == null ? void 0 : _a.style) && raw_prop) {
2005
+ if (val == null)
2006
+ elRef.value.style.removeProperty(raw_prop);
2007
+ else
2008
+ elRef.value.style.setProperty(raw_prop, val);
2009
+ }
1962
2010
  }
1963
2011
  );
1964
2012
  return variable;
@@ -2132,7 +2180,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
2132
2180
  const el = resolveElement(shared.toValue(element));
2133
2181
  if (!el || !isLocked.value)
2134
2182
  return;
2135
- shared.isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
2183
+ if (shared.isIOS)
2184
+ stopTouchMoveListener == null ? void 0 : stopTouchMoveListener();
2136
2185
  el.style.overflow = initialOverflow;
2137
2186
  elInitialOverflow.delete(el);
2138
2187
  isLocked.value = false;
@@ -2145,7 +2194,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
2145
2194
  set(v) {
2146
2195
  if (v)
2147
2196
  lock();
2148
- else unlock();
2197
+ else
2198
+ unlock();
2149
2199
  }
2150
2200
  });
2151
2201
  }
@@ -2286,6 +2336,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
2286
2336
  exports.vOnClickOutside = vOnClickOutside;
2287
2337
  exports.vOnKeyStroke = vOnKeyStroke;
2288
2338
  exports.vOnLongPress = vOnLongPress;
2339
+ exports.vResizeObserver = vResizeObserver;
2289
2340
  exports.vScroll = vScroll;
2290
2341
  exports.vScrollLock = vScrollLock;
2291
2342
 
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- var VueDemi=function(l,o,w){if(l.install)return l;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),l;if(o.version.slice(0,4)==="2.7."){let O=function(P,L){var H,j={},F={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(W,N){return j[W]=N,this},directive:function(W,N){return N?(o.directive(W,N),F):o.directive(W)},mount:function(W,N){return H||(H=new o(Object.assign({propsData:L},P,{provide:Object.assign(j,P.provide)})),H.$mount(W,N),H)},unmount:function(){H&&(H.$destroy(),H=void 0)}};return F};var te=O;for(var u in o)l[u]=o[u];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.warn=o.util.warn,l.hasInjectionContext=function(){return!!l.getCurrentInstance()},l.createApp=O}else if(o.version.slice(0,2)==="2.")if(w){for(var u in w)l[u]=w[u];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.hasInjectionContext=function(){return!!l.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var u in o)l[u]=o[u];l.isVue2=!1,l.isVue3=!0,l.install=function(){},l.Vue=o,l.Vue2=void 0,l.version=o.version,l.set=function(O,P,L){return Array.isArray(O)?(O.length=Math.max(O.length,P),O.splice(P,1,L),L):(O[P]=L,L)},l.del=function(O,P){if(Array.isArray(O)){O.splice(P,1);return}delete O[P]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return l}((globalThis||self).VueDemi=(globalThis||self).VueDemi||(typeof VueDemi<"u"?VueDemi:{}),(globalThis||self).Vue||(typeof Vue<"u"?Vue:void 0),(globalThis||self).VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(l,o,w,u){"use strict";const te=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return w.onClickOutside(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}});function O(e){var t;const n=u.toValue(e);return(t=n?.$el)!=null?t:n}const P=u.isClient?window:void 0;function L(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=P):[t,n,r,a]=e,!t)return u.noop;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],c=()=>{s.forEach(g=>g()),s.length=0},i=(g,d,p,m)=>(g.addEventListener(d,p,m),()=>g.removeEventListener(d,p,m)),v=o.watch(()=>[O(t),u.toValue(a)],([g,d])=>{if(c(),!g)return;const p=u.isObject(d)?{...d}:d;s.push(...n.flatMap(m=>r.map(y=>i(g,m,y,p))))},{immediate:!0,flush:"post"}),f=()=>{v(),c()};return u.tryOnScopeDispose(f),f}let H=!1;function j(e,t,n={}){const{window:r=P,ignore:a=[],capture:s=!0,detectIframe:c=!1}=n;if(!r)return u.noop;u.isIOS&&!H&&(H=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",u.noop)),r.document.documentElement.addEventListener("click",u.noop));let i=!0;const v=p=>a.some(m=>{if(typeof m=="string")return Array.from(r.document.querySelectorAll(m)).some(y=>y===p.target||p.composedPath().includes(y));{const y=O(m);return y&&(p.target===y||p.composedPath().includes(y))}}),g=[L(r,"click",p=>{const m=O(e);if(!(!m||m===p.target||p.composedPath().includes(m))){if(p.detail===0&&(i=!v(p)),!i){i=!0;return}t(p)}},{passive:!0,capture:s}),L(r,"pointerdown",p=>{const m=O(e);i=!v(p)&&!!(m&&!p.composedPath().includes(m))},{passive:!0}),c&&L(r,"blur",p=>{setTimeout(()=>{var m;const y=O(e);((m=r.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!y?.contains(r.document.activeElement)&&t(p)},0)})].filter(Boolean);return()=>g.forEach(p=>p())}const F={[u.directiveHooks.mounted](e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=j(e,t.value,{capture:n});else{const[r,a]=t.value;e.__onClickOutside_stop=j(e,r,Object.assign({capture:n},a))}},[u.directiveHooks.unmounted](e){e.__onClickOutside_stop()}};function W(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function N(...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=P,eventName:s="keydown",passive:c=!1,dedupe:i=!1}=r,v=W(t);return L(a,s,g=>{g.repeat&&u.toValue(i)||v(g)&&n(g)},c)}const ve={[u.directiveHooks.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")N(a,t.value,{target:e});else{const[s,c]=t.value;N(a,s,{target:e,...c})}}},ge=500,me=10;function X(e,t,n){var r,a;const s=o.computed(()=>O(e));let c,i,v,f=!1;function g(){c&&(clearTimeout(c),c=void 0),i=void 0,v=void 0,f=!1}function d(h){var S,V,C;const[A,R,b]=[v,i,f];if(g(),!n?.onMouseUp||!R||!A||(S=n?.modifiers)!=null&&S.self&&h.target!==s.value)return;(V=n?.modifiers)!=null&&V.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation();const k=h.x-R.x,T=h.y-R.y,U=Math.sqrt(k*k+T*T);n.onMouseUp(h.timeStamp-A,U,b)}function p(h){var S,V,C,A;(S=n?.modifiers)!=null&&S.self&&h.target!==s.value||(g(),(V=n?.modifiers)!=null&&V.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation(),i={x:h.x,y:h.y},v=h.timeStamp,c=setTimeout(()=>{f=!0,t(h)},(A=n?.delay)!=null?A:ge))}function m(h){var S,V,C,A;if((S=n?.modifiers)!=null&&S.self&&h.target!==s.value||!i||n?.distanceThreshold===!1)return;(V=n?.modifiers)!=null&&V.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation();const R=h.x-i.x,b=h.y-i.y;Math.sqrt(R*R+b*b)>=((A=n?.distanceThreshold)!=null?A:me)&&g()}const y={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},E=[L(s,"pointerdown",p,y),L(s,"pointermove",m,y),L(s,["pointerup","pointerleave"],d,y)];return()=>E.forEach(h=>h())}const he=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={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},ye=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:w.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),we=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(w.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Ue=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(w.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),be=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(w.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),x=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},G="__vueuse_ssr_handlers__",Se=Ce();function Ce(){return G in x||(x[G]=x[G]||{}),x[G]}function oe(e,t){return Se[e]||t}function Oe(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 Ee={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 Pe(e,t,n,r={}){var a;const{flush:s="pre",deep:c=!0,listenToStorageChanges:i=!0,writeDefaults:v=!0,mergeDefaults:f=!1,shallow:g,window:d=P,eventFilter:p,onError:m=U=>{console.error(U)},initOnMounted:y}=r,E=(g?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=oe("getDefaultStorage",()=>{var U;return(U=P)==null?void 0:U.localStorage})()}catch(U){m(U)}if(!n)return E;const _=u.toValue(t),h=Oe(_),S=(a=r.serializer)!=null?a:Ee[h],{pause:V,resume:C}=u.pausableWatch(E,()=>R(E.value),{flush:s,deep:c,eventFilter:p});d&&i&&u.tryOnMounted(()=>{L(d,"storage",k),L(d,re,T),y&&k()}),y||k();function A(U,M){d&&d.dispatchEvent(new CustomEvent(re,{detail:{key:e,oldValue:U,newValue:M,storageArea:n}}))}function R(U){try{const M=n.getItem(e);if(U==null)A(M,null),n.removeItem(e);else{const I=S.write(U);M!==I&&(n.setItem(e,I),A(M,I))}}catch(M){m(M)}}function b(U){const M=U?U.newValue:n.getItem(e);if(M==null)return v&&_!=null&&n.setItem(e,S.write(_)),_;if(!U&&f){const I=S.read(M);return typeof f=="function"?f(I,_):h==="object"&&!Array.isArray(I)?{..._,...I}:I}else return typeof M!="string"?M:S.read(M)}function k(U){if(!(U&&U.storageArea!==n)){if(U&&U.key==null){E.value=_;return}if(!(U&&U.key!==e)){V();try{U?.newValue!==S.write(E.value)&&(E.value=b(U))}catch(M){m(M)}finally{U?o.nextTick(C):C()}}}}function T(U){k(U.detail)}return E}function Le(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},o.isVue2?void 0:t),e}function J(e){const t=Le();return o.computed(()=>(t.value,!!e()))}function _e(e,t={}){const{window:n=P}=t,r=J(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const s=o.ref(!1),c=f=>{s.value=f.matches},i=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",c):a.removeListener(c))},v=o.watchEffect(()=>{r.value&&(i(),a=n.matchMedia(u.toValue(e)),"addEventListener"in a?a.addEventListener("change",c):a.addListener(c),s.value=a.matches)});return u.tryOnScopeDispose(()=>{v(),i(),a=void 0}),s}function ke(e){return _e("(prefers-color-scheme: dark)",e)}function Ae(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=P,storage:s,storageKey:c="vueuse-color-scheme",listenToStorageChanges:i=!0,storageRef:v,emitAuto:f,disableTransition:g=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},p=ke({window:a}),m=o.computed(()=>p.value?"dark":"light"),y=v||(c==null?u.toRef(r):Pe(c,r,s,{window:a,listenToStorageChanges:i})),E=o.computed(()=>y.value==="auto"?m.value:y.value),_=oe("updateHTMLAttrs",(C,A,R)=>{const b=typeof C=="string"?a?.document.querySelector(C):O(C);if(!b)return;let k;if(g&&(k=a.document.createElement("style"),k.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),a.document.head.appendChild(k)),A==="class"){const T=R.split(/\s/g);Object.values(d).flatMap(U=>(U||"").split(/\s/g)).filter(Boolean).forEach(U=>{T.includes(U)?b.classList.add(U):b.classList.remove(U)})}else b.setAttribute(A,R);g&&(a.getComputedStyle(k).opacity,document.head.removeChild(k))});function h(C){var A;_(t,n,(A=d[C])!=null?A:C)}function S(C){e.onChanged?e.onChanged(C,h):h(C)}o.watch(E,S,{flush:"post",immediate:!0}),u.tryOnMounted(()=>S(E.value));const V=o.computed({get(){return f?y.value:E.value},set(C){y.value=C}});try{return Object.assign(V,{store:y,system:m,state:E})}catch{return V}}const Me=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ae(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),Te=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=w.useDark(e),r=o.reactive({isDark:n,toggleDark:u.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Ve=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=o.reactive(w.useDeviceMotion());return()=>{if(t.default)return t.default(n)}}}),Ie=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(w.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),Re=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:w.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),He=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(w.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),ze=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:w.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Ne=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var f;return(f=e.handle)!=null?f:n.value}),a=o.computed(()=>!!e.disabled),s=e.storageKey&&w.useStorage(e.storageKey,u.toValue(e.initialValue)||{x:0,y:0},w.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),c=s||e.initialValue||{x:0,y:0},i=(f,g)=>{var d;(d=e.onEnd)==null||d.call(e,f,g),s&&(s.value.x=f.x,s.value.y=f.y)},v=o.reactive(w.useDraggable(n,{...e,handle:r,initialValue:c,onEnd:i,disabled:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${v.style}`},t.default(v))}}}),We=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Be(e,t={}){const{delayEnter:n=0,delayLeave:r=0,window:a=P}=t,s=o.ref(!1);let c;const i=v=>{const f=v?n:r;c&&(clearTimeout(c),c=void 0),f?c=setTimeout(()=>s.value=v,f):s.value=v};return a&&(L(e,"mouseenter",()=>i(!0),{passive:!0}),L(e,"mouseleave",()=>i(!1),{passive:!0})),s}const je={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=Be(e);o.watch(n,r=>t.value(r))}}},Fe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.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 Ke(e,t,n={}){const{window:r=P,...a}=n;let s;const c=J(()=>r&&"ResizeObserver"in r),i=()=>{s&&(s.disconnect(),s=void 0)},v=o.computed(()=>Array.isArray(e)?e.map(d=>O(d)):[O(e)]),f=o.watch(v,d=>{if(i(),c.value&&r){s=new ResizeObserver(t);for(const p of d)p&&s.observe(p,a)}},{immediate:!0,flush:"post"}),g=()=>{i(),f()};return u.tryOnScopeDispose(g),{isSupported:c,stop:g}}function xe(e,t={width:0,height:0},n={}){const{window:r=P,box:a="content-box"}=n,s=o.computed(()=>{var d,p;return(p=(d=O(e))==null?void 0:d.namespaceURI)==null?void 0:p.includes("svg")}),c=o.ref(t.width),i=o.ref(t.height),{stop:v}=Ke(e,([d])=>{const p=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(r&&s.value){const m=O(e);if(m){const y=m.getBoundingClientRect();c.value=y.width,i.value=y.height}}else if(p){const m=Array.isArray(p)?p:[p];c.value=m.reduce((y,{inlineSize:E})=>y+E,0),i.value=m.reduce((y,{blockSize:E})=>y+E,0)}else c.value=d.contentRect.width,i.value=d.contentRect.height},n);u.tryOnMounted(()=>{const d=O(e);d&&(c.value="offsetWidth"in d?d.offsetWidth:t.width,i.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=o.watch(()=>O(e),d=>{c.value=d?t.width:0,i.value=d?t.height:0});function g(){v(),f()}return{width:c,height:i,stop:g}}const Ge={[u.directiveHooks.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:c}=xe(e,...a);o.watch([s,c],([i,v])=>r({width:i,height:v}))}},Je=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:w.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Q(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:s=.1,window:c=P,immediate:i=!0}=n,v=J(()=>c&&"IntersectionObserver"in c),f=o.computed(()=>{const y=u.toValue(e);return(Array.isArray(y)?y:[y]).map(O).filter(u.notNullish)});let g=u.noop;const d=o.ref(i),p=v.value?o.watch(()=>[f.value,O(r),d.value],([y,E])=>{if(g(),!d.value||!y.length)return;const _=new IntersectionObserver(t,{root:O(E),rootMargin:a,threshold:s});y.forEach(h=>h&&_.observe(h)),g=()=>{_.disconnect(),g=u.noop}},{immediate:i,flush:"post"}):u.noop,m=()=>{g(),p(),d.value=!1};return u.tryOnScopeDispose(m),{isSupported:v,isActive:d,pause(){g(),d.value=!1},resume(){d.value=!0},stop:m}}function Z(e,t={}){const{window:n=P,scrollTarget:r,threshold:a=0}=t,s=o.ref(!1);return Q(e,c=>{let i=s.value,v=0;for(const f of c)f.time>=v&&(v=f.time,i=f.isIntersecting);s.value=i},{root:r,window:n,threshold:a}),s}const qe={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=Z(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=Z(e,r);o.watch(a,s=>n(s),{immediate:!0})}}},Ye=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(w.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),$e=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Xe=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(w.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),Qe=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(w.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function Ze(e,t,n){const{immediate:r=!0,delay:a=0,onError:s=u.noop,onSuccess:c=u.noop,resetOnExecute:i=!0,shallow:v=!0,throwError:f}=n??{},g=v?o.shallowRef(t):o.ref(t),d=o.ref(!1),p=o.ref(!1),m=o.shallowRef(void 0);async function y(h=0,...S){i&&(g.value=t),m.value=void 0,d.value=!1,p.value=!0,h>0&&await u.promiseTimeout(h);const V=typeof e=="function"?e(...S):e;try{const C=await V;g.value=C,d.value=!0,c(C)}catch(C){if(m.value=C,s(C),f)throw C}finally{p.value=!1}return g.value}r&&y(a);const E={state:g,isReady:d,isLoading:p,error:m,execute:y};function _(){return new Promise((h,S)=>{u.until(p).toBe(!1).then(()=>h(E)).catch(S)})}return{...E,then(h,S){return _().then(h,S)}}}async function De(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:s,sizes:c,class:i,loading:v,crossorigin:f,referrerPolicy:g}=e;r.src=a,s&&(r.srcset=s),c&&(r.sizes=c),i&&(r.className=i),v&&(r.loading=v),f&&(r.crossOrigin=f),g&&(r.referrerPolicy=g),r.onload=()=>t(r),r.onerror=n})}function et(e,t={}){const n=Ze(()=>De(u.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>u.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const tt=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:t}){const n=o.reactive(et(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)}}),ae=1;function D(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=u.noop,onScroll:s=u.noop,offset:c={left:0,right:0,top:0,bottom:0},eventListenerOptions:i={capture:!1,passive:!0},behavior:v="auto",window:f=P,onError:g=b=>{console.error(b)}}=t,d=o.ref(0),p=o.ref(0),m=o.computed({get(){return d.value},set(b){E(b,void 0)}}),y=o.computed({get(){return p.value},set(b){E(void 0,b)}});function E(b,k){var T,U,M,I;if(!f)return;const z=u.toValue(e);if(!z)return;(M=z instanceof Document?f.document.body:z)==null||M.scrollTo({top:(T=u.toValue(k))!=null?T:y.value,left:(U=u.toValue(b))!=null?U:m.value,behavior:u.toValue(v)});const K=((I=z?.document)==null?void 0:I.documentElement)||z?.documentElement||z;m!=null&&(d.value=K.scrollLeft),y!=null&&(p.value=K.scrollTop)}const _=o.ref(!1),h=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),S=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),V=b=>{_.value&&(_.value=!1,S.left=!1,S.right=!1,S.top=!1,S.bottom=!1,a(b))},C=u.useDebounceFn(V,n+r),A=b=>{var k;if(!f)return;const T=((k=b?.document)==null?void 0:k.documentElement)||b?.documentElement||O(b),{display:U,flexDirection:M}=getComputedStyle(T),I=T.scrollLeft;S.left=I<d.value,S.right=I>d.value;const z=Math.abs(I)<=(c.left||0),K=Math.abs(I)+T.clientWidth>=T.scrollWidth-(c.right||0)-ae;U==="flex"&&M==="row-reverse"?(h.left=K,h.right=z):(h.left=z,h.right=K),d.value=I;let B=T.scrollTop;b===f.document&&!B&&(B=f.document.body.scrollTop),S.top=B<p.value,S.bottom=B>p.value;const de=Math.abs(B)<=(c.top||0),pe=Math.abs(B)+T.clientHeight>=T.scrollHeight-(c.bottom||0)-ae;U==="flex"&&M==="column-reverse"?(h.top=pe,h.bottom=de):(h.top=de,h.bottom=pe),p.value=B},R=b=>{var k;if(!f)return;const T=(k=b.target.documentElement)!=null?k:b.target;A(T),_.value=!0,C(b),s(b)};return L(e,"scroll",n?u.useThrottleFn(R,n,!0,!1):R,i),u.tryOnMounted(()=>{try{const b=u.toValue(e);if(!b)return;A(b)}catch(b){g(b)}}),L(e,"scrollend",V,i),{x:m,y,isScrolling:_,arrivedState:h,directions:S,measure(){const b=u.toValue(e);f&&b&&A(b)}}}function q(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function se(e,t,n={}){var r;const{direction:a="bottom",interval:s=100,canLoadMore:c=()=>!0}=n,i=o.reactive(D(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),v=o.ref(),f=o.computed(()=>!!v.value),g=o.computed(()=>q(u.toValue(e))),d=Z(g);function p(){if(i.measure(),!g.value||!d.value||!c(g.value))return;const{scrollHeight:m,clientHeight:y,scrollWidth:E,clientWidth:_}=g.value,h=a==="bottom"||a==="top"?m<=y:E<=_;(i.arrivedState[a]||h)&&(v.value||(v.value=Promise.all([t(i),new Promise(S=>setTimeout(S,s))]).finally(()=>{v.value=null,o.nextTick(()=>p())})))}return o.watch(()=>[i.arrivedState[a],d.value],p,{immediate:!0}),{isLoading:f}}const nt={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?se(e,t.value):se(e,...t.value)}},ot={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?Q(e,t.value):Q(e,...t.value)}},rt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(w.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),at=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),st=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),lt=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(w.useNetwork());return()=>{if(t.default)return t.default(n)}}}),it=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(w.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),ut=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=u.toRef(e,"object"),r=w.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(w.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)}}}),ft=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:w.useOnline()});return()=>{if(t.default)return t.default(n)}}}),dt=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:w.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(w.usePointer({...e,target:e.target==="self"?n:P}));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(w.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),gt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:w.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),mt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:w.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:w.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),yt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:w.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),wt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:w.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}});function Ut(e,t,n={}){const{window:r=P,...a}=n;let s;const c=J(()=>r&&"MutationObserver"in r),i=()=>{s&&(s.disconnect(),s=void 0)},v=o.computed(()=>{const p=u.toValue(e),m=(Array.isArray(p)?p:[p]).map(O).filter(u.notNullish);return new Set(m)}),f=o.watch(()=>v.value,p=>{i(),c.value&&p.size&&(s=new MutationObserver(t),p.forEach(m=>s.observe(m,a)))},{immediate:!0,flush:"post"}),g=()=>s?.takeRecords(),d=()=>{f(),i()};return u.tryOnScopeDispose(d),{isSupported:c,stop:d,takeRecords:g}}function Y(e,t,n={}){const{window:r=P,initialValue:a="",observe:s=!1}=n,c=o.ref(a),i=o.computed(()=>{var f;return O(t)||((f=r?.document)==null?void 0:f.documentElement)});function v(){var f;const g=u.toValue(e),d=u.toValue(i);if(d&&r){const p=(f=r.getComputedStyle(d).getPropertyValue(g))==null?void 0:f.trim();c.value=p||a}}return s&&Ut(i,v,{attributeFilter:["style","class"],window:r}),o.watch([i,()=>u.toValue(e)],v,{immediate:!0}),o.watch(c,f=>{var g;(g=i.value)!=null&&g.style&&i.value.style.setProperty(u.toValue(e),f)}),c}const le="--vueuse-safe-area-top",ie="--vueuse-safe-area-right",ue="--vueuse-safe-area-bottom",ce="--vueuse-safe-area-left";function bt(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(u.isClient){const s=Y(le),c=Y(ie),i=Y(ue),v=Y(ce);s.value="env(safe-area-inset-top, 0px)",c.value="env(safe-area-inset-right, 0px)",i.value="env(safe-area-inset-bottom, 0px)",v.value="env(safe-area-inset-left, 0px)",a(),L("resize",u.useDebounceFn(a))}function a(){e.value=$(le),t.value=$(ie),n.value=$(ue),r.value=$(ce)}return{top:e,right:t,bottom:n,left:r,update:a}}function $(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const St=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}=bt();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())}}}),Ct={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=D(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=D(e,{...r,onScroll(s){var c;(c=r.onScroll)==null||c.call(r,s),n(a)},onStop(s){var c;(c=r.onStop)==null||c.call(r,s),n(a)}})}}};function fe(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:fe(n)}}function Ot(e){const t=e||window.event,n=t.target;return fe(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const ee=new WeakMap;function Et(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(u.toRef(e),i=>{const v=q(u.toValue(i));if(v){const f=v;if(ee.get(f)||ee.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 i=q(u.toValue(e));!i||n.value||(u.isIOS&&(r=L(i,"touchmove",v=>{Ot(v)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},c=()=>{const i=q(u.toValue(e));!i||!n.value||(u.isIOS&&r?.(),i.style.overflow=a,ee.delete(i),n.value=!1)};return u.tryOnScopeDispose(c),o.computed({get(){return n.value},set(i){i?s():c()}})}function Pt(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Et(n,r.value);o.watch(t,s=>a.value=s)}}const Lt=Pt(),_t=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(w.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(w.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),At=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:c,scrollTo:i}=w.useVirtualList(r,e.options);return n({scrollTo:i}),s.style&&typeof s.style=="object"&&!Array.isArray(s.style)&&(s.style.height=e.height||"300px"),()=>o.h("div",{...s},[o.h("div",{...c.value},a.value.map(v=>o.h("div",{style:{overflow:"hidden",height:v.height}},t.default?t.default(v):"Please set content!")))])}}),Mt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:w.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(w.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});l.OnClickOutside=te,l.OnLongPress=he,l.UseActiveElement=ye,l.UseBattery=we,l.UseBrowserLocation=Ue,l.UseClipboard=be,l.UseColorMode=Me,l.UseDark=Te,l.UseDeviceMotion=Ve,l.UseDeviceOrientation=Ie,l.UseDevicePixelRatio=Re,l.UseDevicesList=He,l.UseDocumentVisibility=ze,l.UseDraggable=Ne,l.UseElementBounding=We,l.UseElementSize=Fe,l.UseElementVisibility=Je,l.UseEyeDropper=Ye,l.UseFullscreen=$e,l.UseGeolocation=Xe,l.UseIdle=Qe,l.UseImage=tt,l.UseMouse=rt,l.UseMouseInElement=at,l.UseMousePressed=st,l.UseNetwork=lt,l.UseNow=it,l.UseObjectUrl=ut,l.UseOffsetPagination=ct,l.UseOnline=ft,l.UsePageLeave=dt,l.UsePointer=pt,l.UsePointerLock=vt,l.UsePreferredColorScheme=gt,l.UsePreferredContrast=mt,l.UsePreferredDark=ht,l.UsePreferredLanguages=yt,l.UsePreferredReducedMotion=wt,l.UseScreenSafeArea=St,l.UseTimeAgo=_t,l.UseTimestamp=kt,l.UseVirtualList=At,l.UseWindowFocus=Mt,l.UseWindowSize=Tt,l.VOnClickOutside=F,l.VOnLongPress=ne,l.vElementHover=je,l.vElementSize=Ge,l.vElementVisibility=qe,l.vInfiniteScroll=nt,l.vIntersectionObserver=ot,l.vOnClickOutside=F,l.vOnKeyStroke=ve,l.vOnLongPress=ne,l.vScroll=Ct,l.vScrollLock=Lt})(this.VueUse=this.VueUse||{},VueDemi,VueUse,VueUse);
1
+ var VueDemi=function(l,o,w){if(l.install)return l;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),l;if(o.version.slice(0,4)==="2.7."){let O=function(_,k){var H,j={},F={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(W,N){return j[W]=N,this},directive:function(W,N){return N?(o.directive(W,N),F):o.directive(W)},mount:function(W,N){return H||(H=new o(Object.assign({propsData:k},_,{provide:Object.assign(j,_.provide)})),H.$mount(W,N),H)},unmount:function(){H&&(H.$destroy(),H=void 0)}};return F};var ne=O;for(var i in o)l[i]=o[i];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.warn=o.util.warn,l.hasInjectionContext=function(){return!!l.getCurrentInstance()},l.createApp=O}else if(o.version.slice(0,2)==="2.")if(w){for(var i in w)l[i]=w[i];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.hasInjectionContext=function(){return!!l.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var i in o)l[i]=o[i];l.isVue2=!1,l.isVue3=!0,l.install=function(){},l.Vue=o,l.Vue2=void 0,l.version=o.version,l.set=function(O,_,k){return Array.isArray(O)?(O.length=Math.max(O.length,_),O.splice(_,1,k),k):(O[_]=k,k)},l.del=function(O,_){if(Array.isArray(O)){O.splice(_,1);return}delete O[_]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return l}((globalThis||self).VueDemi=(globalThis||self).VueDemi||(typeof VueDemi<"u"?VueDemi:{}),(globalThis||self).Vue||(typeof Vue<"u"?Vue:void 0),(globalThis||self).VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(l,o,w,i){"use strict";const ne=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return w.onClickOutside(r,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}});function O(e){var t;const n=i.toValue(e);return(t=n?.$el)!=null?t:n}const _=i.isClient?window:void 0;function k(...e){let t,n,r,s;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,s]=e,t=_):[t,n,r,s]=e,!t)return i.noop;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const a=[],c=()=>{a.forEach(v=>v()),a.length=0},u=(v,f,p,m)=>(v.addEventListener(f,p,m),()=>v.removeEventListener(f,p,m)),g=o.watch(()=>[O(t),i.toValue(s)],([v,f])=>{if(c(),!v)return;const p=i.isObject(f)?{...f}:f;a.push(...n.flatMap(m=>r.map(y=>u(v,m,y,p))))},{immediate:!0,flush:"post"}),d=()=>{g(),c()};return i.tryOnScopeDispose(d),d}let H=!1;function j(e,t,n={}){const{window:r=_,ignore:s=[],capture:a=!0,detectIframe:c=!1}=n;if(!r)return i.noop;i.isIOS&&!H&&(H=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",i.noop)),r.document.documentElement.addEventListener("click",i.noop));let u=!0;const g=p=>s.some(m=>{if(typeof m=="string")return Array.from(r.document.querySelectorAll(m)).some(y=>y===p.target||p.composedPath().includes(y));{const y=O(m);return y&&(p.target===y||p.composedPath().includes(y))}}),v=[k(r,"click",p=>{const m=O(e);if(!(!m||m===p.target||p.composedPath().includes(m))){if(p.detail===0&&(u=!g(p)),!u){u=!0;return}t(p)}},{passive:!0,capture:a}),k(r,"pointerdown",p=>{const m=O(e);u=!g(p)&&!!(m&&!p.composedPath().includes(m))},{passive:!0}),c&&k(r,"blur",p=>{setTimeout(()=>{var m;const y=O(e);((m=r.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!y?.contains(r.document.activeElement)&&t(p)},0)})].filter(Boolean);return()=>v.forEach(p=>p())}const F={[i.directiveHooks.mounted](e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=j(e,t.value,{capture:n});else{const[r,s]=t.value;e.__onClickOutside_stop=j(e,r,Object.assign({capture:n},s))}},[i.directiveHooks.unmounted](e){e.__onClickOutside_stop()}};function W(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function N(...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:s=_,eventName:a="keydown",passive:c=!1,dedupe:u=!1}=r,g=W(t);return k(s,a,v=>{v.repeat&&i.toValue(u)||g(v)&&n(v)},c)}const me={[i.directiveHooks.mounted](e,t){var n,r;const s=(r=(n=t.arg)==null?void 0:n.split(","))!=null?r:!0;if(typeof t.value=="function")N(s,t.value,{target:e});else{const[a,c]=t.value;N(s,a,{target:e,...c})}}},he=500,ye=10;function X(e,t,n){var r,s;const a=o.computed(()=>O(e));let c,u,g,d=!1;function v(){c&&(clearTimeout(c),c=void 0),u=void 0,g=void 0,d=!1}function f(h){var S,I,C;const[T,z,b]=[g,u,d];if(v(),!n?.onMouseUp||!z||!T||(S=n?.modifiers)!=null&&S.self&&h.target!==a.value)return;(I=n?.modifiers)!=null&&I.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation();const V=h.x-z.x,M=h.y-z.y,U=Math.sqrt(V*V+M*M);n.onMouseUp(h.timeStamp-T,U,b)}function p(h){var S,I,C,T;(S=n?.modifiers)!=null&&S.self&&h.target!==a.value||(v(),(I=n?.modifiers)!=null&&I.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation(),u={x:h.x,y:h.y},g=h.timeStamp,c=setTimeout(()=>{d=!0,t(h)},(T=n?.delay)!=null?T:he))}function m(h){var S,I,C,T;if((S=n?.modifiers)!=null&&S.self&&h.target!==a.value||!u||n?.distanceThreshold===!1)return;(I=n?.modifiers)!=null&&I.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation();const z=h.x-u.x,b=h.y-u.y;Math.sqrt(z*z+b*b)>=((T=n?.distanceThreshold)!=null?T:ye)&&v()}const y={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(s=n?.modifiers)==null?void 0:s.once},E=[k(a,"pointerdown",p,y),k(a,"pointermove",m,y),k(a,["pointerup","pointerleave"],f,y)];return()=>E.forEach(h=>h())}const we=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return X(r,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),oe={[i.directiveHooks.mounted](e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},Ue=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:w.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),be=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(w.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Se=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(w.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Ce=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(w.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),x=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},G="__vueuse_ssr_handlers__",Oe=Ee();function Ee(){return G in x||(x[G]=x[G]||{}),x[G]}function re(e,t){return Oe[e]||t}function Pe(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 _e={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()}},se="vueuse-storage";function Le(e,t,n,r={}){var s;const{flush:a="pre",deep:c=!0,listenToStorageChanges:u=!0,writeDefaults:g=!0,mergeDefaults:d=!1,shallow:v,window:f=_,eventFilter:p,onError:m=U=>{console.error(U)},initOnMounted:y}=r,E=(v?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=re("getDefaultStorage",()=>{var U;return(U=_)==null?void 0:U.localStorage})()}catch(U){m(U)}if(!n)return E;const A=i.toValue(t),h=Pe(A),S=(s=r.serializer)!=null?s:_e[h],{pause:I,resume:C}=i.pausableWatch(E,()=>z(E.value),{flush:a,deep:c,eventFilter:p});f&&u&&i.tryOnMounted(()=>{n instanceof Storage?k(f,"storage",V):k(f,se,M),y&&V()}),y||V();function T(U,P){f&&!(n instanceof Storage)&&f.dispatchEvent(new CustomEvent(se,{detail:{key:e,oldValue:U,newValue:P,storageArea:n}}))}function z(U){try{const P=n.getItem(e);if(U==null)T(P,null),n.removeItem(e);else{const L=S.write(U);P!==L&&(n.setItem(e,L),T(P,L))}}catch(P){m(P)}}function b(U){const P=U?U.newValue:n.getItem(e);if(P==null)return g&&A!=null&&n.setItem(e,S.write(A)),A;if(!U&&d){const L=S.read(P);return typeof d=="function"?d(L,A):h==="object"&&!Array.isArray(L)?{...A,...L}:L}else return typeof P!="string"?P:S.read(P)}function V(U){if(!(U&&U.storageArea!==n)){if(U&&U.key==null){E.value=A;return}if(!(U&&U.key!==e)){I();try{U?.newValue!==S.write(E.value)&&(E.value=b(U))}catch(P){m(P)}finally{U?o.nextTick(C):C()}}}}function M(U){V(U.detail)}return E}function ke(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},o.isVue2?void 0:t),e}function J(e){const t=ke();return o.computed(()=>(t.value,!!e()))}function Ae(e,t={}){const{window:n=_}=t,r=J(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let s;const a=o.ref(!1),c=d=>{a.value=d.matches},u=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",c):s.removeListener(c))},g=o.watchEffect(()=>{r.value&&(u(),s=n.matchMedia(i.toValue(e)),"addEventListener"in s?s.addEventListener("change",c):s.addListener(c),a.value=s.matches)});return i.tryOnScopeDispose(()=>{g(),u(),s=void 0}),a}function Te(e){return Ae("(prefers-color-scheme: dark)",e)}const Me="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ve(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:s=_,storage:a,storageKey:c="vueuse-color-scheme",listenToStorageChanges:u=!0,storageRef:g,emitAuto:d,disableTransition:v=!0}=e,f={auto:"",light:"light",dark:"dark",...e.modes||{}},p=Te({window:s}),m=o.computed(()=>p.value?"dark":"light"),y=g||(c==null?i.toRef(r):Le(c,r,a,{window:s,listenToStorageChanges:u})),E=o.computed(()=>y.value==="auto"?m.value:y.value),A=re("updateHTMLAttrs",(C,T,z)=>{const b=typeof C=="string"?s?.document.querySelector(C):O(C);if(!b)return;const V=new Set,M=new Set;let U=null;if(T==="class"){const L=z.split(/\s/g);Object.values(f).flatMap(R=>(R||"").split(/\s/g)).filter(Boolean).forEach(R=>{L.includes(R)?V.add(R):M.add(R)})}else U={key:T,value:z};if(V.size===0&&M.size===0&&U===null)return;let P;v&&(P=s.document.createElement("style"),P.appendChild(document.createTextNode(Me)),s.document.head.appendChild(P));for(const L of V)b.classList.add(L);for(const L of M)b.classList.remove(L);U&&b.setAttribute(U.key,U.value),v&&(s.getComputedStyle(P).opacity,document.head.removeChild(P))});function h(C){var T;A(t,n,(T=f[C])!=null?T:C)}function S(C){e.onChanged?e.onChanged(C,h):h(C)}o.watch(E,S,{flush:"post",immediate:!0}),i.tryOnMounted(()=>S(E.value));const I=o.computed({get(){return d?y.value:E.value},set(C){y.value=C}});try{return Object.assign(I,{store:y,system:m,state:E})}catch{return I}}const Ie=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ve(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),Re=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=w.useDark(e),r=o.reactive({isDark:n,toggleDark:i.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),ze=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=o.reactive(w.useDeviceMotion());return()=>{if(t.default)return t.default(n)}}}),He=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(w.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),Ne=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:w.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),We=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(w.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),Be=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:w.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var d;return(d=e.handle)!=null?d:n.value}),s=o.computed(()=>!!e.disabled),a=e.storageKey&&w.useStorage(e.storageKey,i.toValue(e.initialValue)||{x:0,y:0},w.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),c=a||e.initialValue||{x:0,y:0},u=(d,v)=>{var f;(f=e.onEnd)==null||f.call(e,d,v),a&&(a.value.x=d.x,a.value.y=d.y)},g=o.reactive(w.useDraggable(n,{...e,handle:r,initialValue:c,onEnd:u,disabled:s}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${g.style}`},t.default(g))}}}),Fe=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function ae(e,t={}){const{delayEnter:n=0,delayLeave:r=0,window:s=_}=t,a=o.ref(!1);let c;const u=g=>{const d=g?n:r;c&&(clearTimeout(c),c=void 0),d?c=setTimeout(()=>a.value=g,d):a.value=g};return s&&(k(e,"mouseenter",()=>u(!0),{passive:!0}),k(e,"mouseleave",()=>u(!1),{passive:!0})),a}const Ke={[i.directiveHooks.mounted](e,t){const n=t.value;if(typeof n=="function"){const r=ae(e);o.watch(r,s=>n(s))}else{const[r,s]=n,a=ae(e,s);o.watch(a,c=>r(c))}}},xe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.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 Q(e,t,n={}){const{window:r=_,...s}=n;let a;const c=J(()=>r&&"ResizeObserver"in r),u=()=>{a&&(a.disconnect(),a=void 0)},g=o.computed(()=>{const f=i.toValue(e);return Array.isArray(f)?f.map(p=>O(p)):[O(f)]}),d=o.watch(g,f=>{if(u(),c.value&&r){a=new ResizeObserver(t);for(const p of f)p&&a.observe(p,s)}},{immediate:!0,flush:"post"}),v=()=>{u(),d()};return i.tryOnScopeDispose(v),{isSupported:c,stop:v}}function Ge(e,t={width:0,height:0},n={}){const{window:r=_,box:s="content-box"}=n,a=o.computed(()=>{var f,p;return(p=(f=O(e))==null?void 0:f.namespaceURI)==null?void 0:p.includes("svg")}),c=o.ref(t.width),u=o.ref(t.height),{stop:g}=Q(e,([f])=>{const p=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(r&&a.value){const m=O(e);if(m){const y=m.getBoundingClientRect();c.value=y.width,u.value=y.height}}else if(p){const m=Array.isArray(p)?p:[p];c.value=m.reduce((y,{inlineSize:E})=>y+E,0),u.value=m.reduce((y,{blockSize:E})=>y+E,0)}else c.value=f.contentRect.width,u.value=f.contentRect.height},n);i.tryOnMounted(()=>{const f=O(e);f&&(c.value="offsetWidth"in f?f.offsetWidth:t.width,u.value="offsetHeight"in f?f.offsetHeight:t.height)});const d=o.watch(()=>O(e),f=>{c.value=f?t.width:0,u.value=f?t.height:0});function v(){g(),d()}return{width:c,height:u,stop:v}}const Je={[i.directiveHooks.mounted](e,t){var n;const r=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],s=typeof t.value=="function"?[]:t.value.slice(1),{width:a,height:c}=Ge(e,...s);o.watch([a,c],([u,g])=>r({width:u,height:g}))}},qe=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:w.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Z(e,t,n={}){const{root:r,rootMargin:s="0px",threshold:a=0,window:c=_,immediate:u=!0}=n,g=J(()=>c&&"IntersectionObserver"in c),d=o.computed(()=>{const y=i.toValue(e);return(Array.isArray(y)?y:[y]).map(O).filter(i.notNullish)});let v=i.noop;const f=o.ref(u),p=g.value?o.watch(()=>[d.value,O(r),f.value],([y,E])=>{if(v(),!f.value||!y.length)return;const A=new IntersectionObserver(t,{root:O(E),rootMargin:s,threshold:a});y.forEach(h=>h&&A.observe(h)),v=()=>{A.disconnect(),v=i.noop}},{immediate:u,flush:"post"}):i.noop,m=()=>{v(),p(),f.value=!1};return i.tryOnScopeDispose(m),{isSupported:g,isActive:f,pause(){v(),f.value=!1},resume(){f.value=!0},stop:m}}function D(e,t={}){const{window:n=_,scrollTarget:r,threshold:s=0}=t,a=o.ref(!1);return Z(e,c=>{let u=a.value,g=0;for(const d of c)d.time>=g&&(g=d.time,u=d.isIntersecting);a.value=u},{root:r,window:n,threshold:s}),a}const Ye={[i.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=D(e);o.watch(r,s=>n(s),{immediate:!0})}else{const[n,r]=t.value,s=D(e,r);o.watch(s,a=>n(a),{immediate:!0})}}},$e=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(w.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Qe=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(w.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),Ze=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(w.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function De(e,t,n){const{immediate:r=!0,delay:s=0,onError:a=i.noop,onSuccess:c=i.noop,resetOnExecute:u=!0,shallow:g=!0,throwError:d}=n??{},v=g?o.shallowRef(t):o.ref(t),f=o.ref(!1),p=o.ref(!1),m=o.shallowRef(void 0);async function y(h=0,...S){u&&(v.value=t),m.value=void 0,f.value=!1,p.value=!0,h>0&&await i.promiseTimeout(h);const I=typeof e=="function"?e(...S):e;try{const C=await I;v.value=C,f.value=!0,c(C)}catch(C){if(m.value=C,a(C),d)throw C}finally{p.value=!1}return v.value}r&&y(s);const E={state:v,isReady:f,isLoading:p,error:m,execute:y};function A(){return new Promise((h,S)=>{i.until(p).toBe(!1).then(()=>h(E)).catch(S)})}return{...E,then(h,S){return A().then(h,S)}}}async function et(e){return new Promise((t,n)=>{const r=new Image,{src:s,srcset:a,sizes:c,class:u,loading:g,crossorigin:d,referrerPolicy:v}=e;r.src=s,a&&(r.srcset=a),c&&(r.sizes=c),u&&(r.className=u),g&&(r.loading=g),d&&(r.crossOrigin=d),v&&(r.referrerPolicy=v),r.onload=()=>t(r),r.onerror=n})}function tt(e,t={}){const n=De(()=>et(i.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>i.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const nt=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:t}){const n=o.reactive(tt(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)}}),le=1;function ee(e,t={}){const{throttle:n=0,idle:r=200,onStop:s=i.noop,onScroll:a=i.noop,offset:c={left:0,right:0,top:0,bottom:0},eventListenerOptions:u={capture:!1,passive:!0},behavior:g="auto",window:d=_,onError:v=b=>{console.error(b)}}=t,f=o.ref(0),p=o.ref(0),m=o.computed({get(){return f.value},set(b){E(b,void 0)}}),y=o.computed({get(){return p.value},set(b){E(void 0,b)}});function E(b,V){var M,U,P,L;if(!d)return;const R=i.toValue(e);if(!R)return;(P=R instanceof Document?d.document.body:R)==null||P.scrollTo({top:(M=i.toValue(V))!=null?M:y.value,left:(U=i.toValue(b))!=null?U:m.value,behavior:i.toValue(g)});const K=((L=R?.document)==null?void 0:L.documentElement)||R?.documentElement||R;m!=null&&(f.value=K.scrollLeft),y!=null&&(p.value=K.scrollTop)}const A=o.ref(!1),h=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),S=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),I=b=>{A.value&&(A.value=!1,S.left=!1,S.right=!1,S.top=!1,S.bottom=!1,s(b))},C=i.useDebounceFn(I,n+r),T=b=>{var V;if(!d)return;const M=((V=b?.document)==null?void 0:V.documentElement)||b?.documentElement||O(b),{display:U,flexDirection:P}=getComputedStyle(M),L=M.scrollLeft;S.left=L<f.value,S.right=L>f.value;const R=Math.abs(L)<=(c.left||0),K=Math.abs(L)+M.clientWidth>=M.scrollWidth-(c.right||0)-le;U==="flex"&&P==="row-reverse"?(h.left=K,h.right=R):(h.left=R,h.right=K),f.value=L;let B=M.scrollTop;b===d.document&&!B&&(B=d.document.body.scrollTop),S.top=B<p.value,S.bottom=B>p.value;const ve=Math.abs(B)<=(c.top||0),ge=Math.abs(B)+M.clientHeight>=M.scrollHeight-(c.bottom||0)-le;U==="flex"&&P==="column-reverse"?(h.top=ge,h.bottom=ve):(h.top=ve,h.bottom=ge),p.value=B},z=b=>{var V;if(!d)return;const M=(V=b.target.documentElement)!=null?V:b.target;T(M),A.value=!0,C(b),a(b)};return k(e,"scroll",n?i.useThrottleFn(z,n,!0,!1):z,u),i.tryOnMounted(()=>{try{const b=i.toValue(e);if(!b)return;T(b)}catch(b){v(b)}}),k(e,"scrollend",I,u),{x:m,y,isScrolling:A,arrivedState:h,directions:S,measure(){const b=i.toValue(e);d&&b&&T(b)}}}function q(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function ie(e,t,n={}){var r;const{direction:s="bottom",interval:a=100,canLoadMore:c=()=>!0}=n,u=o.reactive(ee(e,{...n,offset:{[s]:(r=n.distance)!=null?r:0,...n.offset}})),g=o.ref(),d=o.computed(()=>!!g.value),v=o.computed(()=>q(i.toValue(e))),f=D(v);function p(){if(u.measure(),!v.value||!f.value||!c(v.value))return;const{scrollHeight:m,clientHeight:y,scrollWidth:E,clientWidth:A}=v.value,h=s==="bottom"||s==="top"?m<=y:E<=A;(u.arrivedState[s]||h)&&(g.value||(g.value=Promise.all([t(u),new Promise(S=>setTimeout(S,a))]).finally(()=>{g.value=null,o.nextTick(()=>p())})))}return o.watch(()=>[u.arrivedState[s],f.value],p,{immediate:!0}),{isLoading:d,reset(){o.nextTick(()=>p())}}}const ot={[i.directiveHooks.mounted](e,t){typeof t.value=="function"?ie(e,t.value):ie(e,...t.value)}},rt={[i.directiveHooks.mounted](e,t){typeof t.value=="function"?Z(e,t.value):Z(e,...t.value)}},st=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(w.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),at=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),lt=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),it=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(w.useNetwork());return()=>{if(t.default)return t.default(n)}}}),ut=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(w.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),ct=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=i.toRef(e,"object"),r=w.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),ft=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(w.useOffsetPagination({...e,onPageChange(...s){var a;(a=e.onPageChange)==null||a.call(e,...s),n("page-change",...s)},onPageSizeChange(...s){var a;(a=e.onPageSizeChange)==null||a.call(e,...s),n("page-size-change",...s)},onPageCountChange(...s){var a;(a=e.onPageCountChange)==null||a.call(e,...s),n("page-count-change",...s)}}));return()=>{if(t.default)return t.default(r)}}}),dt=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:w.useOnline()});return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:w.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),vt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.ref(null),r=o.reactive(w.usePointer({...e,target:e.target==="self"?n:_}));return()=>{if(t.default)return t.default(r,{ref:n})}}}),gt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),mt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:w.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:w.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),yt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:w.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),wt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:w.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),Ut=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:w.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),bt={[i.directiveHooks.mounted](e,t){typeof t.value=="function"?Q(e,t.value):Q(e,...t.value)}};function St(e,t,n={}){const{window:r=_,...s}=n;let a;const c=J(()=>r&&"MutationObserver"in r),u=()=>{a&&(a.disconnect(),a=void 0)},g=o.computed(()=>{const p=i.toValue(e),m=(Array.isArray(p)?p:[p]).map(O).filter(i.notNullish);return new Set(m)}),d=o.watch(()=>g.value,p=>{u(),c.value&&p.size&&(a=new MutationObserver(t),p.forEach(m=>a.observe(m,s)))},{immediate:!0,flush:"post"}),v=()=>a?.takeRecords(),f=()=>{d(),u()};return i.tryOnScopeDispose(f),{isSupported:c,stop:f,takeRecords:v}}function Y(e,t,n={}){const{window:r=_,initialValue:s,observe:a=!1}=n,c=o.ref(s),u=o.computed(()=>{var d;return O(t)||((d=r?.document)==null?void 0:d.documentElement)});function g(){var d;const v=i.toValue(e),f=i.toValue(u);if(f&&r&&v){const p=(d=r.getComputedStyle(f).getPropertyValue(v))==null?void 0:d.trim();c.value=p||s}}return a&&St(u,g,{attributeFilter:["style","class"],window:r}),o.watch([u,()=>i.toValue(e)],(d,v)=>{v[0]&&v[1]&&r&&r.getComputedStyle(v[0]).removeProperty(v[1]),g()},{immediate:!0}),o.watch(c,d=>{var v;const f=i.toValue(e);(v=u.value)!=null&&v.style&&f&&(d==null?u.value.style.removeProperty(f):u.value.style.setProperty(f,d))}),c}const ue="--vueuse-safe-area-top",ce="--vueuse-safe-area-right",fe="--vueuse-safe-area-bottom",de="--vueuse-safe-area-left";function Ct(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(i.isClient){const a=Y(ue),c=Y(ce),u=Y(fe),g=Y(de);a.value="env(safe-area-inset-top, 0px)",c.value="env(safe-area-inset-right, 0px)",u.value="env(safe-area-inset-bottom, 0px)",g.value="env(safe-area-inset-left, 0px)",s(),k("resize",i.useDebounceFn(s))}function s(){e.value=$(ue),t.value=$(ce),n.value=$(fe),r.value=$(de)}return{top:e,right:t,bottom:n,left:r,update:s}}function $(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const Ot=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:r,bottom:s,left:a}=Ct();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?r.value:"",paddingBottom:e.bottom?s.value:"",paddingLeft:e.left?a.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),Et={[i.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=ee(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,s=ee(e,{...r,onScroll(a){var c;(c=r.onScroll)==null||c.call(r,a),n(s)},onStop(a){var c;(c=r.onStop)==null||c.call(r,a),n(s)}})}}};function pe(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:pe(n)}}function Pt(e){const t=e||window.event,n=t.target;return pe(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const te=new WeakMap;function _t(e,t=!1){const n=o.ref(t);let r=null,s="";o.watch(i.toRef(e),u=>{const g=q(i.toValue(u));if(g){const d=g;if(te.get(d)||te.set(d,d.style.overflow),d.style.overflow!=="hidden"&&(s=d.style.overflow),d.style.overflow==="hidden")return n.value=!0;if(n.value)return d.style.overflow="hidden"}},{immediate:!0});const a=()=>{const u=q(i.toValue(e));!u||n.value||(i.isIOS&&(r=k(u,"touchmove",g=>{Pt(g)},{passive:!1})),u.style.overflow="hidden",n.value=!0)},c=()=>{const u=q(i.toValue(e));!u||!n.value||(i.isIOS&&r?.(),u.style.overflow=s,te.delete(u),n.value=!1)};return i.tryOnScopeDispose(c),o.computed({get(){return n.value},set(u){u?a():c()}})}function Lt(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const s=_t(n,r.value);o.watch(t,a=>s.value=a)}}const kt=Lt(),At=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(w.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(w.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:r}=o.toRefs(e),{list:s,containerProps:a,wrapperProps:c,scrollTo:u}=w.useVirtualList(r,e.options);return n({scrollTo:u}),a.style&&typeof a.style=="object"&&!Array.isArray(a.style)&&(a.style.height=e.height||"300px"),()=>o.h("div",{...a},[o.h("div",{...c.value},s.value.map(g=>o.h("div",{style:{overflow:"hidden",height:g.height}},t.default?t.default(g):"Please set content!")))])}}),Vt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:w.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),It=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(w.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});l.OnClickOutside=ne,l.OnLongPress=we,l.UseActiveElement=Ue,l.UseBattery=be,l.UseBrowserLocation=Se,l.UseClipboard=Ce,l.UseColorMode=Ie,l.UseDark=Re,l.UseDeviceMotion=ze,l.UseDeviceOrientation=He,l.UseDevicePixelRatio=Ne,l.UseDevicesList=We,l.UseDocumentVisibility=Be,l.UseDraggable=je,l.UseElementBounding=Fe,l.UseElementSize=xe,l.UseElementVisibility=qe,l.UseEyeDropper=$e,l.UseFullscreen=Xe,l.UseGeolocation=Qe,l.UseIdle=Ze,l.UseImage=nt,l.UseMouse=st,l.UseMouseInElement=at,l.UseMousePressed=lt,l.UseNetwork=it,l.UseNow=ut,l.UseObjectUrl=ct,l.UseOffsetPagination=ft,l.UseOnline=dt,l.UsePageLeave=pt,l.UsePointer=vt,l.UsePointerLock=gt,l.UsePreferredColorScheme=mt,l.UsePreferredContrast=ht,l.UsePreferredDark=yt,l.UsePreferredLanguages=wt,l.UsePreferredReducedMotion=Ut,l.UseScreenSafeArea=Ot,l.UseTimeAgo=At,l.UseTimestamp=Tt,l.UseVirtualList=Mt,l.UseWindowFocus=Vt,l.UseWindowSize=It,l.VOnClickOutside=F,l.VOnLongPress=oe,l.vElementHover=Ke,l.vElementSize=Je,l.vElementVisibility=Ye,l.vInfiniteScroll=ot,l.vIntersectionObserver=rt,l.vOnClickOutside=F,l.vOnKeyStroke=me,l.vOnLongPress=oe,l.vResizeObserver=bt,l.vScroll=Et,l.vScrollLock=kt})(this.VueUse=this.VueUse||{},VueDemi,VueUse,VueUse);