@vueuse/shared 10.3.0 → 10.4.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.iife.js CHANGED
@@ -117,33 +117,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
117
117
  ;(function (exports, vueDemi) {
118
118
  'use strict';
119
119
 
120
- var __defProp$b = Object.defineProperty;
121
- var __defProps$8 = Object.defineProperties;
122
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
123
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
124
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
125
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
126
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
127
- var __spreadValues$b = (a, b) => {
128
- for (var prop in b || (b = {}))
129
- if (__hasOwnProp$d.call(b, prop))
130
- __defNormalProp$b(a, prop, b[prop]);
131
- if (__getOwnPropSymbols$d)
132
- for (var prop of __getOwnPropSymbols$d(b)) {
133
- if (__propIsEnum$d.call(b, prop))
134
- __defNormalProp$b(a, prop, b[prop]);
135
- }
136
- return a;
137
- };
138
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
139
120
  function computedEager(fn, options) {
140
- var _a;
141
121
  const result = vueDemi.shallowRef();
142
122
  vueDemi.watchEffect(() => {
143
123
  result.value = fn();
144
- }, __spreadProps$8(__spreadValues$b({}, options), {
145
- flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
146
- }));
124
+ }, {
125
+ ...options,
126
+ flush: options?.flush ?? "sync"
127
+ });
147
128
  return vueDemi.readonly(result);
148
129
  }
149
130
 
@@ -172,7 +153,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
172
153
  return v;
173
154
  },
174
155
  set(v2) {
175
- set == null ? void 0 : set(v2);
156
+ set?.(v2);
176
157
  }
177
158
  };
178
159
  });
@@ -295,25 +276,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
295
276
  return vueDemi.unref(v) != null;
296
277
  }
297
278
 
298
- var __defProp$a = Object.defineProperty;
299
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
300
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
301
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
302
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
303
- var __spreadValues$a = (a, b) => {
304
- for (var prop in b || (b = {}))
305
- if (__hasOwnProp$c.call(b, prop))
306
- __defNormalProp$a(a, prop, b[prop]);
307
- if (__getOwnPropSymbols$c)
308
- for (var prop of __getOwnPropSymbols$c(b)) {
309
- if (__propIsEnum$c.call(b, prop))
310
- __defNormalProp$a(a, prop, b[prop]);
311
- }
312
- return a;
313
- };
314
279
  function makeDestructurable(obj, arr) {
315
280
  if (typeof Symbol !== "undefined") {
316
- const clone = __spreadValues$a({}, obj);
281
+ const clone = { ...obj };
317
282
  Object.defineProperty(clone, Symbol.iterator, {
318
283
  enumerable: false,
319
284
  value() {
@@ -338,7 +303,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
338
303
  const resolveUnref = toValue;
339
304
 
340
305
  function reactify(fn, options) {
341
- const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? vueDemi.unref : toValue;
306
+ const unrefFn = options?.computedGetter === false ? vueDemi.unref : toValue;
342
307
  return function(...args) {
343
308
  return vueDemi.computed(() => fn.apply(this, args.map((i) => unrefFn(i))));
344
309
  };
@@ -412,7 +377,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
412
377
  );
413
378
  }
414
379
 
415
- const isClient = typeof window !== "undefined";
380
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
416
381
  const isDef = (val) => typeof val !== "undefined";
417
382
  const notNullish = (val) => val != null;
418
383
  const assert = (condition, ...infos) => {
@@ -434,8 +399,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
434
399
  const hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);
435
400
  const isIOS = /* @__PURE__ */ getIsIOS();
436
401
  function getIsIOS() {
437
- var _a;
438
- return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
402
+ return isClient && window?.navigator?.userAgent && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
439
403
  }
440
404
 
441
405
  function createFilterWrapper(filter, fn) {
@@ -606,10 +570,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
606
570
  return props.some((k) => k in obj);
607
571
  }
608
572
  function increaseWithUnit(target, delta) {
609
- var _a;
610
573
  if (typeof target === "number")
611
574
  return target + delta;
612
- const value = ((_a = target.match(/^-?[0-9]+\.?[0-9]*/)) == null ? void 0 : _a[0]) || "";
575
+ const value = target.match(/^-?[0-9]+\.?[0-9]*/)?.[0] || "";
613
576
  const unit = target.slice(value.length);
614
577
  const result = Number.parseFloat(value) + delta;
615
578
  if (Number.isNaN(result))
@@ -650,10 +613,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
650
613
 
651
614
  function refAutoReset(defaultValue, afterMs = 1e4) {
652
615
  return vueDemi.customRef((track, trigger) => {
653
- let value = defaultValue;
616
+ let value = toValue(defaultValue);
654
617
  let timer;
655
618
  const resetAfter = () => setTimeout(() => {
656
- value = defaultValue;
619
+ value = toValue(defaultValue);
657
620
  trigger();
658
621
  }, toValue(afterMs));
659
622
  tryOnScopeDispose(() => {
@@ -693,8 +656,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
693
656
  function refDefault(source, defaultValue) {
694
657
  return vueDemi.computed({
695
658
  get() {
696
- var _a;
697
- return (_a = source.value) != null ? _a : defaultValue;
659
+ return source.value ?? defaultValue;
698
660
  },
699
661
  set(value) {
700
662
  source.value = value;
@@ -742,14 +704,13 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
742
704
  return source;
743
705
  }
744
706
  function set(value, triggering = true) {
745
- var _a, _b;
746
707
  if (value === source)
747
708
  return;
748
709
  const old = source;
749
- if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)
710
+ if (options.onBeforeChange?.(value, old) === false)
750
711
  return;
751
712
  source = value;
752
- (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);
713
+ options.onChanged?.(value, old);
753
714
  if (triggering)
754
715
  trigger();
755
716
  }
@@ -787,8 +748,39 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
787
748
  }
788
749
  }
789
750
 
751
+ function watchWithFilter(source, cb, options = {}) {
752
+ const {
753
+ eventFilter = bypassFilter,
754
+ ...watchOptions
755
+ } = options;
756
+ return vueDemi.watch(
757
+ source,
758
+ createFilterWrapper(
759
+ eventFilter,
760
+ cb
761
+ ),
762
+ watchOptions
763
+ );
764
+ }
765
+
766
+ function watchPausable(source, cb, options = {}) {
767
+ const {
768
+ eventFilter: filter,
769
+ ...watchOptions
770
+ } = options;
771
+ const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
772
+ const stop = watchWithFilter(
773
+ source,
774
+ cb,
775
+ {
776
+ ...watchOptions,
777
+ eventFilter
778
+ }
779
+ );
780
+ return { stop, pause, resume, isActive };
781
+ }
782
+
790
783
  function syncRef(left, right, options = {}) {
791
- var _a, _b;
792
784
  const {
793
785
  flush = "sync",
794
786
  deep = false,
@@ -796,28 +788,35 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
796
788
  direction = "both",
797
789
  transform = {}
798
790
  } = options;
799
- let watchLeft;
800
- let watchRight;
801
- const transformLTR = (_a = transform.ltr) != null ? _a : (v) => v;
802
- const transformRTL = (_b = transform.rtl) != null ? _b : (v) => v;
791
+ const watchers = [];
792
+ const transformLTR = transform.ltr ?? ((v) => v);
793
+ const transformRTL = transform.rtl ?? ((v) => v);
803
794
  if (direction === "both" || direction === "ltr") {
804
- watchLeft = vueDemi.watch(
795
+ watchers.push(watchPausable(
805
796
  left,
806
- (newValue) => right.value = transformLTR(newValue),
797
+ (newValue) => {
798
+ watchers.forEach((w) => w.pause());
799
+ right.value = transformLTR(newValue);
800
+ watchers.forEach((w) => w.resume());
801
+ },
807
802
  { flush, deep, immediate }
808
- );
803
+ ));
809
804
  }
810
805
  if (direction === "both" || direction === "rtl") {
811
- watchRight = vueDemi.watch(
806
+ watchers.push(watchPausable(
812
807
  right,
813
- (newValue) => left.value = transformRTL(newValue),
808
+ (newValue) => {
809
+ watchers.forEach((w) => w.pause());
810
+ left.value = transformRTL(newValue);
811
+ watchers.forEach((w) => w.resume());
812
+ },
814
813
  { flush, deep, immediate }
815
- );
814
+ ));
816
815
  }
817
- return () => {
818
- watchLeft == null ? void 0 : watchLeft();
819
- watchRight == null ? void 0 : watchRight();
816
+ const stop = () => {
817
+ watchers.forEach((w) => w.stop());
820
818
  };
819
+ return stop;
821
820
  }
822
821
 
823
822
  function syncRefs(source, targets, options = {}) {
@@ -835,25 +834,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
835
834
  );
836
835
  }
837
836
 
838
- var __defProp$9 = Object.defineProperty;
839
- var __defProps$7 = Object.defineProperties;
840
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
841
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
842
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
843
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
844
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
845
- var __spreadValues$9 = (a, b) => {
846
- for (var prop in b || (b = {}))
847
- if (__hasOwnProp$b.call(b, prop))
848
- __defNormalProp$9(a, prop, b[prop]);
849
- if (__getOwnPropSymbols$b)
850
- for (var prop of __getOwnPropSymbols$b(b)) {
851
- if (__propIsEnum$b.call(b, prop))
852
- __defNormalProp$9(a, prop, b[prop]);
853
- }
854
- return a;
855
- };
856
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
857
837
  function toRefs(objectRef, options = {}) {
858
838
  if (!vueDemi.isRef(objectRef))
859
839
  return vueDemi.toRefs(objectRef);
@@ -864,15 +844,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
864
844
  return objectRef.value[key];
865
845
  },
866
846
  set(v) {
867
- var _a;
868
- const replaceRef = (_a = toValue(options.replaceRef)) != null ? _a : true;
847
+ const replaceRef = toValue(options.replaceRef) ?? true;
869
848
  if (replaceRef) {
870
849
  if (Array.isArray(objectRef.value)) {
871
850
  const copy = [...objectRef.value];
872
851
  copy[key] = v;
873
852
  objectRef.value = copy;
874
853
  } else {
875
- const newObject = __spreadProps$7(__spreadValues$9({}, objectRef.value), { [key]: v });
854
+ const newObject = { ...objectRef.value, [key]: v };
876
855
  Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
877
856
  objectRef.value = newObject;
878
857
  }
@@ -921,7 +900,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
921
900
  r,
922
901
  (v) => {
923
902
  if (condition(v) !== isNot) {
924
- stop == null ? void 0 : stop();
903
+ stop?.();
925
904
  resolve(v);
926
905
  }
927
906
  },
@@ -935,7 +914,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
935
914
  const promises = [watcher];
936
915
  if (timeout != null) {
937
916
  promises.push(
938
- promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop == null ? void 0 : stop())
917
+ promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop?.())
939
918
  );
940
919
  }
941
920
  return Promise.race(promises);
@@ -943,14 +922,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
943
922
  function toBe(value, options) {
944
923
  if (!vueDemi.isRef(value))
945
924
  return toMatch((v) => v === value, options);
946
- const { flush = "sync", deep = false, timeout, throwOnTimeout } = options != null ? options : {};
925
+ const { flush = "sync", deep = false, timeout, throwOnTimeout } = options ?? {};
947
926
  let stop = null;
948
927
  const watcher = new Promise((resolve) => {
949
928
  stop = vueDemi.watch(
950
929
  [r, value],
951
930
  ([v1, v2]) => {
952
931
  if (isNot !== (v1 === v2)) {
953
- stop == null ? void 0 : stop();
932
+ stop?.();
954
933
  resolve(v1);
955
934
  }
956
935
  },
@@ -965,7 +944,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
965
944
  if (timeout != null) {
966
945
  promises.push(
967
946
  promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {
968
- stop == null ? void 0 : stop();
947
+ stop?.();
969
948
  return toValue(r);
970
949
  })
971
950
  );
@@ -1036,10 +1015,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1036
1015
  return value === othVal;
1037
1016
  }
1038
1017
  function useArrayDifference(...args) {
1039
- var _a;
1040
1018
  const list = args[0];
1041
1019
  const values = args[1];
1042
- let compareFn = (_a = args[2]) != null ? _a : defaultComparator;
1020
+ let compareFn = args[2] ?? defaultComparator;
1043
1021
  if (typeof compareFn === "string") {
1044
1022
  const key = compareFn;
1045
1023
  compareFn = (value, othVal) => value[key] === othVal[key];
@@ -1087,20 +1065,19 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1087
1065
  return isObject(obj) && containsProp(obj, "formIndex", "comparator");
1088
1066
  }
1089
1067
  function useArrayIncludes(...args) {
1090
- var _a;
1091
1068
  const list = args[0];
1092
1069
  const value = args[1];
1093
1070
  let comparator = args[2];
1094
1071
  let formIndex = 0;
1095
1072
  if (isArrayIncludesOptions(comparator)) {
1096
- formIndex = (_a = comparator.fromIndex) != null ? _a : 0;
1073
+ formIndex = comparator.fromIndex ?? 0;
1097
1074
  comparator = comparator.comparator;
1098
1075
  }
1099
1076
  if (typeof comparator === "string") {
1100
1077
  const key = comparator;
1101
1078
  comparator = (element, value2) => element[key] === toValue(value2);
1102
1079
  }
1103
- comparator = comparator != null ? comparator : (element, value2) => element === toValue(value2);
1080
+ comparator = comparator ?? ((element, value2) => element === toValue(value2));
1104
1081
  return vueDemi.computed(
1105
1082
  () => toValue(list).slice(formIndex).some(
1106
1083
  (element, index, array) => comparator(toValue(element), toValue(value), index, toValue(array))
@@ -1172,7 +1149,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1172
1149
  return isLowercase ? m.toLowerCase() : m;
1173
1150
  }
1174
1151
  function formatDate(date, formatStr, options = {}) {
1175
- var _a;
1176
1152
  const years = date.getFullYear();
1177
1153
  const month = date.getMonth();
1178
1154
  const days = date.getDate();
@@ -1181,7 +1157,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1181
1157
  const seconds = date.getSeconds();
1182
1158
  const milliseconds = date.getMilliseconds();
1183
1159
  const day = date.getDay();
1184
- const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;
1160
+ const meridiem = options.customMeridiem ?? defaultMeridiem;
1185
1161
  const matches = {
1186
1162
  YY: () => String(years).slice(-2),
1187
1163
  YYYY: () => years,
@@ -1209,10 +1185,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1209
1185
  a: () => meridiem(hours, minutes, true),
1210
1186
  aa: () => meridiem(hours, minutes, true, true)
1211
1187
  };
1212
- return formatStr.replace(REGEX_FORMAT, (match, $1) => {
1213
- var _a2, _b;
1214
- return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) != null ? _b : match;
1215
- });
1188
+ return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 ?? matches[match]?.() ?? match);
1216
1189
  }
1217
1190
  function normalizeDate(date) {
1218
1191
  if (date === null)
@@ -1279,22 +1252,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1279
1252
  };
1280
1253
  }
1281
1254
 
1282
- var __defProp$8 = Object.defineProperty;
1283
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1284
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1285
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1286
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1287
- var __spreadValues$8 = (a, b) => {
1288
- for (var prop in b || (b = {}))
1289
- if (__hasOwnProp$a.call(b, prop))
1290
- __defNormalProp$8(a, prop, b[prop]);
1291
- if (__getOwnPropSymbols$a)
1292
- for (var prop of __getOwnPropSymbols$a(b)) {
1293
- if (__propIsEnum$a.call(b, prop))
1294
- __defNormalProp$8(a, prop, b[prop]);
1295
- }
1296
- return a;
1297
- };
1298
1255
  function useInterval(interval = 1e3, options = {}) {
1299
1256
  const {
1300
1257
  controls: exposeControls = false,
@@ -1315,18 +1272,18 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1315
1272
  { immediate }
1316
1273
  );
1317
1274
  if (exposeControls) {
1318
- return __spreadValues$8({
1275
+ return {
1319
1276
  counter,
1320
- reset
1321
- }, controls);
1277
+ reset,
1278
+ ...controls
1279
+ };
1322
1280
  } else {
1323
1281
  return counter;
1324
1282
  }
1325
1283
  }
1326
1284
 
1327
1285
  function useLastChanged(source, options = {}) {
1328
- var _a;
1329
- const ms = vueDemi.ref((_a = options.initialValue) != null ? _a : null);
1286
+ const ms = vueDemi.ref(options.initialValue ?? null);
1330
1287
  vueDemi.watch(
1331
1288
  source,
1332
1289
  () => ms.value = timestamp(),
@@ -1373,37 +1330,22 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1373
1330
  };
1374
1331
  }
1375
1332
 
1376
- var __defProp$7 = Object.defineProperty;
1377
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1378
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1379
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1380
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1381
- var __spreadValues$7 = (a, b) => {
1382
- for (var prop in b || (b = {}))
1383
- if (__hasOwnProp$9.call(b, prop))
1384
- __defNormalProp$7(a, prop, b[prop]);
1385
- if (__getOwnPropSymbols$9)
1386
- for (var prop of __getOwnPropSymbols$9(b)) {
1387
- if (__propIsEnum$9.call(b, prop))
1388
- __defNormalProp$7(a, prop, b[prop]);
1389
- }
1390
- return a;
1391
- };
1392
1333
  function useTimeout(interval = 1e3, options = {}) {
1393
1334
  const {
1394
1335
  controls: exposeControls = false,
1395
1336
  callback
1396
1337
  } = options;
1397
1338
  const controls = useTimeoutFn(
1398
- callback != null ? callback : noop,
1339
+ callback ?? noop,
1399
1340
  interval,
1400
1341
  options
1401
1342
  );
1402
1343
  const ready = vueDemi.computed(() => !controls.isPending.value);
1403
1344
  if (exposeControls) {
1404
- return __spreadValues$7({
1405
- ready
1406
- }, controls);
1345
+ return {
1346
+ ready,
1347
+ ...controls
1348
+ };
1407
1349
  } else {
1408
1350
  return ready;
1409
1351
  }
@@ -1453,7 +1395,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1453
1395
  }
1454
1396
 
1455
1397
  function watchArray(source, cb, options) {
1456
- let oldList = (options == null ? void 0 : options.immediate) ? [] : [
1398
+ let oldList = options?.immediate ? [] : [
1457
1399
  ...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)
1458
1400
  ];
1459
1401
  return vueDemi.watch(source, (newList, _, onCleanup) => {
@@ -1477,58 +1419,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1477
1419
  }, options);
1478
1420
  }
1479
1421
 
1480
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1481
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1482
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1483
- var __objRest$5 = (source, exclude) => {
1484
- var target = {};
1485
- for (var prop in source)
1486
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1487
- target[prop] = source[prop];
1488
- if (source != null && __getOwnPropSymbols$8)
1489
- for (var prop of __getOwnPropSymbols$8(source)) {
1490
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
1491
- target[prop] = source[prop];
1492
- }
1493
- return target;
1494
- };
1495
- function watchWithFilter(source, cb, options = {}) {
1496
- const _a = options, {
1497
- eventFilter = bypassFilter
1498
- } = _a, watchOptions = __objRest$5(_a, [
1499
- "eventFilter"
1500
- ]);
1501
- return vueDemi.watch(
1502
- source,
1503
- createFilterWrapper(
1504
- eventFilter,
1505
- cb
1506
- ),
1507
- watchOptions
1508
- );
1509
- }
1510
-
1511
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1512
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1513
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1514
- var __objRest$4 = (source, exclude) => {
1515
- var target = {};
1516
- for (var prop in source)
1517
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1518
- target[prop] = source[prop];
1519
- if (source != null && __getOwnPropSymbols$7)
1520
- for (var prop of __getOwnPropSymbols$7(source)) {
1521
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
1522
- target[prop] = source[prop];
1523
- }
1524
- return target;
1525
- };
1526
1422
  function watchAtMost(source, cb, options) {
1527
- const _a = options, {
1528
- count
1529
- } = _a, watchOptions = __objRest$4(_a, [
1530
- "count"
1531
- ]);
1423
+ const {
1424
+ count,
1425
+ ...watchOptions
1426
+ } = options;
1532
1427
  const current = vueDemi.ref(0);
1533
1428
  const stop = watchWithFilter(
1534
1429
  source,
@@ -1543,120 +1438,38 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1543
1438
  return { count: current, stop };
1544
1439
  }
1545
1440
 
1546
- var __defProp$6 = Object.defineProperty;
1547
- var __defProps$6 = Object.defineProperties;
1548
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1549
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1550
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1551
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1552
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1553
- var __spreadValues$6 = (a, b) => {
1554
- for (var prop in b || (b = {}))
1555
- if (__hasOwnProp$6.call(b, prop))
1556
- __defNormalProp$6(a, prop, b[prop]);
1557
- if (__getOwnPropSymbols$6)
1558
- for (var prop of __getOwnPropSymbols$6(b)) {
1559
- if (__propIsEnum$6.call(b, prop))
1560
- __defNormalProp$6(a, prop, b[prop]);
1561
- }
1562
- return a;
1563
- };
1564
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1565
- var __objRest$3 = (source, exclude) => {
1566
- var target = {};
1567
- for (var prop in source)
1568
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1569
- target[prop] = source[prop];
1570
- if (source != null && __getOwnPropSymbols$6)
1571
- for (var prop of __getOwnPropSymbols$6(source)) {
1572
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1573
- target[prop] = source[prop];
1574
- }
1575
- return target;
1576
- };
1577
1441
  function watchDebounced(source, cb, options = {}) {
1578
- const _a = options, {
1442
+ const {
1579
1443
  debounce = 0,
1580
- maxWait = void 0
1581
- } = _a, watchOptions = __objRest$3(_a, [
1582
- "debounce",
1583
- "maxWait"
1584
- ]);
1444
+ maxWait = void 0,
1445
+ ...watchOptions
1446
+ } = options;
1585
1447
  return watchWithFilter(
1586
1448
  source,
1587
1449
  cb,
1588
- __spreadProps$6(__spreadValues$6({}, watchOptions), {
1450
+ {
1451
+ ...watchOptions,
1589
1452
  eventFilter: debounceFilter(debounce, { maxWait })
1590
- })
1453
+ }
1591
1454
  );
1592
1455
  }
1593
1456
 
1594
- var __defProp$5 = Object.defineProperty;
1595
- var __defProps$5 = Object.defineProperties;
1596
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1597
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1598
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1599
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1600
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1601
- var __spreadValues$5 = (a, b) => {
1602
- for (var prop in b || (b = {}))
1603
- if (__hasOwnProp$5.call(b, prop))
1604
- __defNormalProp$5(a, prop, b[prop]);
1605
- if (__getOwnPropSymbols$5)
1606
- for (var prop of __getOwnPropSymbols$5(b)) {
1607
- if (__propIsEnum$5.call(b, prop))
1608
- __defNormalProp$5(a, prop, b[prop]);
1609
- }
1610
- return a;
1611
- };
1612
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1613
1457
  function watchDeep(source, cb, options) {
1614
1458
  return vueDemi.watch(
1615
1459
  source,
1616
1460
  cb,
1617
- __spreadProps$5(__spreadValues$5({}, options), {
1461
+ {
1462
+ ...options,
1618
1463
  deep: true
1619
- })
1464
+ }
1620
1465
  );
1621
1466
  }
1622
1467
 
1623
- var __defProp$4 = Object.defineProperty;
1624
- var __defProps$4 = Object.defineProperties;
1625
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1626
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1627
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1628
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1629
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1630
- var __spreadValues$4 = (a, b) => {
1631
- for (var prop in b || (b = {}))
1632
- if (__hasOwnProp$4.call(b, prop))
1633
- __defNormalProp$4(a, prop, b[prop]);
1634
- if (__getOwnPropSymbols$4)
1635
- for (var prop of __getOwnPropSymbols$4(b)) {
1636
- if (__propIsEnum$4.call(b, prop))
1637
- __defNormalProp$4(a, prop, b[prop]);
1638
- }
1639
- return a;
1640
- };
1641
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1642
- var __objRest$2 = (source, exclude) => {
1643
- var target = {};
1644
- for (var prop in source)
1645
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1646
- target[prop] = source[prop];
1647
- if (source != null && __getOwnPropSymbols$4)
1648
- for (var prop of __getOwnPropSymbols$4(source)) {
1649
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1650
- target[prop] = source[prop];
1651
- }
1652
- return target;
1653
- };
1654
1468
  function watchIgnorable(source, cb, options = {}) {
1655
- const _a = options, {
1656
- eventFilter = bypassFilter
1657
- } = _a, watchOptions = __objRest$2(_a, [
1658
- "eventFilter"
1659
- ]);
1469
+ const {
1470
+ eventFilter = bypassFilter,
1471
+ ...watchOptions
1472
+ } = options;
1660
1473
  const filteredCb = createFilterWrapper(
1661
1474
  eventFilter,
1662
1475
  cb
@@ -1694,7 +1507,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1694
1507
  () => {
1695
1508
  syncCounter.value++;
1696
1509
  },
1697
- __spreadProps$4(__spreadValues$4({}, watchOptions), { flush: "sync" })
1510
+ { ...watchOptions, flush: "sync" }
1698
1511
  )
1699
1512
  );
1700
1513
  ignoreUpdates = (updater) => {
@@ -1723,32 +1536,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1723
1536
  return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
1724
1537
  }
1725
1538
 
1726
- var __defProp$3 = Object.defineProperty;
1727
- var __defProps$3 = Object.defineProperties;
1728
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1729
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1730
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1731
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1732
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1733
- var __spreadValues$3 = (a, b) => {
1734
- for (var prop in b || (b = {}))
1735
- if (__hasOwnProp$3.call(b, prop))
1736
- __defNormalProp$3(a, prop, b[prop]);
1737
- if (__getOwnPropSymbols$3)
1738
- for (var prop of __getOwnPropSymbols$3(b)) {
1739
- if (__propIsEnum$3.call(b, prop))
1740
- __defNormalProp$3(a, prop, b[prop]);
1741
- }
1742
- return a;
1743
- };
1744
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1745
1539
  function watchImmediate(source, cb, options) {
1746
1540
  return vueDemi.watch(
1747
1541
  source,
1748
1542
  cb,
1749
- __spreadProps$3(__spreadValues$3({}, options), {
1543
+ {
1544
+ ...options,
1750
1545
  immediate: true
1751
- })
1546
+ }
1752
1547
  );
1753
1548
  }
1754
1549
 
@@ -1759,123 +1554,23 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1759
1554
  }, options);
1760
1555
  }
1761
1556
 
1762
- var __defProp$2 = Object.defineProperty;
1763
- var __defProps$2 = Object.defineProperties;
1764
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1765
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1766
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1767
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1768
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1769
- var __spreadValues$2 = (a, b) => {
1770
- for (var prop in b || (b = {}))
1771
- if (__hasOwnProp$2.call(b, prop))
1772
- __defNormalProp$2(a, prop, b[prop]);
1773
- if (__getOwnPropSymbols$2)
1774
- for (var prop of __getOwnPropSymbols$2(b)) {
1775
- if (__propIsEnum$2.call(b, prop))
1776
- __defNormalProp$2(a, prop, b[prop]);
1777
- }
1778
- return a;
1779
- };
1780
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1781
- var __objRest$1 = (source, exclude) => {
1782
- var target = {};
1783
- for (var prop in source)
1784
- if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
1785
- target[prop] = source[prop];
1786
- if (source != null && __getOwnPropSymbols$2)
1787
- for (var prop of __getOwnPropSymbols$2(source)) {
1788
- if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
1789
- target[prop] = source[prop];
1790
- }
1791
- return target;
1792
- };
1793
- function watchPausable(source, cb, options = {}) {
1794
- const _a = options, {
1795
- eventFilter: filter
1796
- } = _a, watchOptions = __objRest$1(_a, [
1797
- "eventFilter"
1798
- ]);
1799
- const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
1800
- const stop = watchWithFilter(
1801
- source,
1802
- cb,
1803
- __spreadProps$2(__spreadValues$2({}, watchOptions), {
1804
- eventFilter
1805
- })
1806
- );
1807
- return { stop, pause, resume, isActive };
1808
- }
1809
-
1810
- var __defProp$1 = Object.defineProperty;
1811
- var __defProps$1 = Object.defineProperties;
1812
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1813
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1814
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1815
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1816
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1817
- var __spreadValues$1 = (a, b) => {
1818
- for (var prop in b || (b = {}))
1819
- if (__hasOwnProp$1.call(b, prop))
1820
- __defNormalProp$1(a, prop, b[prop]);
1821
- if (__getOwnPropSymbols$1)
1822
- for (var prop of __getOwnPropSymbols$1(b)) {
1823
- if (__propIsEnum$1.call(b, prop))
1824
- __defNormalProp$1(a, prop, b[prop]);
1825
- }
1826
- return a;
1827
- };
1828
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1829
- var __objRest = (source, exclude) => {
1830
- var target = {};
1831
- for (var prop in source)
1832
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
1833
- target[prop] = source[prop];
1834
- if (source != null && __getOwnPropSymbols$1)
1835
- for (var prop of __getOwnPropSymbols$1(source)) {
1836
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
1837
- target[prop] = source[prop];
1838
- }
1839
- return target;
1840
- };
1841
1557
  function watchThrottled(source, cb, options = {}) {
1842
- const _a = options, {
1558
+ const {
1843
1559
  throttle = 0,
1844
1560
  trailing = true,
1845
- leading = true
1846
- } = _a, watchOptions = __objRest(_a, [
1847
- "throttle",
1848
- "trailing",
1849
- "leading"
1850
- ]);
1561
+ leading = true,
1562
+ ...watchOptions
1563
+ } = options;
1851
1564
  return watchWithFilter(
1852
1565
  source,
1853
1566
  cb,
1854
- __spreadProps$1(__spreadValues$1({}, watchOptions), {
1567
+ {
1568
+ ...watchOptions,
1855
1569
  eventFilter: throttleFilter(throttle, trailing, leading)
1856
- })
1570
+ }
1857
1571
  );
1858
1572
  }
1859
1573
 
1860
- var __defProp = Object.defineProperty;
1861
- var __defProps = Object.defineProperties;
1862
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1863
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
1864
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1865
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
1866
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1867
- var __spreadValues = (a, b) => {
1868
- for (var prop in b || (b = {}))
1869
- if (__hasOwnProp.call(b, prop))
1870
- __defNormalProp(a, prop, b[prop]);
1871
- if (__getOwnPropSymbols)
1872
- for (var prop of __getOwnPropSymbols(b)) {
1873
- if (__propIsEnum.call(b, prop))
1874
- __defNormalProp(a, prop, b[prop]);
1875
- }
1876
- return a;
1877
- };
1878
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1879
1574
  function watchTriggerable(source, cb, options = {}) {
1880
1575
  let cleanupFn;
1881
1576
  function onEffect() {
@@ -1901,9 +1596,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1901
1596
  });
1902
1597
  return res2;
1903
1598
  };
1904
- return __spreadProps(__spreadValues({}, res), {
1599
+ return {
1600
+ ...res,
1905
1601
  trigger
1906
- });
1602
+ };
1907
1603
  }
1908
1604
  function getWatchSources(sources) {
1909
1605
  if (vueDemi.isReactive(sources))