@rpcbase/client 0.401.0 → 0.403.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
@@ -8,6 +8,7 @@ import { r as reportClientException } from "./errorReporting-CVoUUKxW.js";
8
8
  import { s } from "./errorReporting-CVoUUKxW.js";
9
9
  import { n as hydrateRtsFromWindow, w as useQuery } from "./useQuery-XvXbEwG_.js";
10
10
  import { R, S, p, q, t, v } from "./useQuery-XvXbEwG_.js";
11
+ import { r as requireToString, g as getDefaultExportFromCjs, t as throttle$1 } from "./throttle-CXOc9Dto.js";
11
12
  const emptyUnsubscribe = () => {
12
13
  };
13
14
  const useMediaQuery = (query) => {
@@ -983,10 +984,6 @@ if (!isProduction && !env.SSR && isDesktopDevice() && !isPlaywrightTestEnvironme
983
984
  });
984
985
  });
985
986
  }
986
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
987
- function getDefaultExportFromCjs(x) {
988
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
989
- }
990
987
  var _arrayReduce;
991
988
  var hasRequired_arrayReduce;
992
989
  function require_arrayReduce() {
@@ -1222,179 +1219,6 @@ function require_deburrLetter() {
1222
1219
  _deburrLetter = deburrLetter;
1223
1220
  return _deburrLetter;
1224
1221
  }
1225
- var _freeGlobal;
1226
- var hasRequired_freeGlobal;
1227
- function require_freeGlobal() {
1228
- if (hasRequired_freeGlobal) return _freeGlobal;
1229
- hasRequired_freeGlobal = 1;
1230
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1231
- _freeGlobal = freeGlobal;
1232
- return _freeGlobal;
1233
- }
1234
- var _root;
1235
- var hasRequired_root;
1236
- function require_root() {
1237
- if (hasRequired_root) return _root;
1238
- hasRequired_root = 1;
1239
- var freeGlobal = require_freeGlobal();
1240
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
1241
- var root = freeGlobal || freeSelf || Function("return this")();
1242
- _root = root;
1243
- return _root;
1244
- }
1245
- var _Symbol;
1246
- var hasRequired_Symbol;
1247
- function require_Symbol() {
1248
- if (hasRequired_Symbol) return _Symbol;
1249
- hasRequired_Symbol = 1;
1250
- var root = require_root();
1251
- var Symbol2 = root.Symbol;
1252
- _Symbol = Symbol2;
1253
- return _Symbol;
1254
- }
1255
- var _arrayMap;
1256
- var hasRequired_arrayMap;
1257
- function require_arrayMap() {
1258
- if (hasRequired_arrayMap) return _arrayMap;
1259
- hasRequired_arrayMap = 1;
1260
- function arrayMap(array, iteratee) {
1261
- var index = -1, length = array == null ? 0 : array.length, result = Array(length);
1262
- while (++index < length) {
1263
- result[index] = iteratee(array[index], index, array);
1264
- }
1265
- return result;
1266
- }
1267
- _arrayMap = arrayMap;
1268
- return _arrayMap;
1269
- }
1270
- var isArray_1;
1271
- var hasRequiredIsArray;
1272
- function requireIsArray() {
1273
- if (hasRequiredIsArray) return isArray_1;
1274
- hasRequiredIsArray = 1;
1275
- var isArray = Array.isArray;
1276
- isArray_1 = isArray;
1277
- return isArray_1;
1278
- }
1279
- var _getRawTag;
1280
- var hasRequired_getRawTag;
1281
- function require_getRawTag() {
1282
- if (hasRequired_getRawTag) return _getRawTag;
1283
- hasRequired_getRawTag = 1;
1284
- var Symbol2 = require_Symbol();
1285
- var objectProto = Object.prototype;
1286
- var hasOwnProperty2 = objectProto.hasOwnProperty;
1287
- var nativeObjectToString = objectProto.toString;
1288
- var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
1289
- function getRawTag(value) {
1290
- var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag];
1291
- try {
1292
- value[symToStringTag] = void 0;
1293
- var unmasked = true;
1294
- } catch (e) {
1295
- }
1296
- var result = nativeObjectToString.call(value);
1297
- if (unmasked) {
1298
- if (isOwn) {
1299
- value[symToStringTag] = tag;
1300
- } else {
1301
- delete value[symToStringTag];
1302
- }
1303
- }
1304
- return result;
1305
- }
1306
- _getRawTag = getRawTag;
1307
- return _getRawTag;
1308
- }
1309
- var _objectToString;
1310
- var hasRequired_objectToString;
1311
- function require_objectToString() {
1312
- if (hasRequired_objectToString) return _objectToString;
1313
- hasRequired_objectToString = 1;
1314
- var objectProto = Object.prototype;
1315
- var nativeObjectToString = objectProto.toString;
1316
- function objectToString(value) {
1317
- return nativeObjectToString.call(value);
1318
- }
1319
- _objectToString = objectToString;
1320
- return _objectToString;
1321
- }
1322
- var _baseGetTag;
1323
- var hasRequired_baseGetTag;
1324
- function require_baseGetTag() {
1325
- if (hasRequired_baseGetTag) return _baseGetTag;
1326
- hasRequired_baseGetTag = 1;
1327
- var Symbol2 = require_Symbol(), getRawTag = require_getRawTag(), objectToString = require_objectToString();
1328
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
1329
- var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
1330
- function baseGetTag(value) {
1331
- if (value == null) {
1332
- return value === void 0 ? undefinedTag : nullTag;
1333
- }
1334
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
1335
- }
1336
- _baseGetTag = baseGetTag;
1337
- return _baseGetTag;
1338
- }
1339
- var isObjectLike_1;
1340
- var hasRequiredIsObjectLike;
1341
- function requireIsObjectLike() {
1342
- if (hasRequiredIsObjectLike) return isObjectLike_1;
1343
- hasRequiredIsObjectLike = 1;
1344
- function isObjectLike(value) {
1345
- return value != null && typeof value == "object";
1346
- }
1347
- isObjectLike_1 = isObjectLike;
1348
- return isObjectLike_1;
1349
- }
1350
- var isSymbol_1;
1351
- var hasRequiredIsSymbol;
1352
- function requireIsSymbol() {
1353
- if (hasRequiredIsSymbol) return isSymbol_1;
1354
- hasRequiredIsSymbol = 1;
1355
- var baseGetTag = require_baseGetTag(), isObjectLike = requireIsObjectLike();
1356
- var symbolTag = "[object Symbol]";
1357
- function isSymbol(value) {
1358
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
1359
- }
1360
- isSymbol_1 = isSymbol;
1361
- return isSymbol_1;
1362
- }
1363
- var _baseToString;
1364
- var hasRequired_baseToString;
1365
- function require_baseToString() {
1366
- if (hasRequired_baseToString) return _baseToString;
1367
- hasRequired_baseToString = 1;
1368
- var Symbol2 = require_Symbol(), arrayMap = require_arrayMap(), isArray = requireIsArray(), isSymbol = requireIsSymbol();
1369
- var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
1370
- function baseToString(value) {
1371
- if (typeof value == "string") {
1372
- return value;
1373
- }
1374
- if (isArray(value)) {
1375
- return arrayMap(value, baseToString) + "";
1376
- }
1377
- if (isSymbol(value)) {
1378
- return symbolToString ? symbolToString.call(value) : "";
1379
- }
1380
- var result = value + "";
1381
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
1382
- }
1383
- _baseToString = baseToString;
1384
- return _baseToString;
1385
- }
1386
- var toString_1;
1387
- var hasRequiredToString;
1388
- function requireToString() {
1389
- if (hasRequiredToString) return toString_1;
1390
- hasRequiredToString = 1;
1391
- var baseToString = require_baseToString();
1392
- function toString2(value) {
1393
- return value == null ? "" : baseToString(value);
1394
- }
1395
- toString_1 = toString2;
1396
- return toString_1;
1397
- }
1398
1222
  var deburr_1;
1399
1223
  var hasRequiredDeburr;
1400
1224
  function requireDeburr() {
@@ -1540,6 +1364,7 @@ function useApplyScroll() {
1540
1364
  const $ = c(17);
1541
1365
  const location = useLocation();
1542
1366
  const previousPathRef = useRef(location.pathname);
1367
+ const hasAppliedLocationRef = useRef(false);
1543
1368
  const isScrollingProgrammatically = useRef(false);
1544
1369
  const scrollTimeoutRef = useRef(null);
1545
1370
  const lastAppliedHashRef = useRef("");
@@ -1612,7 +1437,20 @@ function useApplyScroll() {
1612
1437
  let t7;
1613
1438
  if ($[7] !== location.hash || $[8] !== location.pathname) {
1614
1439
  t6 = () => {
1440
+ const isInitialLocation = !hasAppliedLocationRef.current;
1441
+ hasAppliedLocationRef.current = true;
1615
1442
  const pathChanged = previousPathRef.current !== location.pathname;
1443
+ const applyHashScroll = (behavior) => {
1444
+ const id = location.hash.substring(1);
1445
+ const element = document.getElementById(id);
1446
+ if (!element) {
1447
+ return;
1448
+ }
1449
+ markProgrammaticScroll();
1450
+ element.scrollIntoView({
1451
+ behavior
1452
+ });
1453
+ };
1616
1454
  if (pathChanged) {
1617
1455
  previousPathRef.current = location.pathname;
1618
1456
  if (!location.hash) {
@@ -1624,28 +1462,14 @@ function useApplyScroll() {
1624
1462
  return;
1625
1463
  }
1626
1464
  setTimeout(() => {
1627
- const id = location.hash.substring(1);
1628
- const element = document.getElementById(id);
1629
- if (element) {
1630
- markProgrammaticScroll();
1631
- element.scrollIntoView({
1632
- behavior: "smooth"
1633
- });
1634
- }
1465
+ applyHashScroll("auto");
1635
1466
  }, 100);
1636
1467
  return;
1637
1468
  }
1638
1469
  if (!location.hash) {
1639
1470
  return;
1640
1471
  }
1641
- const id_0 = location.hash.substring(1);
1642
- const element_0 = document.getElementById(id_0);
1643
- if (element_0) {
1644
- markProgrammaticScroll();
1645
- element_0.scrollIntoView({
1646
- behavior: "smooth"
1647
- });
1648
- }
1472
+ applyHashScroll(isInitialLocation ? "auto" : "smooth");
1649
1473
  };
1650
1474
  t7 = [location.hash, location.pathname, markProgrammaticScroll];
1651
1475
  $[7] = location.hash;
@@ -1714,13 +1538,13 @@ function useApplyScroll() {
1714
1538
  if (!link || !link.hash || link.pathname !== location.pathname || link.hash !== currentHash) {
1715
1539
  return;
1716
1540
  }
1717
- const id_1 = link.hash.substring(1);
1718
- const element_1 = document.getElementById(id_1);
1719
- if (element_1) {
1541
+ const id_0 = link.hash.substring(1);
1542
+ const element_0 = document.getElementById(id_0);
1543
+ if (element_0) {
1720
1544
  event.preventDefault();
1721
1545
  event.stopPropagation();
1722
1546
  markProgrammaticScroll();
1723
- element_1.scrollIntoView({
1547
+ element_0.scrollIntoView({
1724
1548
  behavior: "smooth"
1725
1549
  });
1726
1550
  }
@@ -1759,209 +1583,6 @@ const RootProvider = (t0) => {
1759
1583
  }
1760
1584
  return t2;
1761
1585
  };
1762
- var isObject_1;
1763
- var hasRequiredIsObject;
1764
- function requireIsObject() {
1765
- if (hasRequiredIsObject) return isObject_1;
1766
- hasRequiredIsObject = 1;
1767
- function isObject(value) {
1768
- var type = typeof value;
1769
- return value != null && (type == "object" || type == "function");
1770
- }
1771
- isObject_1 = isObject;
1772
- return isObject_1;
1773
- }
1774
- var now_1;
1775
- var hasRequiredNow;
1776
- function requireNow() {
1777
- if (hasRequiredNow) return now_1;
1778
- hasRequiredNow = 1;
1779
- var root = require_root();
1780
- var now = function() {
1781
- return root.Date.now();
1782
- };
1783
- now_1 = now;
1784
- return now_1;
1785
- }
1786
- var _trimmedEndIndex;
1787
- var hasRequired_trimmedEndIndex;
1788
- function require_trimmedEndIndex() {
1789
- if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
1790
- hasRequired_trimmedEndIndex = 1;
1791
- var reWhitespace = /\s/;
1792
- function trimmedEndIndex(string) {
1793
- var index = string.length;
1794
- while (index-- && reWhitespace.test(string.charAt(index))) {
1795
- }
1796
- return index;
1797
- }
1798
- _trimmedEndIndex = trimmedEndIndex;
1799
- return _trimmedEndIndex;
1800
- }
1801
- var _baseTrim;
1802
- var hasRequired_baseTrim;
1803
- function require_baseTrim() {
1804
- if (hasRequired_baseTrim) return _baseTrim;
1805
- hasRequired_baseTrim = 1;
1806
- var trimmedEndIndex = require_trimmedEndIndex();
1807
- var reTrimStart = /^\s+/;
1808
- function baseTrim(string) {
1809
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
1810
- }
1811
- _baseTrim = baseTrim;
1812
- return _baseTrim;
1813
- }
1814
- var toNumber_1;
1815
- var hasRequiredToNumber;
1816
- function requireToNumber() {
1817
- if (hasRequiredToNumber) return toNumber_1;
1818
- hasRequiredToNumber = 1;
1819
- var baseTrim = require_baseTrim(), isObject = requireIsObject(), isSymbol = requireIsSymbol();
1820
- var NAN = 0 / 0;
1821
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
1822
- var reIsBinary = /^0b[01]+$/i;
1823
- var reIsOctal = /^0o[0-7]+$/i;
1824
- var freeParseInt = parseInt;
1825
- function toNumber(value) {
1826
- if (typeof value == "number") {
1827
- return value;
1828
- }
1829
- if (isSymbol(value)) {
1830
- return NAN;
1831
- }
1832
- if (isObject(value)) {
1833
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
1834
- value = isObject(other) ? other + "" : other;
1835
- }
1836
- if (typeof value != "string") {
1837
- return value === 0 ? value : +value;
1838
- }
1839
- value = baseTrim(value);
1840
- var isBinary = reIsBinary.test(value);
1841
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
1842
- }
1843
- toNumber_1 = toNumber;
1844
- return toNumber_1;
1845
- }
1846
- var debounce_1;
1847
- var hasRequiredDebounce;
1848
- function requireDebounce() {
1849
- if (hasRequiredDebounce) return debounce_1;
1850
- hasRequiredDebounce = 1;
1851
- var isObject = requireIsObject(), now = requireNow(), toNumber = requireToNumber();
1852
- var FUNC_ERROR_TEXT = "Expected a function";
1853
- var nativeMax = Math.max, nativeMin = Math.min;
1854
- function debounce(func, wait, options) {
1855
- var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
1856
- if (typeof func != "function") {
1857
- throw new TypeError(FUNC_ERROR_TEXT);
1858
- }
1859
- wait = toNumber(wait) || 0;
1860
- if (isObject(options)) {
1861
- leading = !!options.leading;
1862
- maxing = "maxWait" in options;
1863
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
1864
- trailing = "trailing" in options ? !!options.trailing : trailing;
1865
- }
1866
- function invokeFunc(time) {
1867
- var args = lastArgs, thisArg = lastThis;
1868
- lastArgs = lastThis = void 0;
1869
- lastInvokeTime = time;
1870
- result = func.apply(thisArg, args);
1871
- return result;
1872
- }
1873
- function leadingEdge(time) {
1874
- lastInvokeTime = time;
1875
- timerId = setTimeout(timerExpired, wait);
1876
- return leading ? invokeFunc(time) : result;
1877
- }
1878
- function remainingWait(time) {
1879
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
1880
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
1881
- }
1882
- function shouldInvoke(time) {
1883
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
1884
- return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
1885
- }
1886
- function timerExpired() {
1887
- var time = now();
1888
- if (shouldInvoke(time)) {
1889
- return trailingEdge(time);
1890
- }
1891
- timerId = setTimeout(timerExpired, remainingWait(time));
1892
- }
1893
- function trailingEdge(time) {
1894
- timerId = void 0;
1895
- if (trailing && lastArgs) {
1896
- return invokeFunc(time);
1897
- }
1898
- lastArgs = lastThis = void 0;
1899
- return result;
1900
- }
1901
- function cancel() {
1902
- if (timerId !== void 0) {
1903
- clearTimeout(timerId);
1904
- }
1905
- lastInvokeTime = 0;
1906
- lastArgs = lastCallTime = lastThis = timerId = void 0;
1907
- }
1908
- function flush() {
1909
- return timerId === void 0 ? result : trailingEdge(now());
1910
- }
1911
- function debounced() {
1912
- var time = now(), isInvoking = shouldInvoke(time);
1913
- lastArgs = arguments;
1914
- lastThis = this;
1915
- lastCallTime = time;
1916
- if (isInvoking) {
1917
- if (timerId === void 0) {
1918
- return leadingEdge(lastCallTime);
1919
- }
1920
- if (maxing) {
1921
- clearTimeout(timerId);
1922
- timerId = setTimeout(timerExpired, wait);
1923
- return invokeFunc(lastCallTime);
1924
- }
1925
- }
1926
- if (timerId === void 0) {
1927
- timerId = setTimeout(timerExpired, wait);
1928
- }
1929
- return result;
1930
- }
1931
- debounced.cancel = cancel;
1932
- debounced.flush = flush;
1933
- return debounced;
1934
- }
1935
- debounce_1 = debounce;
1936
- return debounce_1;
1937
- }
1938
- var throttle_1;
1939
- var hasRequiredThrottle;
1940
- function requireThrottle() {
1941
- if (hasRequiredThrottle) return throttle_1;
1942
- hasRequiredThrottle = 1;
1943
- var debounce = requireDebounce(), isObject = requireIsObject();
1944
- var FUNC_ERROR_TEXT = "Expected a function";
1945
- function throttle2(func, wait, options) {
1946
- var leading = true, trailing = true;
1947
- if (typeof func != "function") {
1948
- throw new TypeError(FUNC_ERROR_TEXT);
1949
- }
1950
- if (isObject(options)) {
1951
- leading = "leading" in options ? !!options.leading : leading;
1952
- trailing = "trailing" in options ? !!options.trailing : trailing;
1953
- }
1954
- return debounce(func, wait, {
1955
- "leading": leading,
1956
- "maxWait": wait,
1957
- "trailing": trailing
1958
- });
1959
- }
1960
- throttle_1 = throttle2;
1961
- return throttle_1;
1962
- }
1963
- var throttleExports = requireThrottle();
1964
- const _throttle = /* @__PURE__ */ getDefaultExportFromCjs(throttleExports);
1965
1586
  const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
1966
1587
  const { hasOwnProperty } = Object.prototype;
1967
1588
  function combineComparators(comparatorA, comparatorB) {
@@ -2479,7 +2100,7 @@ const useThrottledMeasure = (t0) => {
2479
2100
  }
2480
2101
  let t2;
2481
2102
  if ($[1] !== throttleDuration) {
2482
- t2 = _throttle(t1, throttleDuration, {
2103
+ t2 = throttle$1(t1, throttleDuration, {
2483
2104
  leading: true,
2484
2105
  trailing: true
2485
2106
  });