@stacksjs/browser 0.69.3 → 0.70.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/dist/index.js CHANGED
@@ -365,14 +365,23 @@ async function loop(times, callback) {
365
365
  Array.from({ length: times }).forEach(async (_, i) => await callback(i));
366
366
  }
367
367
  // ../../../../node_modules/@stripe/stripe-js/dist/index.mjs
368
- var V3_URL = "https://js.stripe.com/v3";
368
+ var RELEASE_TRAIN = "v3";
369
+ var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion2(version) {
370
+ return version === 3 ? "v3" : version;
371
+ };
372
+ var ORIGIN = "https://js.stripe.com";
373
+ var STRIPE_JS_URL = "".concat(ORIGIN, "/v3");
369
374
  var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
375
+ var STRIPE_JS_URL_REGEX = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
370
376
  var EXISTING_SCRIPT_MESSAGE = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";
377
+ var isStripeJSURL = function isStripeJSURL2(url) {
378
+ return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);
379
+ };
371
380
  var findScript = function findScript2() {
372
- var scripts = document.querySelectorAll('script[src^="'.concat(V3_URL, '"]'));
381
+ var scripts = document.querySelectorAll('script[src^="'.concat(ORIGIN, '"]'));
373
382
  for (var i = 0;i < scripts.length; i++) {
374
383
  var script = scripts[i];
375
- if (!V3_URL_REGEX.test(script.src)) {
384
+ if (!isStripeJSURL(script.src)) {
376
385
  continue;
377
386
  }
378
387
  return script;
@@ -382,7 +391,7 @@ var findScript = function findScript2() {
382
391
  var injectScript = function injectScript2(params) {
383
392
  var queryString = params && !params.advancedFraudSignals ? "?advancedFraudSignals=false" : "";
384
393
  var script = document.createElement("script");
385
- script.src = "".concat(V3_URL).concat(queryString);
394
+ script.src = "".concat(STRIPE_JS_URL).concat(queryString);
386
395
  var headOrBody = document.head || document.body;
387
396
  if (!headOrBody) {
388
397
  throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
@@ -396,7 +405,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
396
405
  }
397
406
  stripe._registerWrapper({
398
407
  name: "stripe-js",
399
- version: "5.6.0",
408
+ version: "5.10.0",
400
409
  startTime
401
410
  });
402
411
  };
@@ -404,8 +413,10 @@ var stripePromise$1 = null;
404
413
  var onErrorListener = null;
405
414
  var onLoadListener = null;
406
415
  var onError = function onError2(reject) {
407
- return function() {
408
- reject(new Error("Failed to load Stripe.js"));
416
+ return function(cause) {
417
+ reject(new Error("Failed to load Stripe.js", {
418
+ cause
419
+ }));
409
420
  };
410
421
  };
411
422
  var onLoad = function onLoad2(resolve, reject) {
@@ -464,6 +475,13 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
464
475
  if (maybeStripe === null) {
465
476
  return null;
466
477
  }
478
+ var pk = args[0];
479
+ var isTestKey = pk.match(/^pk_test/);
480
+ var version = runtimeVersionToUrlVersion(maybeStripe.version);
481
+ var expectedVersion = RELEASE_TRAIN;
482
+ if (isTestKey && version !== expectedVersion) {
483
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("5.10.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
484
+ }
467
485
  var stripe = maybeStripe.apply(undefined, args);
468
486
  registerWrapper(stripe, startTime);
469
487
  return stripe;
@@ -1426,8 +1444,7 @@ function makeMap(str) {
1426
1444
  }
1427
1445
  var EMPTY_OBJ = Object.freeze({});
1428
1446
  var EMPTY_ARR = Object.freeze([]);
1429
- var NOOP = () => {
1430
- };
1447
+ var NOOP = () => {};
1431
1448
  var NO = () => false;
1432
1449
  var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
1433
1450
  var extend = Object.assign;
@@ -2067,8 +2084,7 @@ function track(target, type, key) {
2067
2084
  type,
2068
2085
  key
2069
2086
  });
2070
- } else {
2071
- }
2087
+ } else {}
2072
2088
  }
2073
2089
  }
2074
2090
  function trigger(target, type, key, newValue, oldValue, oldTarget) {
@@ -2088,8 +2104,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
2088
2104
  oldValue,
2089
2105
  oldTarget
2090
2106
  });
2091
- } else {
2092
- }
2107
+ } else {}
2093
2108
  }
2094
2109
  };
2095
2110
  startBatch();
@@ -2766,8 +2781,7 @@ class RefImpl {
2766
2781
  type: "get",
2767
2782
  key: "value"
2768
2783
  });
2769
- } else {
2770
- }
2784
+ } else {}
2771
2785
  return this._value;
2772
2786
  }
2773
2787
  set value(newValue) {
@@ -2785,8 +2799,7 @@ class RefImpl {
2785
2799
  newValue,
2786
2800
  oldValue
2787
2801
  });
2788
- } else {
2789
- }
2802
+ } else {}
2790
2803
  }
2791
2804
  }
2792
2805
  }
@@ -4267,8 +4280,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
4267
4280
  const ctx = useSSRContext();
4268
4281
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4269
4282
  } else if (!runsImmediately) {
4270
- const watchStopHandle = () => {
4271
- };
4283
+ const watchStopHandle = () => {};
4272
4284
  watchStopHandle.stop = NOOP;
4273
4285
  watchStopHandle.resume = NOOP;
4274
4286
  watchStopHandle.pause = NOOP;
@@ -5473,6 +5485,13 @@ function createInjectionState(composable, options) {
5473
5485
  const useInjectedState = () => injectLocal(key, defaultValue);
5474
5486
  return [useProvidingState, useInjectedState];
5475
5487
  }
5488
+ function createRef2(value, deep) {
5489
+ if (deep === true) {
5490
+ return ref(value);
5491
+ } else {
5492
+ return shallowRef(value);
5493
+ }
5494
+ }
5476
5495
  function createSharedComposable(composable) {
5477
5496
  let subscribers = 0;
5478
5497
  let state;
@@ -5612,14 +5631,50 @@ var toString2 = Object.prototype.toString;
5612
5631
  var isObject2 = (val) => toString2.call(val) === "[object Object]";
5613
5632
  var timestamp = () => +Date.now();
5614
5633
  var clamp = (n, min, max) => Math.min(max, Math.max(min, n));
5615
- var noop = () => {
5616
- };
5634
+ var noop = () => {};
5617
5635
  var hasOwn2 = (val, key) => Object.prototype.hasOwnProperty.call(val, key);
5618
5636
  var isIOS = /* @__PURE__ */ getIsIOS();
5619
5637
  function getIsIOS() {
5620
5638
  var _a, _b;
5621
5639
  return isClient && ((_a = window == null ? undefined : window.navigator) == null ? undefined : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? undefined : window.navigator) == null ? undefined : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? undefined : window.navigator.userAgent));
5622
5640
  }
5641
+ function toRef2(...args) {
5642
+ if (args.length !== 1)
5643
+ return toRef(...args);
5644
+ const r = args[0];
5645
+ return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);
5646
+ }
5647
+ var resolveRef = toRef2;
5648
+ function reactivePick(obj, ...keys) {
5649
+ const flatKeys = keys.flat();
5650
+ const predicate = flatKeys[0];
5651
+ return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef2(obj, k)])));
5652
+ }
5653
+ function refAutoReset(defaultValue, afterMs = 1e4) {
5654
+ return customRef((track2, trigger2) => {
5655
+ let value = toValue(defaultValue);
5656
+ let timer;
5657
+ const resetAfter = () => setTimeout(() => {
5658
+ value = toValue(defaultValue);
5659
+ trigger2();
5660
+ }, toValue(afterMs));
5661
+ tryOnScopeDispose(() => {
5662
+ clearTimeout(timer);
5663
+ });
5664
+ return {
5665
+ get() {
5666
+ track2();
5667
+ return value;
5668
+ },
5669
+ set(newValue) {
5670
+ value = newValue;
5671
+ trigger2();
5672
+ clearTimeout(timer);
5673
+ timer = resetAfter();
5674
+ }
5675
+ };
5676
+ });
5677
+ }
5623
5678
  function createFilterWrapper(filter, fn) {
5624
5679
  function wrapper(...args) {
5625
5680
  return new Promise((resolve, reject) => {
@@ -5745,19 +5800,6 @@ function pausableFilter(extendFilter = bypassFilter, options = {}) {
5745
5800
  };
5746
5801
  return { isActive: readonly(isActive), pause, resume, eventFilter };
5747
5802
  }
5748
- function cacheStringFunction2(fn) {
5749
- const cache = /* @__PURE__ */ Object.create(null);
5750
- return (str) => {
5751
- const hit = cache[str];
5752
- return hit || (cache[str] = fn(str));
5753
- };
5754
- }
5755
- var hyphenateRE2 = /\B([A-Z])/g;
5756
- var hyphenate2 = cacheStringFunction2((str) => str.replace(hyphenateRE2, "-$1").toLowerCase());
5757
- var camelizeRE2 = /-(\w)/g;
5758
- var camelize2 = cacheStringFunction2((str) => {
5759
- return str.replace(camelizeRE2, (_, c) => c ? c.toUpperCase() : "");
5760
- });
5761
5803
  function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
5762
5804
  return new Promise((resolve, reject) => {
5763
5805
  if (throwOnTimeout)
@@ -5818,48 +5860,24 @@ function objectOmit(obj, keys, omitUndefined = false) {
5818
5860
  function objectEntries(obj) {
5819
5861
  return Object.entries(obj);
5820
5862
  }
5821
- function getLifeCycleTarget(target) {
5822
- return target || getCurrentInstance();
5823
- }
5824
5863
  function toArray(value) {
5825
5864
  return Array.isArray(value) ? value : [value];
5826
5865
  }
5827
- function toRef2(...args) {
5828
- if (args.length !== 1)
5829
- return toRef(...args);
5830
- const r = args[0];
5831
- return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);
5832
- }
5833
- var resolveRef = toRef2;
5834
- function reactivePick(obj, ...keys) {
5835
- const flatKeys = keys.flat();
5836
- const predicate = flatKeys[0];
5837
- return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef2(obj, k)])));
5866
+ function cacheStringFunction2(fn) {
5867
+ const cache = /* @__PURE__ */ Object.create(null);
5868
+ return (str) => {
5869
+ const hit = cache[str];
5870
+ return hit || (cache[str] = fn(str));
5871
+ };
5838
5872
  }
5839
- function refAutoReset(defaultValue, afterMs = 1e4) {
5840
- return customRef((track2, trigger2) => {
5841
- let value = toValue(defaultValue);
5842
- let timer;
5843
- const resetAfter = () => setTimeout(() => {
5844
- value = toValue(defaultValue);
5845
- trigger2();
5846
- }, toValue(afterMs));
5847
- tryOnScopeDispose(() => {
5848
- clearTimeout(timer);
5849
- });
5850
- return {
5851
- get() {
5852
- track2();
5853
- return value;
5854
- },
5855
- set(newValue) {
5856
- value = newValue;
5857
- trigger2();
5858
- clearTimeout(timer);
5859
- timer = resetAfter();
5860
- }
5861
- };
5862
- });
5873
+ var hyphenateRE2 = /\B([A-Z])/g;
5874
+ var hyphenate2 = cacheStringFunction2((str) => str.replace(hyphenateRE2, "-$1").toLowerCase());
5875
+ var camelizeRE2 = /-(\w)/g;
5876
+ var camelize2 = cacheStringFunction2((str) => {
5877
+ return str.replace(camelizeRE2, (_, c) => c ? c.toUpperCase() : "");
5878
+ });
5879
+ function getLifeCycleTarget(target) {
5880
+ return target || getCurrentInstance();
5863
5881
  }
5864
5882
  function useDebounceFn(fn, ms = 200, options = {}) {
5865
5883
  return createFilterWrapper(debounceFilter(ms, options), fn);
@@ -5999,8 +6017,8 @@ function syncRefs(source, targets, options = {}) {
5999
6017
  deep = false,
6000
6018
  immediate = true
6001
6019
  } = options;
6002
- targets = toArray(targets);
6003
- return watch2(source, (newValue) => targets.forEach((target) => target.value = newValue), { flush, deep, immediate });
6020
+ const targetsArray = toArray(targets);
6021
+ return watch2(source, (newValue) => targetsArray.forEach((target) => target.value = newValue), { flush, deep, immediate });
6004
6022
  }
6005
6023
  function toRefs2(objectRef, options = {}) {
6006
6024
  if (!isRef(objectRef))
@@ -6259,7 +6277,7 @@ function useArrayUnique(list, compareFn) {
6259
6277
  }
6260
6278
  function useCounter(initialValue = 0, options = {}) {
6261
6279
  let _initialValue = unref(initialValue);
6262
- const count = ref(initialValue);
6280
+ const count = shallowRef(initialValue);
6263
6281
  const {
6264
6282
  max = Number.POSITIVE_INFINITY,
6265
6283
  min = Number.NEGATIVE_INFINITY
@@ -6436,7 +6454,7 @@ function useInterval(interval = 1000, options = {}) {
6436
6454
  }
6437
6455
  function useLastChanged(source, options = {}) {
6438
6456
  var _a;
6439
- const ms = ref((_a = options.initialValue) != null ? _a : null);
6457
+ const ms = shallowRef((_a = options.initialValue) != null ? _a : null);
6440
6458
  watch2(source, () => ms.value = timestamp(), options);
6441
6459
  return ms;
6442
6460
  }
@@ -6522,7 +6540,7 @@ function useToggle(initialValue = false, options = {}) {
6522
6540
  falsyValue = false
6523
6541
  } = options;
6524
6542
  const valueIsRef = isRef(initialValue);
6525
- const _value = ref(initialValue);
6543
+ const _value = shallowRef(initialValue);
6526
6544
  function toggle(value) {
6527
6545
  if (arguments.length) {
6528
6546
  _value.value = value;
@@ -6539,7 +6557,7 @@ function useToggle(initialValue = false, options = {}) {
6539
6557
  return [_value, toggle];
6540
6558
  }
6541
6559
  function watchArray(source, cb, options) {
6542
- let oldList = (options == null ? undefined : options.immediate) ? [] : [...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)];
6560
+ let oldList = (options == null ? undefined : options.immediate) ? [] : [...typeof source === "function" ? source() : Array.isArray(source) ? source : toValue(source)];
6543
6561
  return watch2(source, (newList, _, onCleanup) => {
6544
6562
  const oldListRemains = Array.from({ length: oldList.length });
6545
6563
  const added = [];
@@ -6602,8 +6620,7 @@ function watchIgnorable(source, cb, options = {}) {
6602
6620
  let stop2;
6603
6621
  if (watchOptions.flush === "sync") {
6604
6622
  const ignore = shallowRef(false);
6605
- ignorePrevAsyncUpdates = () => {
6606
- };
6623
+ ignorePrevAsyncUpdates = () => {};
6607
6624
  ignoreUpdates = (updater) => {
6608
6625
  ignore.value = true;
6609
6626
  updater();
@@ -6997,8 +7014,7 @@ function createPromiseLock() {
6997
7014
  };
6998
7015
  const taskPromise = runTask();
6999
7016
  queue2.push(taskPromise);
7000
- currentPromise = taskPromise.catch(() => {
7001
- }).finally(() => {
7017
+ currentPromise = taskPromise.catch(() => {}).finally(() => {
7002
7018
  const index = queue2.indexOf(taskPromise);
7003
7019
  if (index > -1)
7004
7020
  queue2.splice(index, 1);
@@ -7185,7 +7201,7 @@ function createRegExp(pattern, options = {}) {
7185
7201
  return new RegExp(pattern, options.flags);
7186
7202
  }
7187
7203
  // src/utils/retry.ts
7188
- function retry(fn, options) {
7204
+ function retry(fn, options = {}) {
7189
7205
  const { retries = 3, initialDelay = 1000, backoffFactor = 2, jitter = true } = options;
7190
7206
  return new Promise((resolve, reject) => {
7191
7207
  let attemptCount = 0;
@@ -7420,10 +7436,8 @@ function createTemplatePromise(options = {}) {
7420
7436
  key: index++,
7421
7437
  args,
7422
7438
  promise: undefined,
7423
- resolve: () => {
7424
- },
7425
- reject: () => {
7426
- },
7439
+ resolve: () => {},
7440
+ reject: () => {},
7427
7441
  isResolving: false,
7428
7442
  options
7429
7443
  });
@@ -7846,12 +7860,10 @@ function isTypedCharValid({
7846
7860
  }) {
7847
7861
  if (metaKey || ctrlKey || altKey)
7848
7862
  return false;
7849
- if (keyCode >= 48 && keyCode <= 57)
7863
+ if (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105)
7850
7864
  return true;
7851
7865
  if (keyCode >= 65 && keyCode <= 90)
7852
7866
  return true;
7853
- if (keyCode >= 97 && keyCode <= 122)
7854
- return true;
7855
7867
  return false;
7856
7868
  }
7857
7869
  function onStartTyping(callback, options = {}) {
@@ -7866,8 +7878,7 @@ function onStartTyping(callback, options = {}) {
7866
7878
  }
7867
7879
  function templateRef(key, initialValue = null) {
7868
7880
  const instance = getCurrentInstance();
7869
- let _trigger = () => {
7870
- };
7881
+ let _trigger = () => {};
7871
7882
  const element = customRef((track2, trigger2) => {
7872
7883
  _trigger = trigger2;
7873
7884
  return {
@@ -7876,8 +7887,7 @@ function templateRef(key, initialValue = null) {
7876
7887
  track2();
7877
7888
  return (_b = (_a = instance == null ? undefined : instance.proxy) == null ? undefined : _a.$refs[key]) != null ? _b : initialValue;
7878
7889
  },
7879
- set() {
7880
- }
7890
+ set() {}
7881
7891
  };
7882
7892
  });
7883
7893
  tryOnMounted(_trigger);
@@ -7901,7 +7911,7 @@ function useActiveElement(options = {}) {
7901
7911
  }
7902
7912
  return element;
7903
7913
  };
7904
- const activeElement = ref();
7914
+ const activeElement = shallowRef();
7905
7915
  const trigger2 = () => {
7906
7916
  activeElement.value = getDeepActiveElement();
7907
7917
  };
@@ -8115,10 +8125,12 @@ function useAnimate(target, keyframes, options) {
8115
8125
  }
8116
8126
  });
8117
8127
  watch2(() => keyframes, (value) => {
8118
- if (animate.value)
8128
+ if (animate.value) {
8119
8129
  update();
8120
- if (!unrefElement(target) && animate.value) {
8121
- animate.value.effect = new KeyframeEffect(unrefElement(target), toValue(value), animateOptions);
8130
+ const targetEl = unrefElement(target);
8131
+ if (targetEl) {
8132
+ animate.value.effect = new KeyframeEffect(targetEl, toValue(value), animateOptions);
8133
+ }
8122
8134
  }
8123
8135
  }, { deep: true });
8124
8136
  tryOnMounted(() => update(true), false);
@@ -8518,7 +8530,7 @@ function useSSRWidth() {
8518
8530
  function useMediaQuery(query, options = {}) {
8519
8531
  const { window: window2 = defaultWindow, ssrWidth = useSSRWidth() } = options;
8520
8532
  const isSupported = useSupported(() => window2 && ("matchMedia" in window2) && typeof window2.matchMedia === "function");
8521
- const ssrSupport = ref(typeof ssrWidth === "number");
8533
+ const ssrSupport = shallowRef(typeof ssrWidth === "number");
8522
8534
  const mediaQuery = shallowRef();
8523
8535
  const matches = shallowRef(false);
8524
8536
  const handler = (event) => {
@@ -8777,8 +8789,9 @@ function useBrowserLocation(options = {}) {
8777
8789
  }
8778
8790
  return state;
8779
8791
  }
8780
- function useCached(refValue, comparator = (a, b) => a === b, watchOptions) {
8781
- const cachedValue = ref(refValue.value);
8792
+ function useCached(refValue, comparator = (a, b) => a === b, options) {
8793
+ const { deepRefs = true, ...watchOptions } = options || {};
8794
+ const cachedValue = createRef2(refValue.value, deepRefs);
8782
8795
  watch2(() => refValue.value, (value) => {
8783
8796
  if (!comparator(value, cachedValue.value))
8784
8797
  cachedValue.value = value;
@@ -8840,13 +8853,11 @@ function useClipboard(options = {}) {
8840
8853
  const text = shallowRef("");
8841
8854
  const copied = shallowRef(false);
8842
8855
  const timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });
8843
- function updateText() {
8856
+ async function updateText() {
8844
8857
  let useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value));
8845
8858
  if (!useLegacy) {
8846
8859
  try {
8847
- navigator2.clipboard.readText().then((value) => {
8848
- text.value = value;
8849
- });
8860
+ text.value = await navigator2.clipboard.readText();
8850
8861
  } catch (e) {
8851
8862
  useLegacy = true;
8852
8863
  }
@@ -8938,7 +8949,7 @@ function cloneFnJSON(source) {
8938
8949
  }
8939
8950
  function useCloned(source, options = {}) {
8940
8951
  const cloned = ref({});
8941
- const isModified = ref(false);
8952
+ const isModified = shallowRef(false);
8942
8953
  let _lastSync = false;
8943
8954
  const {
8944
8955
  manual,
@@ -9294,7 +9305,7 @@ function useCssVar(prop, target, options = {}) {
9294
9305
  if (old[0] && old[1])
9295
9306
  old[0].style.removeProperty(old[1]);
9296
9307
  updateCssVar();
9297
- });
9308
+ }, { immediate: true });
9298
9309
  watch2([variable, elRef], ([val, el]) => {
9299
9310
  const raw_prop = toValue(prop);
9300
9311
  if ((el == null ? undefined : el.style) && raw_prop) {
@@ -9676,11 +9687,12 @@ function useDevicesList(options = {}) {
9676
9687
  }
9677
9688
  }
9678
9689
  async function ensurePermissions() {
9690
+ const deviceName = constraints.video ? "camera" : "microphone";
9679
9691
  if (!isSupported.value)
9680
9692
  return false;
9681
9693
  if (permissionGranted.value)
9682
9694
  return true;
9683
- const { state, query } = usePermission("camera", { controls: true });
9695
+ const { state, query } = usePermission(deviceName, { controls: true });
9684
9696
  await query();
9685
9697
  if (state.value !== "granted") {
9686
9698
  let granted = true;
@@ -9766,7 +9778,7 @@ function useDocumentVisibility(options = {}) {
9766
9778
  const { document: document2 = defaultDocument } = options;
9767
9779
  if (!document2)
9768
9780
  return shallowRef("visible");
9769
- const visibility = ref(document2.visibilityState);
9781
+ const visibility = shallowRef(document2.visibilityState);
9770
9782
  useEventListener(document2, "visibilitychange", () => {
9771
9783
  visibility.value = document2.visibilityState;
9772
9784
  }, { passive: true });
@@ -10080,7 +10092,7 @@ function useElementByPoint(options) {
10080
10092
  return document2 && "elementsFromPoint" in document2;
10081
10093
  return document2 && "elementFromPoint" in document2;
10082
10094
  });
10083
- const element = ref(null);
10095
+ const element = shallowRef(null);
10084
10096
  const cb = () => {
10085
10097
  var _a, _b;
10086
10098
  element.value = toValue(multiple) ? (_a = document2 == null ? undefined : document2.elementsFromPoint(toValue(x), toValue(y))) != null ? _a : [] : (_b = document2 == null ? undefined : document2.elementFromPoint(toValue(x), toValue(y))) != null ? _b : null;
@@ -10127,8 +10139,8 @@ function useElementSize(target, initialSize = { width: 0, height: 0 }, options =
10127
10139
  var _a, _b;
10128
10140
  return (_b = (_a = unrefElement(target)) == null ? undefined : _a.namespaceURI) == null ? undefined : _b.includes("svg");
10129
10141
  });
10130
- const width = ref(initialSize.width);
10131
- const height = ref(initialSize.height);
10142
+ const width = shallowRef(initialSize.width);
10143
+ const height = shallowRef(initialSize.height);
10132
10144
  const { stop: stop1 } = useResizeObserver(target, ([entry]) => {
10133
10145
  const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
10134
10146
  if (window2 && isSVG.value) {
@@ -10184,7 +10196,7 @@ function useIntersectionObserver(target, callback, options = {}) {
10184
10196
  return toArray(_target).map(unrefElement).filter(notNullish2);
10185
10197
  });
10186
10198
  let cleanup = noop;
10187
- const isActive = ref(immediate);
10199
+ const isActive = shallowRef(immediate);
10188
10200
  const stopWatch = isSupported.value ? watch2(() => [targets.value, unrefElement(root), isActive.value], ([targets2, root2]) => {
10189
10201
  cleanup();
10190
10202
  if (!isActive.value)
@@ -10295,8 +10307,8 @@ function resolveNestedOptions$1(options) {
10295
10307
  return options;
10296
10308
  }
10297
10309
  function useEventSource(url, events2 = [], options = {}) {
10298
- const event = ref(null);
10299
- const data = ref(null);
10310
+ const event = shallowRef(null);
10311
+ const data = shallowRef(null);
10300
10312
  const status = shallowRef("CONNECTING");
10301
10313
  const eventSource = ref(null);
10302
10314
  const error = shallowRef(null);
@@ -10545,7 +10557,7 @@ function useFetch(url, ...args) {
10545
10557
  const isFinished = shallowRef(false);
10546
10558
  const isFetching = shallowRef(false);
10547
10559
  const aborted = shallowRef(false);
10548
- const statusCode = ref(null);
10560
+ const statusCode = shallowRef(null);
10549
10561
  const response = shallowRef(null);
10550
10562
  const error = shallowRef(null);
10551
10563
  const data = shallowRef(initialData || null);
@@ -11222,7 +11234,7 @@ function useGeolocation(options = {}) {
11222
11234
  immediate = true
11223
11235
  } = options;
11224
11236
  const isSupported = useSupported(() => navigator2 && ("geolocation" in navigator2));
11225
- const locatedAt = ref(null);
11237
+ const locatedAt = shallowRef(null);
11226
11238
  const error = shallowRef(null);
11227
11239
  const coords = ref({
11228
11240
  accuracy: 0,
@@ -11448,8 +11460,8 @@ function useScroll(element, options = {}) {
11448
11460
  const scrollLeft = el.scrollLeft;
11449
11461
  directions.left = scrollLeft < internalX.value;
11450
11462
  directions.right = scrollLeft > internalX.value;
11451
- const left = scrollLeft * directionMultipler <= (offset2.left || 0);
11452
- const right = scrollLeft * directionMultipler + el.clientWidth >= el.scrollWidth - (offset2.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
11463
+ const left = Math.abs(scrollLeft * directionMultipler) <= (offset2.left || 0);
11464
+ const right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset2.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
11453
11465
  if (display === "flex" && flexDirection === "row-reverse") {
11454
11466
  arrivedState.left = right;
11455
11467
  arrivedState.right = left;
@@ -11463,8 +11475,8 @@ function useScroll(element, options = {}) {
11463
11475
  scrollTop = window2.document.body.scrollTop;
11464
11476
  directions.top = scrollTop < internalY.value;
11465
11477
  directions.bottom = scrollTop > internalY.value;
11466
- const top = scrollTop <= (offset2.top || 0);
11467
- const bottom = scrollTop + el.clientHeight >= el.scrollHeight - (offset2.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
11478
+ const top = Math.abs(scrollTop) <= (offset2.top || 0);
11479
+ const bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset2.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
11468
11480
  if (display === "flex" && flexDirection === "column-reverse") {
11469
11481
  arrivedState.top = bottom;
11470
11482
  arrivedState.bottom = top;
@@ -11563,7 +11575,7 @@ function useKeyModifier(modifier, options = {}) {
11563
11575
  document: document2 = defaultDocument,
11564
11576
  initial = null
11565
11577
  } = options;
11566
- const state = ref(initial);
11578
+ const state = shallowRef(initial);
11567
11579
  if (document2) {
11568
11580
  events2.forEach((listenerEvent) => {
11569
11581
  useEventListener(document2, listenerEvent, (evt) => {
@@ -12030,7 +12042,7 @@ function useMouseInElement(target, options = {}) {
12030
12042
  } = options;
12031
12043
  const type = options.type || "page";
12032
12044
  const { x, y, sourceType } = useMouse(options);
12033
- const targetRef = ref(target != null ? target : window2 == null ? undefined : window2.document.body);
12045
+ const targetRef = shallowRef(target != null ? target : window2 == null ? undefined : window2.document.body);
12034
12046
  const elementX = shallowRef(0);
12035
12047
  const elementY = shallowRef(0);
12036
12048
  const elementPositionX = shallowRef(0);
@@ -12038,8 +12050,7 @@ function useMouseInElement(target, options = {}) {
12038
12050
  const elementHeight = shallowRef(0);
12039
12051
  const elementWidth = shallowRef(0);
12040
12052
  const isOutside = shallowRef(true);
12041
- let stop2 = () => {
12042
- };
12053
+ let stop2 = () => {};
12043
12054
  if (window2) {
12044
12055
  stop2 = watch2([targetRef, x, y], () => {
12045
12056
  const el = unrefElement(targetRef);
@@ -12087,8 +12098,8 @@ function useMousePressed(options = {}) {
12087
12098
  initialValue = false,
12088
12099
  window: window2 = defaultWindow
12089
12100
  } = options;
12090
- const pressed = ref(initialValue);
12091
- const sourceType = ref(null);
12101
+ const pressed = shallowRef(initialValue);
12102
+ const sourceType = shallowRef(null);
12092
12103
  if (!window2) {
12093
12104
  return {
12094
12105
  pressed,
@@ -12131,7 +12142,7 @@ function useNavigatorLanguage(options = {}) {
12131
12142
  const { window: window2 = defaultWindow } = options;
12132
12143
  const navigator2 = window2 == null ? undefined : window2.navigator;
12133
12144
  const isSupported = useSupported(() => navigator2 && ("language" in navigator2));
12134
- const language = ref(navigator2 == null ? undefined : navigator2.language);
12145
+ const language = shallowRef(navigator2 == null ? undefined : navigator2.language);
12135
12146
  useEventListener(window2, "languagechange", () => {
12136
12147
  if (navigator2)
12137
12148
  language.value = navigator2.language;
@@ -12147,13 +12158,13 @@ function useNetwork(options = {}) {
12147
12158
  const isSupported = useSupported(() => navigator2 && ("connection" in navigator2));
12148
12159
  const isOnline = shallowRef(true);
12149
12160
  const saveData = shallowRef(false);
12150
- const offlineAt = ref(undefined);
12151
- const onlineAt = ref(undefined);
12152
- const downlink = ref(undefined);
12153
- const downlinkMax = ref(undefined);
12154
- const rtt = ref(undefined);
12155
- const effectiveType = ref(undefined);
12156
- const type = ref("unknown");
12161
+ const offlineAt = shallowRef(undefined);
12162
+ const onlineAt = shallowRef(undefined);
12163
+ const downlink = shallowRef(undefined);
12164
+ const downlinkMax = shallowRef(undefined);
12165
+ const rtt = shallowRef(undefined);
12166
+ const effectiveType = shallowRef(undefined);
12167
+ const type = shallowRef("unknown");
12157
12168
  const connection = isSupported.value && navigator2.connection;
12158
12169
  function updateNetworkInformation() {
12159
12170
  if (!navigator2)
@@ -12215,7 +12226,7 @@ function useNow2(options = {}) {
12215
12226
  }
12216
12227
  }
12217
12228
  function useObjectUrl(object) {
12218
- const url = ref();
12229
+ const url = shallowRef();
12219
12230
  const release = () => {
12220
12231
  if (url.value)
12221
12232
  URL.revokeObjectURL(url.value);
@@ -12321,7 +12332,7 @@ function useScreenOrientation(options = {}) {
12321
12332
  const isSupported = useSupported(() => window2 && ("screen" in window2) && ("orientation" in window2.screen));
12322
12333
  const screenOrientation = isSupported.value ? window2.screen.orientation : {};
12323
12334
  const orientation = ref(screenOrientation.type);
12324
- const angle = ref(screenOrientation.angle || 0);
12335
+ const angle = shallowRef(screenOrientation.angle || 0);
12325
12336
  if (isSupported.value) {
12326
12337
  useEventListener(window2, "orientationchange", () => {
12327
12338
  orientation.value = screenOrientation.type;
@@ -12496,8 +12507,8 @@ function usePointer(options = {}) {
12496
12507
  function usePointerLock(target, options = {}) {
12497
12508
  const { document: document2 = defaultDocument } = options;
12498
12509
  const isSupported = useSupported(() => document2 && ("pointerLockElement" in document2));
12499
- const element = ref();
12500
- const triggerElement = ref();
12510
+ const element = shallowRef();
12511
+ const triggerElement = shallowRef();
12501
12512
  let targetElement;
12502
12513
  if (isSupported.value) {
12503
12514
  const listenerOptions = { passive: true };
@@ -12741,7 +12752,7 @@ function useScriptTag(src, onLoaded = noop, options = {}) {
12741
12752
  document: document2 = defaultDocument,
12742
12753
  attrs = {}
12743
12754
  } = options;
12744
- const scriptTag = ref(null);
12755
+ const scriptTag = shallowRef(null);
12745
12756
  let _promise = null;
12746
12757
  const loadScript3 = (waitForScriptLoad) => new Promise((resolve, reject) => {
12747
12758
  const resolveWithElement = (el2) => {
@@ -12833,7 +12844,7 @@ function preventDefault(rawEvent) {
12833
12844
  }
12834
12845
  var elInitialOverflow = /* @__PURE__ */ new WeakMap;
12835
12846
  function useScrollLock(element, initialState = false) {
12836
- const isLocked = ref(initialState);
12847
+ const isLocked = shallowRef(initialState);
12837
12848
  let stopTouchMoveListener = null;
12838
12849
  let initialOverflow = "";
12839
12850
  watch2(toRef2(element), (el) => {
@@ -13036,7 +13047,7 @@ function useSpeechSynthesis(text, options = {}) {
13036
13047
  const synth = window2 && window2.speechSynthesis;
13037
13048
  const isSupported = useSupported(() => synth);
13038
13049
  const isPlaying = shallowRef(false);
13039
- const status = ref("init");
13050
+ const status = shallowRef("init");
13040
13051
  const spokenText = toRef2(text || "");
13041
13052
  const lang = toRef2(options.lang || "en-US");
13042
13053
  const error = shallowRef(undefined);
@@ -13275,8 +13286,7 @@ function useStyleTag(css, options = {}) {
13275
13286
  id = `vueuse_styletag_${++_id}`
13276
13287
  } = options;
13277
13288
  const cssRef = shallowRef(css);
13278
- let stop2 = () => {
13279
- };
13289
+ let stop2 = () => {};
13280
13290
  const load = () => {
13281
13291
  if (!document2)
13282
13292
  return;
@@ -13889,8 +13899,8 @@ function useUrlSearchParams(mode = "history", options = {}) {
13889
13899
  }
13890
13900
  function useUserMedia(options = {}) {
13891
13901
  var _a, _b;
13892
- const enabled = ref((_a = options.enabled) != null ? _a : false);
13893
- const autoSwitch = ref((_b = options.autoSwitch) != null ? _b : true);
13902
+ const enabled = shallowRef((_a = options.enabled) != null ? _a : false);
13903
+ const autoSwitch = shallowRef((_b = options.autoSwitch) != null ? _b : true);
13894
13904
  const constraints = ref(options.constraints);
13895
13905
  const { navigator: navigator2 = defaultNavigator } = options;
13896
13906
  const isSupported = useSupported(() => {
@@ -14235,7 +14245,7 @@ function useWakeLock(options = {}) {
14235
14245
  navigator: navigator2 = defaultNavigator,
14236
14246
  document: document2 = defaultDocument
14237
14247
  } = options;
14238
- const requestedType = ref(false);
14248
+ const requestedType = shallowRef(false);
14239
14249
  const sentinel = shallowRef(null);
14240
14250
  const documentVisibility = useDocumentVisibility({ document: document2 });
14241
14251
  const isSupported = useSupported(() => navigator2 && ("wakeLock" in navigator2));
@@ -14298,7 +14308,7 @@ function useWebNotification(options = {}) {
14298
14308
  }
14299
14309
  return true;
14300
14310
  });
14301
- const permissionGranted = ref(isSupported.value && "permission" in Notification && Notification.permission === "granted");
14311
+ const permissionGranted = shallowRef(isSupported.value && "permission" in Notification && Notification.permission === "granted");
14302
14312
  const notification = ref(null);
14303
14313
  const ensurePermissions = async () => {
14304
14314
  if (!isSupported.value)
@@ -14373,7 +14383,7 @@ function useWebSocket(url, options = {}) {
14373
14383
  protocols = []
14374
14384
  } = options;
14375
14385
  const data = ref(null);
14376
- const status = ref("CLOSED");
14386
+ const status = shallowRef("CLOSED");
14377
14387
  const wsRef = ref();
14378
14388
  const urlRef = toRef2(url);
14379
14389
  let heartbeatPause;
@@ -14435,6 +14445,8 @@ function useWebSocket(url, options = {}) {
14435
14445
  };
14436
14446
  ws.onclose = (ev) => {
14437
14447
  status.value = "CLOSED";
14448
+ resetHeartbeat();
14449
+ heartbeatPause == null || heartbeatPause();
14438
14450
  onDisconnected == null || onDisconnected(ws, ev);
14439
14451
  if (!explicitlyClosed && options.autoReconnect && (wsRef.value == null || ws === wsRef.value)) {
14440
14452
  const {
@@ -14442,11 +14454,10 @@ function useWebSocket(url, options = {}) {
14442
14454
  delay: delay2 = 1000,
14443
14455
  onFailed
14444
14456
  } = resolveNestedOptions(options.autoReconnect);
14445
- if (typeof retries === "number" && (retries < 0 || retried < retries)) {
14457
+ const checkRetires = typeof retries === "function" ? retries : () => typeof retries === "number" && (retries < 0 || retried < retries);
14458
+ if (checkRetires(retried)) {
14446
14459
  retried += 1;
14447
14460
  retryTimeout = setTimeout(_init, delay2);
14448
- } else if (typeof retries === "function" && retries()) {
14449
- retryTimeout = setTimeout(_init, delay2);
14450
14461
  } else {
14451
14462
  onFailed == null || onFailed();
14452
14463
  }
@@ -14591,9 +14602,9 @@ function useWebWorkerFn(fn, options = {}) {
14591
14602
  window: window2 = defaultWindow
14592
14603
  } = options;
14593
14604
  const worker = ref();
14594
- const workerStatus = ref("PENDING");
14605
+ const workerStatus = shallowRef("PENDING");
14595
14606
  const promise = ref({});
14596
- const timeoutId = ref();
14607
+ const timeoutId = shallowRef();
14597
14608
  const workerTerminate = (status = "PENDING") => {
14598
14609
  if (worker.value && worker.value._url && window2) {
14599
14610
  worker.value.terminate();
@@ -14611,9 +14622,7 @@ function useWebWorkerFn(fn, options = {}) {
14611
14622
  const newWorker = new Worker(blobUrl);
14612
14623
  newWorker._url = blobUrl;
14613
14624
  newWorker.onmessage = (e) => {
14614
- const { resolve = () => {
14615
- }, reject = () => {
14616
- } } = promise.value;
14625
+ const { resolve = () => {}, reject = () => {} } = promise.value;
14617
14626
  const [status, result] = e.data;
14618
14627
  switch (status) {
14619
14628
  case "SUCCESS":
@@ -14627,8 +14636,7 @@ function useWebWorkerFn(fn, options = {}) {
14627
14636
  }
14628
14637
  };
14629
14638
  newWorker.onerror = (e) => {
14630
- const { reject = () => {
14631
- } } = promise.value;
14639
+ const { reject = () => {} } = promise.value;
14632
14640
  e.preventDefault();
14633
14641
  reject(e);
14634
14642
  workerTerminate("ERROR");
@@ -14665,7 +14673,7 @@ function useWindowFocus(options = {}) {
14665
14673
  const { window: window2 = defaultWindow } = options;
14666
14674
  if (!window2)
14667
14675
  return shallowRef(false);
14668
- const focused = ref(window2.document.hasFocus());
14676
+ const focused = shallowRef(window2.document.hasFocus());
14669
14677
  const listenerOptions = { passive: true };
14670
14678
  useEventListener(window2, "blur", () => {
14671
14679
  focused.value = false;
@@ -14688,8 +14696,8 @@ function useWindowSize(options = {}) {
14688
14696
  includeScrollbar = true,
14689
14697
  type = "inner"
14690
14698
  } = options;
14691
- const width = ref(initialWidth);
14692
- const height = ref(initialHeight);
14699
+ const width = shallowRef(initialWidth);
14700
+ const height = shallowRef(initialHeight);
14693
14701
  const update = () => {
14694
14702
  if (window2) {
14695
14703
  if (type === "outer") {
@@ -14721,7 +14729,9 @@ function useWindowSize(options = {}) {
14721
14729
  }
14722
14730
  return { width, height };
14723
14731
  }
14724
- // ../../../../node_modules/@vueuse/head/node_modules/@unhead/dom/node_modules/@unhead/shared/dist/index.mjs
14732
+ // ../../../../node_modules/@unhead/shared/dist/index.mjs
14733
+ var SelfClosingTags = /* @__PURE__ */ new Set(["meta", "link", "base"]);
14734
+ var TagsWithInnerContent = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]);
14725
14735
  var HasElementTags = /* @__PURE__ */ new Set([
14726
14736
  "base",
14727
14737
  "meta",
@@ -14903,7 +14913,7 @@ function tagDedupeKey(tag) {
14903
14913
  var sepSub = "%separator";
14904
14914
  var sepSubRe = new RegExp(`${sepSub}(?:\\s*${sepSub})*`, "g");
14905
14915
 
14906
- // ../../../../node_modules/@vueuse/head/node_modules/@unhead/dom/dist/index.mjs
14916
+ // ../../../../node_modules/@unhead/dom/dist/index.mjs
14907
14917
  async function renderDOMHead(head, options = {}) {
14908
14918
  const dom = options.document || head.resolvedOptions.document;
14909
14919
  if (!dom || !head.dirty)
@@ -15090,7 +15100,7 @@ function DomPlugin(options) {
15090
15100
  }
15091
15101
 
15092
15102
  // ../../../../node_modules/@vueuse/head/node_modules/@unhead/vue/node_modules/@unhead/shared/dist/index.mjs
15093
- var TagsWithInnerContent = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]);
15103
+ var TagsWithInnerContent2 = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]);
15094
15104
  var HasElementTags2 = /* @__PURE__ */ new Set([
15095
15105
  "base",
15096
15106
  "meta",
@@ -15250,7 +15260,7 @@ function normaliseTag(tagName, input, e, normalizedProps) {
15250
15260
  for (const k3 of TagConfigKeys2) {
15251
15261
  const val = tag.props[k3] !== undefined ? tag.props[k3] : e[k3];
15252
15262
  if (val !== undefined) {
15253
- if (!(k3 === "innerHTML" || k3 === "textContent" || k3 === "children") || TagsWithInnerContent.has(tag.tag)) {
15263
+ if (!(k3 === "innerHTML" || k3 === "textContent" || k3 === "children") || TagsWithInnerContent2.has(tag.tag)) {
15254
15264
  tag[k3 === "children" ? "innerHTML" : k3] = val;
15255
15265
  }
15256
15266
  delete tag.props[k3];
@@ -15431,8 +15441,7 @@ function processTemplateParams(s, p3, sep, isJson = false) {
15431
15441
  let decoded = s;
15432
15442
  try {
15433
15443
  decoded = decodeURI(s);
15434
- } catch {
15435
- }
15444
+ } catch {}
15436
15445
  const tokens2 = decoded.match(/%\w+(?:\.\w+)?/g);
15437
15446
  if (!tokens2) {
15438
15447
  return s;
@@ -15507,8 +15516,7 @@ class Hookable {
15507
15516
  }
15508
15517
  hook(name, function_, options = {}) {
15509
15518
  if (!name || typeof function_ !== "function") {
15510
- return () => {
15511
- };
15519
+ return () => {};
15512
15520
  }
15513
15521
  const originalName = name;
15514
15522
  let dep;
@@ -15535,8 +15543,7 @@ class Hookable {
15535
15543
  get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
15536
15544
  configurable: true
15537
15545
  });
15538
- } catch {
15539
- }
15546
+ } catch {}
15540
15547
  }
15541
15548
  this._hooks[name] = this._hooks[name] || [];
15542
15549
  this._hooks[name].push(function_);
@@ -16064,8 +16071,7 @@ function getActiveHead() {
16064
16071
  return activeHead;
16065
16072
  }
16066
16073
  var ScriptProxyTarget = Symbol("ScriptProxyTarget");
16067
- function scriptProxy() {
16068
- }
16074
+ function scriptProxy() {}
16069
16075
  scriptProxy[ScriptProxyTarget] = true;
16070
16076
 
16071
16077
  // ../../../../node_modules/@vueuse/head/node_modules/@unhead/vue/dist/shared/vue.ziyDaVMR.mjs
@@ -16207,11 +16213,9 @@ function polyfillAsVueUseHead(head) {
16207
16213
  const api = useHead(input, options);
16208
16214
  if (api !== undefined)
16209
16215
  return api.dispose;
16210
- return () => {
16211
- };
16212
- };
16213
- polyfilled.removeHeadObjs = () => {
16216
+ return () => {};
16214
16217
  };
16218
+ polyfilled.removeHeadObjs = () => {};
16215
16219
  polyfilled.updateDOM = () => {
16216
16220
  head.hooks.callHook("entries:updated", head);
16217
16221
  };
@@ -16219,98 +16223,6 @@ function polyfillAsVueUseHead(head) {
16219
16223
  return polyfilled;
16220
16224
  }
16221
16225
 
16222
- // ../../../../node_modules/@unhead/ssr/node_modules/@unhead/shared/dist/index.mjs
16223
- var SelfClosingTags = /* @__PURE__ */ new Set(["meta", "link", "base"]);
16224
- var TagsWithInnerContent2 = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]);
16225
- var p3 = (p22) => ({ keyValue: p22, metaKey: "property" });
16226
- var k3 = (p22) => ({ keyValue: p22 });
16227
- var MetaPackingSchema3 = {
16228
- appleItunesApp: {
16229
- unpack: {
16230
- entrySeparator: ", ",
16231
- resolve({ key, value }) {
16232
- return `${fixKeyCase3(key)}=${value}`;
16233
- }
16234
- }
16235
- },
16236
- articleExpirationTime: p3("article:expiration_time"),
16237
- articleModifiedTime: p3("article:modified_time"),
16238
- articlePublishedTime: p3("article:published_time"),
16239
- bookReleaseDate: p3("book:release_date"),
16240
- charset: {
16241
- metaKey: "charset"
16242
- },
16243
- contentSecurityPolicy: {
16244
- unpack: {
16245
- entrySeparator: "; ",
16246
- resolve({ key, value }) {
16247
- return `${fixKeyCase3(key)} ${value}`;
16248
- }
16249
- },
16250
- metaKey: "http-equiv"
16251
- },
16252
- contentType: {
16253
- metaKey: "http-equiv"
16254
- },
16255
- defaultStyle: {
16256
- metaKey: "http-equiv"
16257
- },
16258
- fbAppId: p3("fb:app_id"),
16259
- msapplicationConfig: k3("msapplication-Config"),
16260
- msapplicationTileColor: k3("msapplication-TileColor"),
16261
- msapplicationTileImage: k3("msapplication-TileImage"),
16262
- ogAudioSecureUrl: p3("og:audio:secure_url"),
16263
- ogAudioUrl: p3("og:audio"),
16264
- ogImageSecureUrl: p3("og:image:secure_url"),
16265
- ogImageUrl: p3("og:image"),
16266
- ogSiteName: p3("og:site_name"),
16267
- ogVideoSecureUrl: p3("og:video:secure_url"),
16268
- ogVideoUrl: p3("og:video"),
16269
- profileFirstName: p3("profile:first_name"),
16270
- profileLastName: p3("profile:last_name"),
16271
- profileUsername: p3("profile:username"),
16272
- refresh: {
16273
- metaKey: "http-equiv",
16274
- unpack: {
16275
- entrySeparator: ";",
16276
- resolve({ key, value }) {
16277
- if (key === "seconds")
16278
- return `${value}`;
16279
- }
16280
- }
16281
- },
16282
- robots: {
16283
- unpack: {
16284
- entrySeparator: ", ",
16285
- resolve({ key, value }) {
16286
- if (typeof value === "boolean")
16287
- return `${fixKeyCase3(key)}`;
16288
- else
16289
- return `${fixKeyCase3(key)}:${value}`;
16290
- }
16291
- }
16292
- },
16293
- xUaCompatible: {
16294
- metaKey: "http-equiv"
16295
- }
16296
- };
16297
- var openGraphNamespaces3 = /* @__PURE__ */ new Set([
16298
- "og",
16299
- "book",
16300
- "article",
16301
- "profile"
16302
- ]);
16303
- function fixKeyCase3(key) {
16304
- const updated = key.replace(/([A-Z])/g, "-$1").toLowerCase();
16305
- const prefixIndex = updated.indexOf("-");
16306
- const fKey = updated.substring(0, prefixIndex);
16307
- if (fKey === "twitter" || openGraphNamespaces3.has(fKey))
16308
- return key.replace(/([A-Z])/g, ":$1").toLowerCase();
16309
- return updated;
16310
- }
16311
- var sepSub3 = "%separator";
16312
- var sepSubRe3 = new RegExp(`${sepSub3}(?:\\s*${sepSub3})*`, "g");
16313
-
16314
16226
  // ../../../../node_modules/@unhead/ssr/dist/index.mjs
16315
16227
  function encodeAttribute(value) {
16316
16228
  return String(value).replace(/"/g, "&quot;");
@@ -16375,7 +16287,7 @@ function escapeHtml(str) {
16375
16287
  function tagToString(tag) {
16376
16288
  const attrs = propsToString(tag.props);
16377
16289
  const openTag = `<${tag.tag}${attrs}>`;
16378
- if (!TagsWithInnerContent2.has(tag.tag))
16290
+ if (!TagsWithInnerContent.has(tag.tag))
16379
16291
  return SelfClosingTags.has(tag.tag) ? openTag : `${openTag}</${tag.tag}>`;
16380
16292
  let content = String(tag.innerHTML || "");
16381
16293
  if (tag.textContent)
package/dist/retry.d.ts CHANGED
@@ -1,2 +1,8 @@
1
- export declare function retry(fn: Function, options: any): Promise<any>;
1
+ export declare interface RetryOptions {
2
+ retries?: number
3
+ initialDelay?: number
4
+ backoffFactor?: number
5
+ jitter?: boolean
6
+ }
7
+ export declare function retry<T>(fn: ()): Promise<T>;
2
8
  export declare function calculateDelay(attemptCount: number, initialDelay: number, backoffFactor: number, jitter?: boolean): number;
@@ -1 +1 @@
1
- export declare function throttle(fn: Function, wait): void;
1
+ export declare function throttle<T extends (...args: any[]) =>(fn: T, wait): (...args: Parameters<T>) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/browser",
3
3
  "type": "module",
4
- "version": "0.69.3",
4
+ "version": "0.70.0",
5
5
  "description": "Stacks core frontend/browser functionalities.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": ["Chris Breuer <chris@stacksjs.org>"],
@@ -34,7 +34,7 @@
34
34
  "prepublishOnly": "bun run build"
35
35
  },
36
36
  "devDependencies": {
37
- "@stacksjs/development": "0.69.2",
38
- "@stacksjs/utils": "0.69.2"
37
+ "@stacksjs/development": "0.70.0",
38
+ "@stacksjs/utils": "0.70.0"
39
39
  }
40
40
  }