@powerhousedao/connect 1.0.21-staging.0 → 1.0.22-staging.1

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-Eu5ix3yZ.js","assets/main.D6_W-5oY.js","assets/app-loader-uTr5bb-C.js","assets/app-loader-DiF8OhX3.css","assets/index-BQuSynqj.js","assets/style-Ce3V83BE.css","assets/index-CXtQlZED.js","assets/content-ZNvpO_Bf.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-i-oLVbil.js","assets/main.DfFOgz9f.js","assets/app-loader-mwZgOVwV.js","assets/app-loader-3ipafc56.css","assets/index-B469WXKP.js","assets/style-0ej1afQi.css","assets/index-M4h38SB3.js","assets/content-CsEKVDJz.js"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __typeError = (msg) => {
4
4
  throw TypeError(msg);
@@ -19,9 +19,9 @@ var __privateWrapper = (obj, member, setter, getter) => ({
19
19
  }
20
20
  });
21
21
  var _focused, _cleanup, _setup, _a, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _d, _queries, _e2, _observers, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _f, _mutations, _scopes, _mutationId, _g, _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h, _client2, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _i, _subtleCrypto, _keyPair, _keyPairStorage, _did, _ConnectCrypto_instances, initCrypto_fn, initialize_fn, parseDid_fn, generateECDSAKeyPair_fn, exportKeyPair_fn, importKeyPair_fn, _sign, _verify, _DB_NAME, _STORE_NAME, _KEY, _db, _BrowserKeyStorage_instances, useStore_fn;
22
- import { _ as __vitePreload } from "./main.D6_W-5oY.js";
22
+ import { _ as __vitePreload } from "./main.DfFOgz9f.js";
23
23
  import { jsx as jsx$1, Fragment, jsxs } from "react/jsx-runtime";
24
- import { c as createAction, a as createReducer, i as isDocumentAction, R as ReorderStateExamplesInputSchema, D as DeleteStateExampleInputSchema, U as UpdateStateExampleInputSchema, A as AddStateExampleInputSchema, S as SetInitialStateInputSchema, b as SetStateSchemaInputSchema, d as ReorderModuleOperationsInputSchema, e as DeleteOperationInputSchema, M as MoveOperationInputSchema, f as SetOperationReducerInputSchema, g as SetOperationTemplateInputSchema, h as SetOperationDescriptionInputSchema, j as SetOperationSchemaInputSchema, k as SetOperationScopeInputSchema, l as SetOperationNameInputSchema, m as AddOperationInputSchema, n as ReorderOperationExamplesInputSchema, o as DeleteOperationExampleInputSchema, p as UpdateOperationExampleInputSchema, q as AddOperationExampleInputSchema, r as ReorderOperationErrorsInputSchema, s as DeleteOperationErrorInputSchema, t as SetOperationErrorTemplateInputSchema, u as SetOperationErrorDescriptionInputSchema, v as SetOperationErrorNameInputSchema, w as SetOperationErrorCodeInputSchema, x as AddOperationErrorInputSchema, y as ReorderModulesInputSchema, z as DeleteModuleInputSchema, B as SetModuleDescriptionInputSchema, C as SetModuleNameInputSchema, E as AddModuleInputSchema, F as ReorderChangeLogItemsInputSchema, G as DeleteChangeLogItemInputSchema, H as UpdateChangeLogItemInputSchema, I as AddChangeLogItemInputSchema, J as SetAuthorWebsiteInputSchema, K as SetAuthorNameInputSchema, L as SetModelDescriptionInputSchema, N as SetModelExtensionInputSchema, O as SetModelIdInputSchema, P as SetModelNameInputSchema, Q as baseCreateExtendedState, T as baseCreateDocument, V as baseSaveToFile, W as baseSaveToFileHandle, X as baseLoadFromFile, Y as baseLoadFromInput, Z as pascalCase, _ as Icon, $ as getDefaultExportFromCjs, a0 as LOCAL, a1 as commonjsGlobal, a2 as PUBLIC, a3 as SWITCHBOARD, a4 as locationInfoByLocation, a5 as sharingTypeOptions, a6 as objectType, a7 as recordType, a8 as stringType, a9 as capitalCase, aa as CLOUD, ab as createZip, ac as logger$1, ad as LZString, ae as buildSignedOperation, af as getI18n, ag as getDefaults, ah as connectConfig, ai as hashDocumentStateForScope, aj as getAugmentedNamespace, ak as setErrorHandler, al as driveDocumentModelModule, am as createBrowserDocumentDriveServer, an as hashKey$1, ao as childLogger, ap as reducer$8, aq as isDocumentDrive, ar as generateAddNodeAction, as as isFileNode, at as uploadDocumentOperations, au as updateFile, av as addFolder, aw as isFolderNode, ax as deleteNode, ay as updateNode, az as FILE$1, aA as moveNode, aB as generateNodesCopy, aC as copyNode, aD as createState$1, aE as setDriveName, aF as setAvailableOffline, aG as setSharingType, aH as SynchronizationUnitNotFoundError, aI as removeTrigger, aJ as generateUUID, aK as PullResponderTransmitter, aL as addTrigger, aM as ReadDriveNotFoundError, aN as openUrl, aO as getNodeOptions, aP as DRIVE$1, aQ as FOLDER, aR as requestPublicDrive, aS as serviceWorkerManager, aT as packageJson, aU as t$1, aV as gql, aW as request } from "./app-loader-uTr5bb-C.js";
24
+ import { c as createAction, a as createReducer, i as isDocumentAction, R as ReorderStateExamplesInputSchema, D as DeleteStateExampleInputSchema, U as UpdateStateExampleInputSchema, A as AddStateExampleInputSchema, S as SetInitialStateInputSchema, b as SetStateSchemaInputSchema, d as ReorderModuleOperationsInputSchema, e as DeleteOperationInputSchema, M as MoveOperationInputSchema, f as SetOperationReducerInputSchema, g as SetOperationTemplateInputSchema, h as SetOperationDescriptionInputSchema, j as SetOperationSchemaInputSchema, k as SetOperationScopeInputSchema, l as SetOperationNameInputSchema, m as AddOperationInputSchema, n as ReorderOperationExamplesInputSchema, o as DeleteOperationExampleInputSchema, p as UpdateOperationExampleInputSchema, q as AddOperationExampleInputSchema, r as ReorderOperationErrorsInputSchema, s as DeleteOperationErrorInputSchema, t as SetOperationErrorTemplateInputSchema, u as SetOperationErrorDescriptionInputSchema, v as SetOperationErrorNameInputSchema, w as SetOperationErrorCodeInputSchema, x as AddOperationErrorInputSchema, y as ReorderModulesInputSchema, z as DeleteModuleInputSchema, B as SetModuleDescriptionInputSchema, C as SetModuleNameInputSchema, E as AddModuleInputSchema, F as ReorderChangeLogItemsInputSchema, G as DeleteChangeLogItemInputSchema, H as UpdateChangeLogItemInputSchema, I as AddChangeLogItemInputSchema, J as SetAuthorWebsiteInputSchema, K as SetAuthorNameInputSchema, L as SetModelDescriptionInputSchema, N as SetModelExtensionInputSchema, O as SetModelIdInputSchema, P as SetModelNameInputSchema, Q as baseCreateExtendedState, T as baseCreateDocument, V as baseSaveToFile, W as baseSaveToFileHandle, X as baseLoadFromFile, Y as baseLoadFromInput, Z as pascalCase, _ as Icon, $ as getDefaultExportFromCjs, a0 as LOCAL, a1 as commonjsGlobal, a2 as PUBLIC, a3 as SWITCHBOARD, a4 as locationInfoByLocation, a5 as sharingTypeOptions, a6 as objectType, a7 as recordType, a8 as stringType, a9 as capitalCase, aa as CLOUD, ab as createZip, ac as logger$1, ad as LZString, ae as buildSignedOperation, af as getI18n, ag as getDefaults, ah as connectConfig, ai as hashDocumentStateForScope, aj as getAugmentedNamespace, ak as setErrorHandler, al as driveDocumentModelModule, am as createBrowserDocumentDriveServer, an as hashKey$1, ao as childLogger, ap as reducer$8, aq as isDocumentDrive, ar as generateAddNodeAction, as as isFileNode, at as uploadDocumentOperations, au as updateFile, av as addFolder, aw as isFolderNode, ax as deleteNode, ay as updateNode, az as FILE$1, aA as moveNode, aB as generateNodesCopy, aC as copyNode, aD as createState$1, aE as setDriveName, aF as setAvailableOffline, aG as setSharingType, aH as SynchronizationUnitNotFoundError, aI as removeTrigger, aJ as generateUUID, aK as PullResponderTransmitter, aL as addTrigger, aM as ReadDriveNotFoundError, aN as openUrl, aO as getNodeOptions, aP as DRIVE$1, aQ as FOLDER, aR as requestPublicDrive, aS as serviceWorkerManager, aT as packageJson, aU as t$1, aV as gql, aW as request } from "./app-loader-mwZgOVwV.js";
25
25
  import * as React from "react";
26
26
  import React__default, { useLayoutEffect, useEffect, useState, forwardRef, useRef, useCallback, useContext, useMemo, createContext, Component, Fragment as Fragment$1, createElement, useSyncExternalStore, useId as useId$1, isValidElement, cloneElement, Children, useReducer, useDebugValue, Suspense } from "react";
27
27
  import * as ReactDOM from "react-dom";
@@ -1575,43 +1575,60 @@ function composeContextScopes(...scopes) {
1575
1575
  createScope.scopeName = baseScope.scopeName;
1576
1576
  return createScope;
1577
1577
  }
1578
- var Slot = React.forwardRef((props, forwardedRef) => {
1579
- const { children, ...slotProps } = props;
1580
- const childrenArray = React.Children.toArray(children);
1581
- const slottable = childrenArray.find(isSlottable);
1582
- if (slottable) {
1583
- const newElement = slottable.props.children;
1584
- const newChildren = childrenArray.map((child) => {
1585
- if (child === slottable) {
1586
- if (React.Children.count(newElement) > 1) return React.Children.only(null);
1587
- return React.isValidElement(newElement) ? newElement.props.children : null;
1588
- } else {
1589
- return child;
1590
- }
1591
- });
1592
- return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
1593
- }
1594
- return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children });
1595
- });
1596
- Slot.displayName = "Slot";
1597
- var SlotClone = React.forwardRef((props, forwardedRef) => {
1598
- const { children, ...slotProps } = props;
1599
- if (React.isValidElement(children)) {
1600
- const childrenRef = getElementRef$1(children);
1601
- const props2 = mergeProps$1(slotProps, children.props);
1602
- if (children.type !== React.Fragment) {
1603
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
1578
+ // @__NO_SIDE_EFFECTS__
1579
+ function createSlot(ownerName) {
1580
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
1581
+ const Slot2 = React.forwardRef((props, forwardedRef) => {
1582
+ const { children, ...slotProps } = props;
1583
+ const childrenArray = React.Children.toArray(children);
1584
+ const slottable = childrenArray.find(isSlottable);
1585
+ if (slottable) {
1586
+ const newElement = slottable.props.children;
1587
+ const newChildren = childrenArray.map((child) => {
1588
+ if (child === slottable) {
1589
+ if (React.Children.count(newElement) > 1) return React.Children.only(null);
1590
+ return React.isValidElement(newElement) ? newElement.props.children : null;
1591
+ } else {
1592
+ return child;
1593
+ }
1594
+ });
1595
+ return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
1604
1596
  }
1605
- return React.cloneElement(children, props2);
1606
- }
1607
- return React.Children.count(children) > 1 ? React.Children.only(null) : null;
1608
- });
1609
- SlotClone.displayName = "SlotClone";
1610
- var Slottable = ({ children }) => {
1611
- return /* @__PURE__ */ jsx$1(Fragment, { children });
1612
- };
1597
+ return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children });
1598
+ });
1599
+ Slot2.displayName = `${ownerName}.Slot`;
1600
+ return Slot2;
1601
+ }
1602
+ var Slot$3 = /* @__PURE__ */ createSlot("Slot");
1603
+ // @__NO_SIDE_EFFECTS__
1604
+ function createSlotClone(ownerName) {
1605
+ const SlotClone = React.forwardRef((props, forwardedRef) => {
1606
+ const { children, ...slotProps } = props;
1607
+ if (React.isValidElement(children)) {
1608
+ const childrenRef = getElementRef$1(children);
1609
+ const props2 = mergeProps$1(slotProps, children.props);
1610
+ if (children.type !== React.Fragment) {
1611
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
1612
+ }
1613
+ return React.cloneElement(children, props2);
1614
+ }
1615
+ return React.Children.count(children) > 1 ? React.Children.only(null) : null;
1616
+ });
1617
+ SlotClone.displayName = `${ownerName}.SlotClone`;
1618
+ return SlotClone;
1619
+ }
1620
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
1621
+ // @__NO_SIDE_EFFECTS__
1622
+ function createSlottable(ownerName) {
1623
+ const Slottable2 = ({ children }) => {
1624
+ return /* @__PURE__ */ jsx$1(Fragment, { children });
1625
+ };
1626
+ Slottable2.displayName = `${ownerName}.Slottable`;
1627
+ Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
1628
+ return Slottable2;
1629
+ }
1613
1630
  function isSlottable(child) {
1614
- return React.isValidElement(child) && child.type === Slottable;
1631
+ return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
1615
1632
  }
1616
1633
  function mergeProps$1(slotProps, childProps) {
1617
1634
  const overrideProps = { ...childProps };
@@ -1664,14 +1681,16 @@ var NODES = [
1664
1681
  "nav",
1665
1682
  "ol",
1666
1683
  "p",
1684
+ "select",
1667
1685
  "span",
1668
1686
  "svg",
1669
1687
  "ul"
1670
1688
  ];
1671
1689
  var Primitive = NODES.reduce((primitive, node2) => {
1690
+ const Slot2 = /* @__PURE__ */ createSlot(`Primitive.${node2}`);
1672
1691
  const Node2 = React.forwardRef((props, forwardedRef) => {
1673
1692
  const { asChild, ...primitiveProps } = props;
1674
- const Comp = asChild ? Slot : node2;
1693
+ const Comp = asChild ? Slot2 : node2;
1675
1694
  if (typeof window !== "undefined") {
1676
1695
  window[Symbol.for("radix-ui")] = true;
1677
1696
  }
@@ -2131,9 +2150,9 @@ function arrayRemove(array, item) {
2131
2150
  function removeLinks(items) {
2132
2151
  return items.filter((item) => item.tagName !== "A");
2133
2152
  }
2134
- var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
2153
+ var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
2135
2154
  };
2136
- var useReactId = React["useId".toString()] || (() => void 0);
2155
+ var useReactId = React[" useId ".trim().toString()] || (() => void 0);
2137
2156
  var count = 0;
2138
2157
  function useId(deterministicId) {
2139
2158
  const [id, setId] = React.useState(useReactId());
@@ -4332,7 +4351,7 @@ var Presence = (props) => {
4332
4351
  Presence.displayName = "Presence";
4333
4352
  function usePresence(present) {
4334
4353
  const [node2, setNode] = React.useState();
4335
- const stylesRef = React.useRef({});
4354
+ const stylesRef = React.useRef(null);
4336
4355
  const prevPresentRef = React.useRef(present);
4337
4356
  const prevAnimationNameRef = React.useRef("none");
4338
4357
  const initialState2 = present ? "mounted" : "unmounted";
@@ -4416,7 +4435,7 @@ function usePresence(present) {
4416
4435
  return {
4417
4436
  isPresent: ["mounted", "unmountSuspended"].includes(state),
4418
4437
  ref: React.useCallback((node22) => {
4419
- if (node22) stylesRef.current = getComputedStyle(node22);
4438
+ stylesRef.current = node22 ? getComputedStyle(node22) : null;
4420
4439
  setNode(node22);
4421
4440
  }, [])
4422
4441
  };
@@ -4438,27 +4457,47 @@ function getElementRef(element) {
4438
4457
  }
4439
4458
  return element.props.ref || element.ref;
4440
4459
  }
4460
+ var useInsertionEffect$1 = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
4441
4461
  function useControllableState({
4442
4462
  prop,
4443
4463
  defaultProp,
4444
4464
  onChange: onChange2 = () => {
4445
- }
4465
+ },
4466
+ caller
4446
4467
  }) {
4447
- const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange: onChange2 });
4468
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
4469
+ defaultProp,
4470
+ onChange: onChange2
4471
+ });
4448
4472
  const isControlled = prop !== void 0;
4449
4473
  const value = isControlled ? prop : uncontrolledProp;
4450
- const handleChange = useCallbackRef$1(onChange2);
4474
+ {
4475
+ const isControlledRef = React.useRef(prop !== void 0);
4476
+ React.useEffect(() => {
4477
+ const wasControlled = isControlledRef.current;
4478
+ if (wasControlled !== isControlled) {
4479
+ const from2 = wasControlled ? "controlled" : "uncontrolled";
4480
+ const to = isControlled ? "controlled" : "uncontrolled";
4481
+ console.warn(
4482
+ `${caller} is changing from ${from2} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
4483
+ );
4484
+ }
4485
+ isControlledRef.current = isControlled;
4486
+ }, [isControlled, caller]);
4487
+ }
4451
4488
  const setValue = React.useCallback(
4452
4489
  (nextValue) => {
4490
+ var _a2;
4453
4491
  if (isControlled) {
4454
- const setter = nextValue;
4455
- const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
4456
- if (value2 !== prop) handleChange(value2);
4492
+ const value2 = isFunction$1(nextValue) ? nextValue(prop) : nextValue;
4493
+ if (value2 !== prop) {
4494
+ (_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, value2);
4495
+ }
4457
4496
  } else {
4458
4497
  setUncontrolledProp(nextValue);
4459
4498
  }
4460
4499
  },
4461
- [isControlled, prop, setUncontrolledProp, handleChange]
4500
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
4462
4501
  );
4463
4502
  return [value, setValue];
4464
4503
  }
@@ -4466,17 +4505,23 @@ function useUncontrolledState({
4466
4505
  defaultProp,
4467
4506
  onChange: onChange2
4468
4507
  }) {
4469
- const uncontrolledState = React.useState(defaultProp);
4470
- const [value] = uncontrolledState;
4508
+ const [value, setValue] = React.useState(defaultProp);
4471
4509
  const prevValueRef = React.useRef(value);
4472
- const handleChange = useCallbackRef$1(onChange2);
4510
+ const onChangeRef = React.useRef(onChange2);
4511
+ useInsertionEffect$1(() => {
4512
+ onChangeRef.current = onChange2;
4513
+ }, [onChange2]);
4473
4514
  React.useEffect(() => {
4515
+ var _a2;
4474
4516
  if (prevValueRef.current !== value) {
4475
- handleChange(value);
4517
+ (_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, value);
4476
4518
  prevValueRef.current = value;
4477
4519
  }
4478
- }, [value, prevValueRef, handleChange]);
4479
- return uncontrolledState;
4520
+ }, [value, prevValueRef]);
4521
+ return [value, setValue, onChangeRef];
4522
+ }
4523
+ function isFunction$1(value) {
4524
+ return typeof value === "function";
4480
4525
  }
4481
4526
  var getDefaultParent = function(originalTarget) {
4482
4527
  if (typeof document === "undefined") {
@@ -4668,7 +4713,7 @@ function useCallbackRef(initialValue, callback) {
4668
4713
  ref.callback = callback;
4669
4714
  return ref.facade;
4670
4715
  }
4671
- var useIsomorphicLayoutEffect$2 = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
4716
+ var useIsomorphicLayoutEffect$3 = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
4672
4717
  var currentValues = /* @__PURE__ */ new WeakMap();
4673
4718
  function useMergeRefs(refs, defaultValue) {
4674
4719
  var callbackRef = useCallbackRef(null, function(newValue) {
@@ -4676,7 +4721,7 @@ function useMergeRefs(refs, defaultValue) {
4676
4721
  return assignRef(ref, newValue);
4677
4722
  });
4678
4723
  });
4679
- useIsomorphicLayoutEffect$2(function() {
4724
+ useIsomorphicLayoutEffect$3(function() {
4680
4725
  var oldValue = currentValues.get(callbackRef);
4681
4726
  if (oldValue) {
4682
4727
  var prevRefs_1 = new Set(oldValue);
@@ -5269,10 +5314,11 @@ var Popover$1 = (props) => {
5269
5314
  const popperScope = usePopperScope$2(__scopePopover);
5270
5315
  const triggerRef = React.useRef(null);
5271
5316
  const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
5272
- const [open = false, setOpen] = useControllableState({
5317
+ const [open, setOpen] = useControllableState({
5273
5318
  prop: openProp,
5274
- defaultProp: defaultOpen,
5275
- onChange: onOpenChange
5319
+ defaultProp: defaultOpen ?? false,
5320
+ onChange: onOpenChange,
5321
+ caller: POPOVER_NAME
5276
5322
  });
5277
5323
  return /* @__PURE__ */ jsx$1(Root2$3, { ...popperScope, children: /* @__PURE__ */ jsx$1(
5278
5324
  PopoverProvider,
@@ -5351,6 +5397,7 @@ var PopoverContent$1 = React.forwardRef(
5351
5397
  }
5352
5398
  );
5353
5399
  PopoverContent$1.displayName = CONTENT_NAME$5;
5400
+ var Slot$2 = /* @__PURE__ */ createSlot("PopoverContent.RemoveScroll");
5354
5401
  var PopoverContentModal = React.forwardRef(
5355
5402
  (props, forwardedRef) => {
5356
5403
  const context = usePopoverContext(CONTENT_NAME$5, props.__scopePopover);
@@ -5361,7 +5408,7 @@ var PopoverContentModal = React.forwardRef(
5361
5408
  const content = contentRef.current;
5362
5409
  if (content) return hideOthers(content);
5363
5410
  }, []);
5364
- return /* @__PURE__ */ jsx$1(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx$1(
5411
+ return /* @__PURE__ */ jsx$1(ReactRemoveScroll, { as: Slot$2, allowPinchZoom: true, children: /* @__PURE__ */ jsx$1(
5365
5412
  PopoverContentImpl,
5366
5413
  {
5367
5414
  ...props,
@@ -5920,8 +5967,8 @@ const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
5920
5967
  const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
5921
5968
  const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
5922
5969
  const isFraction = (value) => fractionRegex.test(value);
5923
- const isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
5924
- const isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
5970
+ const isNumber = (value) => !!value && !Number.isNaN(Number(value));
5971
+ const isInteger = (value) => !!value && Number.isInteger(Number(value));
5925
5972
  const isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
5926
5973
  const isTshirtSize = (value) => tshirtUnitRegex.test(value);
5927
5974
  const isAny = () => true;
@@ -5941,7 +5988,7 @@ const isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, i
5941
5988
  const isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
5942
5989
  const isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
5943
5990
  const isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
5944
- const isArbitraryShadow = (value) => getIsArbitraryValue(value, isNever, isShadow);
5991
+ const isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
5945
5992
  const isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
5946
5993
  const isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
5947
5994
  const isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
@@ -5969,11 +6016,9 @@ const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) =>
5969
6016
  }
5970
6017
  return false;
5971
6018
  };
5972
- const isLabelPosition = (label) => label === "position";
5973
- const imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
5974
- const isLabelImage = (label) => imageLabels.has(label);
5975
- const sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
5976
- const isLabelSize = (label) => sizeLabels.has(label);
6019
+ const isLabelPosition = (label) => label === "position" || label === "percentage";
6020
+ const isLabelImage = (label) => label === "image" || label === "url";
6021
+ const isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
5977
6022
  const isLabelLength = (label) => label === "length";
5978
6023
  const isLabelNumber = (label) => label === "number";
5979
6024
  const isLabelFamilyName = (label) => label === "family-name";
@@ -5991,6 +6036,7 @@ const getDefaultConfig = () => {
5991
6036
  const themeRadius = fromTheme("radius");
5992
6037
  const themeShadow = fromTheme("shadow");
5993
6038
  const themeInsetShadow = fromTheme("inset-shadow");
6039
+ const themeTextShadow = fromTheme("text-shadow");
5994
6040
  const themeDropShadow = fromTheme("drop-shadow");
5995
6041
  const themeBlur = fromTheme("blur");
5996
6042
  const themePerspective = fromTheme("perspective");
@@ -5998,7 +6044,26 @@ const getDefaultConfig = () => {
5998
6044
  const themeEase = fromTheme("ease");
5999
6045
  const themeAnimate = fromTheme("animate");
6000
6046
  const scaleBreak = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
6001
- const scalePosition = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"];
6047
+ const scalePosition = () => [
6048
+ "center",
6049
+ "top",
6050
+ "bottom",
6051
+ "left",
6052
+ "right",
6053
+ "top-left",
6054
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
6055
+ "left-top",
6056
+ "top-right",
6057
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
6058
+ "right-top",
6059
+ "bottom-right",
6060
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
6061
+ "right-bottom",
6062
+ "bottom-left",
6063
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
6064
+ "left-bottom"
6065
+ ];
6066
+ const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
6002
6067
  const scaleOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
6003
6068
  const scaleOverscroll = () => ["auto", "contain", "none"];
6004
6069
  const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
@@ -6006,15 +6071,24 @@ const getDefaultConfig = () => {
6006
6071
  const scaleGridTemplateColsRows = () => [isInteger, "none", "subgrid", isArbitraryVariable, isArbitraryValue];
6007
6072
  const scaleGridColRowStartAndEnd = () => ["auto", {
6008
6073
  span: ["full", isInteger, isArbitraryVariable, isArbitraryValue]
6009
- }, isArbitraryVariable, isArbitraryValue];
6074
+ }, isInteger, isArbitraryVariable, isArbitraryValue];
6010
6075
  const scaleGridColRowStartOrEnd = () => [isInteger, "auto", isArbitraryVariable, isArbitraryValue];
6011
6076
  const scaleGridAutoColsRows = () => ["auto", "min", "max", "fr", isArbitraryVariable, isArbitraryValue];
6012
- const scaleAlignPrimaryAxis = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline"];
6013
- const scaleAlignSecondaryAxis = () => ["start", "end", "center", "stretch"];
6077
+ const scaleAlignPrimaryAxis = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"];
6078
+ const scaleAlignSecondaryAxis = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"];
6014
6079
  const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
6015
6080
  const scaleSizing = () => [isFraction, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing()];
6016
6081
  const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
6017
- const scaleGradientStopPosition = () => [isPercent, isArbitraryLength];
6082
+ const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
6083
+ position: [isArbitraryVariable, isArbitraryValue]
6084
+ }];
6085
+ const scaleBgRepeat = () => ["no-repeat", {
6086
+ repeat: ["", "x", "y", "space", "round"]
6087
+ }];
6088
+ const scaleBgSize = () => ["auto", "cover", "contain", isArbitraryVariableSize, isArbitrarySize, {
6089
+ size: [isArbitraryVariable, isArbitraryValue]
6090
+ }];
6091
+ const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
6018
6092
  const scaleRadius = () => [
6019
6093
  // Deprecated since Tailwind CSS v4.0.0
6020
6094
  "",
@@ -6027,6 +6101,7 @@ const getDefaultConfig = () => {
6027
6101
  const scaleBorderWidth = () => ["", isNumber, isArbitraryVariableLength, isArbitraryLength];
6028
6102
  const scaleLineStyle = () => ["solid", "dashed", "dotted", "double"];
6029
6103
  const scaleBlendMode = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
6104
+ const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
6030
6105
  const scaleBlur = () => [
6031
6106
  // Deprecated since Tailwind CSS v4.0.0
6032
6107
  "",
@@ -6035,7 +6110,6 @@ const getDefaultConfig = () => {
6035
6110
  isArbitraryVariable,
6036
6111
  isArbitraryValue
6037
6112
  ];
6038
- const scaleOrigin = () => ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", isArbitraryVariable, isArbitraryValue];
6039
6113
  const scaleRotate = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
6040
6114
  const scaleScale = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
6041
6115
  const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
@@ -6060,6 +6134,7 @@ const getDefaultConfig = () => {
6060
6134
  shadow: [isTshirtSize],
6061
6135
  spacing: ["px", isNumber],
6062
6136
  text: [isTshirtSize],
6137
+ "text-shadow": [isTshirtSize],
6063
6138
  tracking: ["tighter", "tight", "normal", "wide", "wider", "widest"]
6064
6139
  },
6065
6140
  classGroups: {
@@ -6162,7 +6237,7 @@ const getDefaultConfig = () => {
6162
6237
  * @see https://tailwindcss.com/docs/object-position
6163
6238
  */
6164
6239
  "object-position": [{
6165
- object: [...scalePosition(), isArbitraryValue, isArbitraryVariable]
6240
+ object: scalePositionWithArbitrary()
6166
6241
  }],
6167
6242
  /**
6168
6243
  * Overflow
@@ -6469,14 +6544,18 @@ const getDefaultConfig = () => {
6469
6544
  * @see https://tailwindcss.com/docs/align-items
6470
6545
  */
6471
6546
  "align-items": [{
6472
- items: [...scaleAlignSecondaryAxis(), "baseline"]
6547
+ items: [...scaleAlignSecondaryAxis(), {
6548
+ baseline: ["", "last"]
6549
+ }]
6473
6550
  }],
6474
6551
  /**
6475
6552
  * Align Self
6476
6553
  * @see https://tailwindcss.com/docs/align-self
6477
6554
  */
6478
6555
  "align-self": [{
6479
- self: ["auto", ...scaleAlignSecondaryAxis(), "baseline"]
6556
+ self: ["auto", ...scaleAlignSecondaryAxis(), {
6557
+ baseline: ["", "last"]
6558
+ }]
6480
6559
  }],
6481
6560
  /**
6482
6561
  * Place Content
@@ -6936,6 +7015,13 @@ const getDefaultConfig = () => {
6936
7015
  break: [{
6937
7016
  break: ["normal", "words", "all", "keep"]
6938
7017
  }],
7018
+ /**
7019
+ * Overflow Wrap
7020
+ * @see https://tailwindcss.com/docs/overflow-wrap
7021
+ */
7022
+ wrap: [{
7023
+ wrap: ["break-word", "anywhere", "normal"]
7024
+ }],
6939
7025
  /**
6940
7026
  * Hyphens
6941
7027
  * @see https://tailwindcss.com/docs/hyphens
@@ -6979,23 +7065,21 @@ const getDefaultConfig = () => {
6979
7065
  * @see https://tailwindcss.com/docs/background-position
6980
7066
  */
6981
7067
  "bg-position": [{
6982
- bg: [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition]
7068
+ bg: scaleBgPosition()
6983
7069
  }],
6984
7070
  /**
6985
7071
  * Background Repeat
6986
7072
  * @see https://tailwindcss.com/docs/background-repeat
6987
7073
  */
6988
7074
  "bg-repeat": [{
6989
- bg: ["no-repeat", {
6990
- repeat: ["", "x", "y", "space", "round"]
6991
- }]
7075
+ bg: scaleBgRepeat()
6992
7076
  }],
6993
7077
  /**
6994
7078
  * Background Size
6995
7079
  * @see https://tailwindcss.com/docs/background-size
6996
7080
  */
6997
7081
  "bg-size": [{
6998
- bg: ["auto", "cover", "contain", isArbitraryVariableSize, isArbitrarySize]
7082
+ bg: scaleBgSize()
6999
7083
  }],
7000
7084
  /**
7001
7085
  * Background Image
@@ -7364,7 +7448,7 @@ const getDefaultConfig = () => {
7364
7448
  * @see https://tailwindcss.com/docs/outline-color
7365
7449
  */
7366
7450
  "outline-color": [{
7367
- outline: [themeColor]
7451
+ outline: scaleColor()
7368
7452
  }],
7369
7453
  // ---------------
7370
7454
  // --- Effects ---
@@ -7395,7 +7479,7 @@ const getDefaultConfig = () => {
7395
7479
  * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
7396
7480
  */
7397
7481
  "inset-shadow": [{
7398
- "inset-shadow": ["none", isArbitraryVariable, isArbitraryValue, themeInsetShadow]
7482
+ "inset-shadow": ["none", themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
7399
7483
  }],
7400
7484
  /**
7401
7485
  * Inset Box Shadow Color
@@ -7457,6 +7541,20 @@ const getDefaultConfig = () => {
7457
7541
  "inset-ring-color": [{
7458
7542
  "inset-ring": scaleColor()
7459
7543
  }],
7544
+ /**
7545
+ * Text Shadow
7546
+ * @see https://tailwindcss.com/docs/text-shadow
7547
+ */
7548
+ "text-shadow": [{
7549
+ "text-shadow": ["none", themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
7550
+ }],
7551
+ /**
7552
+ * Text Shadow Color
7553
+ * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
7554
+ */
7555
+ "text-shadow-color": [{
7556
+ "text-shadow": scaleColor()
7557
+ }],
7460
7558
  /**
7461
7559
  * Opacity
7462
7560
  * @see https://tailwindcss.com/docs/opacity
@@ -7478,6 +7576,202 @@ const getDefaultConfig = () => {
7478
7576
  "bg-blend": [{
7479
7577
  "bg-blend": scaleBlendMode()
7480
7578
  }],
7579
+ /**
7580
+ * Mask Clip
7581
+ * @see https://tailwindcss.com/docs/mask-clip
7582
+ */
7583
+ "mask-clip": [{
7584
+ "mask-clip": ["border", "padding", "content", "fill", "stroke", "view"]
7585
+ }, "mask-no-clip"],
7586
+ /**
7587
+ * Mask Composite
7588
+ * @see https://tailwindcss.com/docs/mask-composite
7589
+ */
7590
+ "mask-composite": [{
7591
+ mask: ["add", "subtract", "intersect", "exclude"]
7592
+ }],
7593
+ /**
7594
+ * Mask Image
7595
+ * @see https://tailwindcss.com/docs/mask-image
7596
+ */
7597
+ "mask-image-linear-pos": [{
7598
+ "mask-linear": [isNumber]
7599
+ }],
7600
+ "mask-image-linear-from-pos": [{
7601
+ "mask-linear-from": scaleMaskImagePosition()
7602
+ }],
7603
+ "mask-image-linear-to-pos": [{
7604
+ "mask-linear-to": scaleMaskImagePosition()
7605
+ }],
7606
+ "mask-image-linear-from-color": [{
7607
+ "mask-linear-from": scaleColor()
7608
+ }],
7609
+ "mask-image-linear-to-color": [{
7610
+ "mask-linear-to": scaleColor()
7611
+ }],
7612
+ "mask-image-t-from-pos": [{
7613
+ "mask-t-from": scaleMaskImagePosition()
7614
+ }],
7615
+ "mask-image-t-to-pos": [{
7616
+ "mask-t-to": scaleMaskImagePosition()
7617
+ }],
7618
+ "mask-image-t-from-color": [{
7619
+ "mask-t-from": scaleColor()
7620
+ }],
7621
+ "mask-image-t-to-color": [{
7622
+ "mask-t-to": scaleColor()
7623
+ }],
7624
+ "mask-image-r-from-pos": [{
7625
+ "mask-r-from": scaleMaskImagePosition()
7626
+ }],
7627
+ "mask-image-r-to-pos": [{
7628
+ "mask-r-to": scaleMaskImagePosition()
7629
+ }],
7630
+ "mask-image-r-from-color": [{
7631
+ "mask-r-from": scaleColor()
7632
+ }],
7633
+ "mask-image-r-to-color": [{
7634
+ "mask-r-to": scaleColor()
7635
+ }],
7636
+ "mask-image-b-from-pos": [{
7637
+ "mask-b-from": scaleMaskImagePosition()
7638
+ }],
7639
+ "mask-image-b-to-pos": [{
7640
+ "mask-b-to": scaleMaskImagePosition()
7641
+ }],
7642
+ "mask-image-b-from-color": [{
7643
+ "mask-b-from": scaleColor()
7644
+ }],
7645
+ "mask-image-b-to-color": [{
7646
+ "mask-b-to": scaleColor()
7647
+ }],
7648
+ "mask-image-l-from-pos": [{
7649
+ "mask-l-from": scaleMaskImagePosition()
7650
+ }],
7651
+ "mask-image-l-to-pos": [{
7652
+ "mask-l-to": scaleMaskImagePosition()
7653
+ }],
7654
+ "mask-image-l-from-color": [{
7655
+ "mask-l-from": scaleColor()
7656
+ }],
7657
+ "mask-image-l-to-color": [{
7658
+ "mask-l-to": scaleColor()
7659
+ }],
7660
+ "mask-image-x-from-pos": [{
7661
+ "mask-x-from": scaleMaskImagePosition()
7662
+ }],
7663
+ "mask-image-x-to-pos": [{
7664
+ "mask-x-to": scaleMaskImagePosition()
7665
+ }],
7666
+ "mask-image-x-from-color": [{
7667
+ "mask-x-from": scaleColor()
7668
+ }],
7669
+ "mask-image-x-to-color": [{
7670
+ "mask-x-to": scaleColor()
7671
+ }],
7672
+ "mask-image-y-from-pos": [{
7673
+ "mask-y-from": scaleMaskImagePosition()
7674
+ }],
7675
+ "mask-image-y-to-pos": [{
7676
+ "mask-y-to": scaleMaskImagePosition()
7677
+ }],
7678
+ "mask-image-y-from-color": [{
7679
+ "mask-y-from": scaleColor()
7680
+ }],
7681
+ "mask-image-y-to-color": [{
7682
+ "mask-y-to": scaleColor()
7683
+ }],
7684
+ "mask-image-radial": [{
7685
+ "mask-radial": [isArbitraryVariable, isArbitraryValue]
7686
+ }],
7687
+ "mask-image-radial-from-pos": [{
7688
+ "mask-radial-from": scaleMaskImagePosition()
7689
+ }],
7690
+ "mask-image-radial-to-pos": [{
7691
+ "mask-radial-to": scaleMaskImagePosition()
7692
+ }],
7693
+ "mask-image-radial-from-color": [{
7694
+ "mask-radial-from": scaleColor()
7695
+ }],
7696
+ "mask-image-radial-to-color": [{
7697
+ "mask-radial-to": scaleColor()
7698
+ }],
7699
+ "mask-image-radial-shape": [{
7700
+ "mask-radial": ["circle", "ellipse"]
7701
+ }],
7702
+ "mask-image-radial-size": [{
7703
+ "mask-radial": [{
7704
+ closest: ["side", "corner"],
7705
+ farthest: ["side", "corner"]
7706
+ }]
7707
+ }],
7708
+ "mask-image-radial-pos": [{
7709
+ "mask-radial-at": scalePosition()
7710
+ }],
7711
+ "mask-image-conic-pos": [{
7712
+ "mask-conic": [isNumber]
7713
+ }],
7714
+ "mask-image-conic-from-pos": [{
7715
+ "mask-conic-from": scaleMaskImagePosition()
7716
+ }],
7717
+ "mask-image-conic-to-pos": [{
7718
+ "mask-conic-to": scaleMaskImagePosition()
7719
+ }],
7720
+ "mask-image-conic-from-color": [{
7721
+ "mask-conic-from": scaleColor()
7722
+ }],
7723
+ "mask-image-conic-to-color": [{
7724
+ "mask-conic-to": scaleColor()
7725
+ }],
7726
+ /**
7727
+ * Mask Mode
7728
+ * @see https://tailwindcss.com/docs/mask-mode
7729
+ */
7730
+ "mask-mode": [{
7731
+ mask: ["alpha", "luminance", "match"]
7732
+ }],
7733
+ /**
7734
+ * Mask Origin
7735
+ * @see https://tailwindcss.com/docs/mask-origin
7736
+ */
7737
+ "mask-origin": [{
7738
+ "mask-origin": ["border", "padding", "content", "fill", "stroke", "view"]
7739
+ }],
7740
+ /**
7741
+ * Mask Position
7742
+ * @see https://tailwindcss.com/docs/mask-position
7743
+ */
7744
+ "mask-position": [{
7745
+ mask: scaleBgPosition()
7746
+ }],
7747
+ /**
7748
+ * Mask Repeat
7749
+ * @see https://tailwindcss.com/docs/mask-repeat
7750
+ */
7751
+ "mask-repeat": [{
7752
+ mask: scaleBgRepeat()
7753
+ }],
7754
+ /**
7755
+ * Mask Size
7756
+ * @see https://tailwindcss.com/docs/mask-size
7757
+ */
7758
+ "mask-size": [{
7759
+ mask: scaleBgSize()
7760
+ }],
7761
+ /**
7762
+ * Mask Type
7763
+ * @see https://tailwindcss.com/docs/mask-type
7764
+ */
7765
+ "mask-type": [{
7766
+ "mask-type": ["alpha", "luminance"]
7767
+ }],
7768
+ /**
7769
+ * Mask Image
7770
+ * @see https://tailwindcss.com/docs/mask-image
7771
+ */
7772
+ "mask-image": [{
7773
+ mask: ["none", isArbitraryVariable, isArbitraryValue]
7774
+ }],
7481
7775
  // ---------------
7482
7776
  // --- Filters ---
7483
7777
  // ---------------
@@ -7525,10 +7819,17 @@ const getDefaultConfig = () => {
7525
7819
  "",
7526
7820
  "none",
7527
7821
  themeDropShadow,
7528
- isArbitraryVariable,
7529
- isArbitraryValue
7822
+ isArbitraryVariableShadow,
7823
+ isArbitraryShadow
7530
7824
  ]
7531
7825
  }],
7826
+ /**
7827
+ * Drop Shadow Color
7828
+ * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
7829
+ */
7830
+ "drop-shadow-color": [{
7831
+ "drop-shadow": scaleColor()
7832
+ }],
7532
7833
  /**
7533
7834
  * Grayscale
7534
7835
  * @see https://tailwindcss.com/docs/grayscale
@@ -7752,7 +8053,7 @@ const getDefaultConfig = () => {
7752
8053
  * @see https://tailwindcss.com/docs/perspective-origin
7753
8054
  */
7754
8055
  "perspective-origin": [{
7755
- "perspective-origin": scaleOrigin()
8056
+ "perspective-origin": scalePositionWithArbitrary()
7756
8057
  }],
7757
8058
  /**
7758
8059
  * Rotate
@@ -7848,7 +8149,7 @@ const getDefaultConfig = () => {
7848
8149
  * @see https://tailwindcss.com/docs/transform-origin
7849
8150
  */
7850
8151
  "transform-origin": [{
7851
- origin: scaleOrigin()
8152
+ origin: scalePositionWithArbitrary()
7852
8153
  }],
7853
8154
  /**
7854
8155
  * Transform Style
@@ -8216,10 +8517,10 @@ const getDefaultConfig = () => {
8216
8517
  "rounded-b": ["rounded-br", "rounded-bl"],
8217
8518
  "rounded-l": ["rounded-tl", "rounded-bl"],
8218
8519
  "border-spacing": ["border-spacing-x", "border-spacing-y"],
8219
- "border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
8520
+ "border-w": ["border-w-x", "border-w-y", "border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
8220
8521
  "border-w-x": ["border-w-r", "border-w-l"],
8221
8522
  "border-w-y": ["border-w-t", "border-w-b"],
8222
- "border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
8523
+ "border-color": ["border-color-x", "border-color-y", "border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
8223
8524
  "border-color-x": ["border-color-r", "border-color-l"],
8224
8525
  "border-color-y": ["border-color-t", "border-color-b"],
8225
8526
  translate: ["translate-x", "translate-y", "translate-none"],
@@ -8238,7 +8539,7 @@ const getDefaultConfig = () => {
8238
8539
  conflictingClassGroupModifiers: {
8239
8540
  "font-size": ["leading"]
8240
8541
  },
8241
- orderSensitiveModifiers: ["before", "after", "placeholder", "file", "marker", "selection", "first-line", "first-letter", "backdrop", "*", "**"]
8542
+ orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
8242
8543
  };
8243
8544
  };
8244
8545
  const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
@@ -8291,17 +8592,19 @@ function createCollection(name2) {
8291
8592
  };
8292
8593
  CollectionProvider.displayName = PROVIDER_NAME2;
8293
8594
  const COLLECTION_SLOT_NAME = name2 + "CollectionSlot";
8595
+ const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
8294
8596
  const CollectionSlot = React__default.forwardRef(
8295
8597
  (props, forwardedRef) => {
8296
8598
  const { scope, children } = props;
8297
8599
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
8298
8600
  const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
8299
- return /* @__PURE__ */ jsx$1(Slot, { ref: composedRefs, children });
8601
+ return /* @__PURE__ */ jsx$1(CollectionSlotImpl, { ref: composedRefs, children });
8300
8602
  }
8301
8603
  );
8302
8604
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
8303
8605
  const ITEM_SLOT_NAME = name2 + "CollectionItemSlot";
8304
8606
  const ITEM_DATA_ATTR = "data-radix-collection-item";
8607
+ const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
8305
8608
  const CollectionItemSlot = React__default.forwardRef(
8306
8609
  (props, forwardedRef) => {
8307
8610
  const { scope, children, ...itemData } = props;
@@ -8312,7 +8615,7 @@ function createCollection(name2) {
8312
8615
  context.itemMap.set(ref, { ref, ...itemData });
8313
8616
  return () => void context.itemMap.delete(ref);
8314
8617
  });
8315
- return /* @__PURE__ */ jsx$1(Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
8618
+ return /* @__PURE__ */ jsx$1(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
8316
8619
  }
8317
8620
  );
8318
8621
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
@@ -8372,10 +8675,11 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
8372
8675
  const ref = React.useRef(null);
8373
8676
  const composedRefs = useComposedRefs(forwardedRef, ref);
8374
8677
  const direction = useDirection(dir);
8375
- const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
8678
+ const [currentTabStopId, setCurrentTabStopId] = useControllableState({
8376
8679
  prop: currentTabStopIdProp,
8377
- defaultProp: defaultCurrentTabStopId,
8378
- onChange: onCurrentTabStopIdChange
8680
+ defaultProp: defaultCurrentTabStopId ?? null,
8681
+ onChange: onCurrentTabStopIdChange,
8682
+ caller: GROUP_NAME$2
8379
8683
  });
8380
8684
  const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
8381
8685
  const handleEntryFocus = useCallbackRef$1(onEntryFocus);
@@ -8453,6 +8757,7 @@ var RovingFocusGroupItem = React.forwardRef(
8453
8757
  focusable = true,
8454
8758
  active = false,
8455
8759
  tabStopId,
8760
+ children,
8456
8761
  ...itemProps
8457
8762
  } = props;
8458
8763
  const autoId = useId();
@@ -8460,7 +8765,7 @@ var RovingFocusGroupItem = React.forwardRef(
8460
8765
  const context = useRovingFocusContext(ITEM_NAME$2, __scopeRovingFocusGroup);
8461
8766
  const isCurrentTabStop = context.currentTabStopId === id;
8462
8767
  const getItems = useCollection$1(__scopeRovingFocusGroup);
8463
- const { onFocusableItemAdd, onFocusableItemRemove } = context;
8768
+ const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
8464
8769
  React.useEffect(() => {
8465
8770
  if (focusable) {
8466
8771
  onFocusableItemAdd();
@@ -8506,7 +8811,8 @@ var RovingFocusGroupItem = React.forwardRef(
8506
8811
  }
8507
8812
  setTimeout(() => focusFirst$1(candidateNodes));
8508
8813
  }
8509
- })
8814
+ }),
8815
+ children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
8510
8816
  }
8511
8817
  )
8512
8818
  }
@@ -8685,6 +8991,7 @@ var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
8685
8991
  }
8686
8992
  );
8687
8993
  });
8994
+ var Slot$1 = /* @__PURE__ */ createSlot("MenuContent.ScrollLock");
8688
8995
  var MenuContentImpl = React.forwardRef(
8689
8996
  (props, forwardedRef) => {
8690
8997
  const {
@@ -8718,7 +9025,7 @@ var MenuContentImpl = React.forwardRef(
8718
9025
  const pointerDirRef = React.useRef("right");
8719
9026
  const lastPointerXRef = React.useRef(0);
8720
9027
  const ScrollLockWrapper = disableOutsideScroll ? ReactRemoveScroll : React.Fragment;
8721
- const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;
9028
+ const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot$1, allowPinchZoom: true } : void 0;
8722
9029
  const handleTypeaheadSearch = (key) => {
8723
9030
  var _a2, _b2;
8724
9031
  const search = searchRef.current + key;
@@ -9302,10 +9609,12 @@ function isPointInPolygon$1(point, polygon2) {
9302
9609
  const { x: x2, y: y2 } = point;
9303
9610
  let inside = false;
9304
9611
  for (let i2 = 0, j = polygon2.length - 1; i2 < polygon2.length; j = i2++) {
9305
- const xi = polygon2[i2].x;
9306
- const yi = polygon2[i2].y;
9307
- const xj = polygon2[j].x;
9308
- const yj = polygon2[j].y;
9612
+ const ii = polygon2[i2];
9613
+ const jj = polygon2[j];
9614
+ const xi = ii.x;
9615
+ const yi = ii.y;
9616
+ const xj = jj.x;
9617
+ const yj = jj.y;
9309
9618
  const intersect = yi > y2 !== yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi;
9310
9619
  if (intersect) inside = !inside;
9311
9620
  }
@@ -9353,10 +9662,11 @@ var DropdownMenu$1 = (props) => {
9353
9662
  } = props;
9354
9663
  const menuScope = useMenuScope(__scopeDropdownMenu);
9355
9664
  const triggerRef = React.useRef(null);
9356
- const [open = false, setOpen] = useControllableState({
9665
+ const [open, setOpen] = useControllableState({
9357
9666
  prop: openProp,
9358
- defaultProp: defaultOpen,
9359
- onChange: onOpenChange
9667
+ defaultProp: defaultOpen ?? false,
9668
+ onChange: onOpenChange,
9669
+ caller: DROPDOWN_MENU_NAME
9360
9670
  });
9361
9671
  return /* @__PURE__ */ jsx$1(
9362
9672
  DropdownMenuProvider,
@@ -9588,10 +9898,11 @@ var Dialog = (props) => {
9588
9898
  } = props;
9589
9899
  const triggerRef = React.useRef(null);
9590
9900
  const contentRef = React.useRef(null);
9591
- const [open = false, setOpen] = useControllableState({
9901
+ const [open, setOpen] = useControllableState({
9592
9902
  prop: openProp,
9593
- defaultProp: defaultOpen,
9594
- onChange: onOpenChange
9903
+ defaultProp: defaultOpen ?? false,
9904
+ onChange: onOpenChange,
9905
+ caller: DIALOG_NAME
9595
9906
  });
9596
9907
  return /* @__PURE__ */ jsx$1(
9597
9908
  DialogProvider,
@@ -9653,6 +9964,7 @@ var DialogOverlay = React.forwardRef(
9653
9964
  }
9654
9965
  );
9655
9966
  DialogOverlay.displayName = OVERLAY_NAME;
9967
+ var Slot = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
9656
9968
  var DialogOverlayImpl = React.forwardRef(
9657
9969
  (props, forwardedRef) => {
9658
9970
  const { __scopeDialog, ...overlayProps } = props;
@@ -9876,6 +10188,19 @@ var Overlay = DialogOverlay;
9876
10188
  var Content$3 = DialogContent;
9877
10189
  var Title = DialogTitle;
9878
10190
  var Description = DialogDescription;
10191
+ var VISUALLY_HIDDEN_STYLES = Object.freeze({
10192
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
10193
+ position: "absolute",
10194
+ border: 0,
10195
+ width: 1,
10196
+ height: 1,
10197
+ padding: 0,
10198
+ margin: -1,
10199
+ overflow: "hidden",
10200
+ clip: "rect(0, 0, 0, 0)",
10201
+ whiteSpace: "nowrap",
10202
+ wordWrap: "normal"
10203
+ });
9879
10204
  var NAME = "VisuallyHidden";
9880
10205
  var VisuallyHidden = React.forwardRef(
9881
10206
  (props, forwardedRef) => {
@@ -9884,20 +10209,7 @@ var VisuallyHidden = React.forwardRef(
9884
10209
  {
9885
10210
  ...props,
9886
10211
  ref: forwardedRef,
9887
- style: {
9888
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
9889
- position: "absolute",
9890
- border: 0,
9891
- width: 1,
9892
- height: 1,
9893
- padding: 0,
9894
- margin: -1,
9895
- overflow: "hidden",
9896
- clip: "rect(0, 0, 0, 0)",
9897
- whiteSpace: "nowrap",
9898
- wordWrap: "normal",
9899
- ...props.style
9900
- }
10212
+ style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
9901
10213
  }
9902
10214
  );
9903
10215
  }
@@ -15079,7 +15391,7 @@ function ConnectDropdownMenu(props) {
15079
15391
  return jsxs(DropdownMenu, { onOpenChange, open, children: [jsx$1(DropdownMenuTrigger, { asChild: true, className: "outline-none", children }), jsx$1(DropdownMenuContent, { className: "modal-shadow cursor-pointer rounded-2xl bg-white text-sm font-medium text-slate-500", children: items.map(({ id, label, icon, className }) => jsxs(DropdownMenuItem, { className: twMerge("flex items-center px-5 py-2 outline-none first-of-type:rounded-t-2xl first-of-type:pt-3 last-of-type:rounded-b-2xl last-of-type:pb-3 hover:bg-slate-50", className), onClick: (e2) => e2.stopPropagation(), onSelect: () => onItemClick(id), children: [icon ? jsx$1("span", { className: "mr-2 inline-block", children: icon }) : null, label] }, id)) })] });
15080
15392
  }
15081
15393
  const ImgPowerhouse = "/assets/powerhouse-rounded-CeKGGUG4.png";
15082
- const version$5 = "2.24.1";
15394
+ const version$5 = "2.28.0";
15083
15395
  let errorConfig = {
15084
15396
  getDocsUrl: ({ docsBaseUrl, docsPath: docsPath2 = "", docsSlug }) => docsPath2 ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath2}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
15085
15397
  version: `viem@${version$5}`
@@ -15531,6 +15843,29 @@ class AbiEncodingLengthMismatchError extends BaseError$4 {
15531
15843
  ].join("\n"), { name: "AbiEncodingLengthMismatchError" });
15532
15844
  }
15533
15845
  }
15846
+ class AbiErrorInputsNotFoundError extends BaseError$4 {
15847
+ constructor(errorName, { docsPath: docsPath2 }) {
15848
+ super([
15849
+ `Arguments (\`args\`) were provided to "${errorName}", but "${errorName}" on the ABI does not contain any parameters (\`inputs\`).`,
15850
+ "Cannot encode error result without knowing what the parameter types are.",
15851
+ "Make sure you are using the correct ABI and that the inputs exist on it."
15852
+ ].join("\n"), {
15853
+ docsPath: docsPath2,
15854
+ name: "AbiErrorInputsNotFoundError"
15855
+ });
15856
+ }
15857
+ }
15858
+ class AbiErrorNotFoundError extends BaseError$4 {
15859
+ constructor(errorName, { docsPath: docsPath2 } = {}) {
15860
+ super([
15861
+ `Error ${errorName ? `"${errorName}" ` : ""}not found on ABI.`,
15862
+ "Make sure you are using the correct ABI and that the error exists on it."
15863
+ ].join("\n"), {
15864
+ docsPath: docsPath2,
15865
+ name: "AbiErrorNotFoundError"
15866
+ });
15867
+ }
15868
+ }
15534
15869
  class AbiErrorSignatureNotFoundError extends BaseError$4 {
15535
15870
  constructor(signature, { docsPath: docsPath2 }) {
15536
15871
  super([
@@ -15604,6 +15939,18 @@ class AbiFunctionOutputsNotFoundError extends BaseError$4 {
15604
15939
  });
15605
15940
  }
15606
15941
  }
15942
+ class AbiFunctionSignatureNotFoundError extends BaseError$4 {
15943
+ constructor(signature, { docsPath: docsPath2 }) {
15944
+ super([
15945
+ `Encoded function signature "${signature}" not found on ABI.`,
15946
+ "Make sure you are using the correct ABI and that the function exists on it.",
15947
+ `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`
15948
+ ].join("\n"), {
15949
+ docsPath: docsPath2,
15950
+ name: "AbiFunctionSignatureNotFoundError"
15951
+ });
15952
+ }
15953
+ }
15607
15954
  class AbiItemAmbiguityError extends BaseError$4 {
15608
15955
  constructor(x2, y2) {
15609
15956
  super("Found ambiguous types in overloaded ABI items.", {
@@ -15844,14 +16191,15 @@ function byteSwap32(arr) {
15844
16191
  arr[i2] = byteSwap(arr[i2]);
15845
16192
  }
15846
16193
  }
15847
- function utf8ToBytes$1(str) {
16194
+ typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
16195
+ function utf8ToBytes(str) {
15848
16196
  if (typeof str !== "string")
15849
16197
  throw new Error("utf8ToBytes expected string, got " + typeof str);
15850
16198
  return new Uint8Array(new TextEncoder().encode(str));
15851
16199
  }
15852
16200
  function toBytes(data) {
15853
16201
  if (typeof data === "string")
15854
- data = utf8ToBytes$1(data);
16202
+ data = utf8ToBytes(data);
15855
16203
  abytes$1(data);
15856
16204
  return data;
15857
16205
  }
@@ -15889,7 +16237,7 @@ function randomBytes(bytesLength = 32) {
15889
16237
  return crypto$1.getRandomValues(new Uint8Array(bytesLength));
15890
16238
  }
15891
16239
  if (crypto$1 && typeof crypto$1.randomBytes === "function") {
15892
- return crypto$1.randomBytes(bytesLength);
16240
+ return Uint8Array.from(crypto$1.randomBytes(bytesLength));
15893
16241
  }
15894
16242
  throw new Error("crypto.getRandomValues must be defined");
15895
16243
  }
@@ -15898,7 +16246,7 @@ const SHA3_ROTL = [];
15898
16246
  const _SHA3_IOTA = [];
15899
16247
  const _0n$4 = /* @__PURE__ */ BigInt(0);
15900
16248
  const _1n$5 = /* @__PURE__ */ BigInt(1);
15901
- const _2n$3 = /* @__PURE__ */ BigInt(2);
16249
+ const _2n$2 = /* @__PURE__ */ BigInt(2);
15902
16250
  const _7n = /* @__PURE__ */ BigInt(7);
15903
16251
  const _256n = /* @__PURE__ */ BigInt(256);
15904
16252
  const _0x71n = /* @__PURE__ */ BigInt(113);
@@ -15909,7 +16257,7 @@ for (let round2 = 0, R2 = _1n$5, x2 = 1, y2 = 0; round2 < 24; round2++) {
15909
16257
  let t2 = _0n$4;
15910
16258
  for (let j = 0; j < 7; j++) {
15911
16259
  R2 = (R2 << _1n$5 ^ (R2 >> _7n) * _0x71n) % _256n;
15912
- if (R2 & _2n$3)
16260
+ if (R2 & _2n$2)
15913
16261
  t2 ^= _1n$5 << (_1n$5 << /* @__PURE__ */ BigInt(j)) - _1n$5;
15914
16262
  }
15915
16263
  _SHA3_IOTA.push(t2);
@@ -15961,15 +16309,16 @@ class Keccak extends Hash {
15961
16309
  // NOTE: we accept arguments in bytes instead of bits here.
15962
16310
  constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
15963
16311
  super();
16312
+ this.pos = 0;
16313
+ this.posOut = 0;
16314
+ this.finished = false;
16315
+ this.destroyed = false;
16316
+ this.enableXOF = false;
15964
16317
  this.blockLen = blockLen;
15965
16318
  this.suffix = suffix;
15966
16319
  this.outputLen = outputLen;
15967
16320
  this.enableXOF = enableXOF;
15968
16321
  this.rounds = rounds;
15969
- this.pos = 0;
15970
- this.posOut = 0;
15971
- this.finished = false;
15972
- this.destroyed = false;
15973
16322
  anumber(outputLen);
15974
16323
  if (0 >= this.blockLen || this.blockLen >= 200)
15975
16324
  throw new Error("Sha3 supports only keccak-f1600 function");
@@ -16371,18 +16720,18 @@ function getArrayComponents$1(type) {
16371
16720
  [matches[2] ? Number(matches[2]) : null, matches[1]]
16372
16721
  ) : void 0;
16373
16722
  }
16374
- const docsPath$4 = "/docs/contract/encodeDeployData";
16723
+ const docsPath$6 = "/docs/contract/encodeDeployData";
16375
16724
  function encodeDeployData(parameters) {
16376
16725
  const { abi: abi2, args, bytecode } = parameters;
16377
16726
  if (!args || args.length === 0)
16378
16727
  return bytecode;
16379
16728
  const description = abi2.find((x2) => "type" in x2 && x2.type === "constructor");
16380
16729
  if (!description)
16381
- throw new AbiConstructorNotFoundError({ docsPath: docsPath$4 });
16730
+ throw new AbiConstructorNotFoundError({ docsPath: docsPath$6 });
16382
16731
  if (!("inputs" in description))
16383
- throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath$4 });
16732
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath$6 });
16384
16733
  if (!description.inputs || description.inputs.length === 0)
16385
- throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath$4 });
16734
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath$6 });
16386
16735
  const data = encodeAbiParameters(description.inputs, args);
16387
16736
  return concatHex([bytecode, data]);
16388
16737
  }
@@ -17437,6 +17786,111 @@ Object.defineProperty(SwitchChainError, "code", {
17437
17786
  writable: true,
17438
17787
  value: 4902
17439
17788
  });
17789
+ class UnsupportedNonOptionalCapabilityError extends ProviderRpcError {
17790
+ constructor(cause) {
17791
+ super(cause, {
17792
+ code: UnsupportedNonOptionalCapabilityError.code,
17793
+ name: "UnsupportedNonOptionalCapabilityError",
17794
+ shortMessage: "This Wallet does not support a capability that was not marked as optional."
17795
+ });
17796
+ }
17797
+ }
17798
+ Object.defineProperty(UnsupportedNonOptionalCapabilityError, "code", {
17799
+ enumerable: true,
17800
+ configurable: true,
17801
+ writable: true,
17802
+ value: 5700
17803
+ });
17804
+ class UnsupportedChainIdError extends ProviderRpcError {
17805
+ constructor(cause) {
17806
+ super(cause, {
17807
+ code: UnsupportedChainIdError.code,
17808
+ name: "UnsupportedChainIdError",
17809
+ shortMessage: "This Wallet does not support the requested chain ID."
17810
+ });
17811
+ }
17812
+ }
17813
+ Object.defineProperty(UnsupportedChainIdError, "code", {
17814
+ enumerable: true,
17815
+ configurable: true,
17816
+ writable: true,
17817
+ value: 5710
17818
+ });
17819
+ class DuplicateIdError extends ProviderRpcError {
17820
+ constructor(cause) {
17821
+ super(cause, {
17822
+ code: DuplicateIdError.code,
17823
+ name: "DuplicateIdError",
17824
+ shortMessage: "There is already a bundle submitted with this ID."
17825
+ });
17826
+ }
17827
+ }
17828
+ Object.defineProperty(DuplicateIdError, "code", {
17829
+ enumerable: true,
17830
+ configurable: true,
17831
+ writable: true,
17832
+ value: 5720
17833
+ });
17834
+ class UnknownBundleIdError extends ProviderRpcError {
17835
+ constructor(cause) {
17836
+ super(cause, {
17837
+ code: UnknownBundleIdError.code,
17838
+ name: "UnknownBundleIdError",
17839
+ shortMessage: "This bundle id is unknown / has not been submitted"
17840
+ });
17841
+ }
17842
+ }
17843
+ Object.defineProperty(UnknownBundleIdError, "code", {
17844
+ enumerable: true,
17845
+ configurable: true,
17846
+ writable: true,
17847
+ value: 5730
17848
+ });
17849
+ class BundleTooLargeError extends ProviderRpcError {
17850
+ constructor(cause) {
17851
+ super(cause, {
17852
+ code: BundleTooLargeError.code,
17853
+ name: "BundleTooLargeError",
17854
+ shortMessage: "The call bundle is too large for the Wallet to process."
17855
+ });
17856
+ }
17857
+ }
17858
+ Object.defineProperty(BundleTooLargeError, "code", {
17859
+ enumerable: true,
17860
+ configurable: true,
17861
+ writable: true,
17862
+ value: 5740
17863
+ });
17864
+ class AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError {
17865
+ constructor(cause) {
17866
+ super(cause, {
17867
+ code: AtomicReadyWalletRejectedUpgradeError.code,
17868
+ name: "AtomicReadyWalletRejectedUpgradeError",
17869
+ shortMessage: "The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."
17870
+ });
17871
+ }
17872
+ }
17873
+ Object.defineProperty(AtomicReadyWalletRejectedUpgradeError, "code", {
17874
+ enumerable: true,
17875
+ configurable: true,
17876
+ writable: true,
17877
+ value: 5750
17878
+ });
17879
+ class AtomicityNotSupportedError extends ProviderRpcError {
17880
+ constructor(cause) {
17881
+ super(cause, {
17882
+ code: AtomicityNotSupportedError.code,
17883
+ name: "AtomicityNotSupportedError",
17884
+ shortMessage: "The wallet does not support atomic execution but the request requires it."
17885
+ });
17886
+ }
17887
+ }
17888
+ Object.defineProperty(AtomicityNotSupportedError, "code", {
17889
+ enumerable: true,
17890
+ configurable: true,
17891
+ writable: true,
17892
+ value: 5760
17893
+ });
17440
17894
  class UnknownRpcError extends RpcError {
17441
17895
  constructor(cause) {
17442
17896
  super(cause, {
@@ -18141,14 +18595,14 @@ function Maj(a2, b2, c2) {
18141
18595
  class HashMD extends Hash {
18142
18596
  constructor(blockLen, outputLen, padOffset, isLE2) {
18143
18597
  super();
18144
- this.blockLen = blockLen;
18145
- this.outputLen = outputLen;
18146
- this.padOffset = padOffset;
18147
- this.isLE = isLE2;
18148
18598
  this.finished = false;
18149
18599
  this.length = 0;
18150
18600
  this.pos = 0;
18151
18601
  this.destroyed = false;
18602
+ this.blockLen = blockLen;
18603
+ this.outputLen = outputLen;
18604
+ this.padOffset = padOffset;
18605
+ this.isLE = isLE2;
18152
18606
  this.buffer = new Uint8Array(blockLen);
18153
18607
  this.view = createView(this.buffer);
18154
18608
  }
@@ -18302,8 +18756,8 @@ const SHA256_IV = /* @__PURE__ */ new Uint32Array([
18302
18756
  ]);
18303
18757
  const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
18304
18758
  class SHA256 extends HashMD {
18305
- constructor() {
18306
- super(64, 32, 8, false);
18759
+ constructor(outputLen = 32) {
18760
+ super(64, outputLen, 8, false);
18307
18761
  this.A = SHA256_IV[0] | 0;
18308
18762
  this.B = SHA256_IV[1] | 0;
18309
18763
  this.C = SHA256_IV[2] | 0;
@@ -18674,6 +19128,57 @@ const multicall3Abi = [
18674
19128
  type: "function"
18675
19129
  }
18676
19130
  ];
19131
+ const batchGatewayAbi = [
19132
+ {
19133
+ name: "query",
19134
+ type: "function",
19135
+ stateMutability: "view",
19136
+ inputs: [
19137
+ {
19138
+ type: "tuple[]",
19139
+ name: "queries",
19140
+ components: [
19141
+ {
19142
+ type: "address",
19143
+ name: "sender"
19144
+ },
19145
+ {
19146
+ type: "string[]",
19147
+ name: "urls"
19148
+ },
19149
+ {
19150
+ type: "bytes",
19151
+ name: "data"
19152
+ }
19153
+ ]
19154
+ }
19155
+ ],
19156
+ outputs: [
19157
+ {
19158
+ type: "bool[]",
19159
+ name: "failures"
19160
+ },
19161
+ {
19162
+ type: "bytes[]",
19163
+ name: "responses"
19164
+ }
19165
+ ]
19166
+ },
19167
+ {
19168
+ name: "HttpError",
19169
+ type: "error",
19170
+ inputs: [
19171
+ {
19172
+ type: "uint16",
19173
+ name: "status"
19174
+ },
19175
+ {
19176
+ type: "string",
19177
+ name: "message"
19178
+ }
19179
+ ]
19180
+ }
19181
+ ];
18677
19182
  const universalResolverErrors = [
18678
19183
  {
18679
19184
  inputs: [],
@@ -19955,20 +20460,20 @@ function getAmbiguousTypes$1(sourceParameters, targetParameters, args) {
19955
20460
  }
19956
20461
  return;
19957
20462
  }
19958
- const docsPath$3 = "/docs/contract/decodeFunctionResult";
20463
+ const docsPath$5 = "/docs/contract/decodeFunctionResult";
19959
20464
  function decodeFunctionResult(parameters) {
19960
20465
  const { abi: abi2, args, functionName, data } = parameters;
19961
20466
  let abiItem = abi2[0];
19962
20467
  if (functionName) {
19963
20468
  const item = getAbiItem({ abi: abi2, args, name: functionName });
19964
20469
  if (!item)
19965
- throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath$3 });
20470
+ throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath$5 });
19966
20471
  abiItem = item;
19967
20472
  }
19968
20473
  if (abiItem.type !== "function")
19969
- throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath$3 });
20474
+ throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath$5 });
19970
20475
  if (!abiItem.outputs)
19971
- throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath: docsPath$3 });
20476
+ throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath: docsPath$5 });
19972
20477
  const values = decodeAbiParameters(abiItem.outputs, data);
19973
20478
  if (values && values.length > 1)
19974
20479
  return values;
@@ -19976,7 +20481,7 @@ function decodeFunctionResult(parameters) {
19976
20481
  return values[0];
19977
20482
  return void 0;
19978
20483
  }
19979
- const docsPath$2 = "/docs/contract/encodeFunctionData";
20484
+ const docsPath$4 = "/docs/contract/encodeFunctionData";
19980
20485
  function prepareEncodeFunctionData(parameters) {
19981
20486
  const { abi: abi2, args, functionName } = parameters;
19982
20487
  let abiItem = abi2[0];
@@ -19987,11 +20492,11 @@ function prepareEncodeFunctionData(parameters) {
19987
20492
  name: functionName
19988
20493
  });
19989
20494
  if (!item)
19990
- throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath$2 });
20495
+ throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath$4 });
19991
20496
  abiItem = item;
19992
20497
  }
19993
20498
  if (abiItem.type !== "function")
19994
- throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath$2 });
20499
+ throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath$4 });
19995
20500
  return {
19996
20501
  abi: [abiItem],
19997
20502
  functionName: toFunctionSelector(formatAbiItem$1(abiItem))
@@ -20346,6 +20851,100 @@ function isNullUniversalResolverError(err, callType) {
20346
20851
  return true;
20347
20852
  return false;
20348
20853
  }
20854
+ function decodeFunctionData(parameters) {
20855
+ const { abi: abi2, data } = parameters;
20856
+ const signature = slice$1(data, 0, 4);
20857
+ const description = abi2.find((x2) => x2.type === "function" && signature === toFunctionSelector(formatAbiItem$1(x2)));
20858
+ if (!description)
20859
+ throw new AbiFunctionSignatureNotFoundError(signature, {
20860
+ docsPath: "/docs/contract/decodeFunctionData"
20861
+ });
20862
+ return {
20863
+ functionName: description.name,
20864
+ args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbiParameters(description.inputs, slice$1(data, 4)) : void 0
20865
+ };
20866
+ }
20867
+ const docsPath$3 = "/docs/contract/encodeErrorResult";
20868
+ function encodeErrorResult(parameters) {
20869
+ const { abi: abi2, errorName, args } = parameters;
20870
+ let abiItem = abi2[0];
20871
+ if (errorName) {
20872
+ const item = getAbiItem({ abi: abi2, args, name: errorName });
20873
+ if (!item)
20874
+ throw new AbiErrorNotFoundError(errorName, { docsPath: docsPath$3 });
20875
+ abiItem = item;
20876
+ }
20877
+ if (abiItem.type !== "error")
20878
+ throw new AbiErrorNotFoundError(void 0, { docsPath: docsPath$3 });
20879
+ const definition = formatAbiItem$1(abiItem);
20880
+ const signature = toFunctionSelector(definition);
20881
+ let data = "0x";
20882
+ if (args && args.length > 0) {
20883
+ if (!abiItem.inputs)
20884
+ throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath: docsPath$3 });
20885
+ data = encodeAbiParameters(abiItem.inputs, args);
20886
+ }
20887
+ return concatHex([signature, data]);
20888
+ }
20889
+ const docsPath$2 = "/docs/contract/encodeFunctionResult";
20890
+ function encodeFunctionResult(parameters) {
20891
+ const { abi: abi2, functionName, result } = parameters;
20892
+ let abiItem = abi2[0];
20893
+ if (functionName) {
20894
+ const item = getAbiItem({ abi: abi2, name: functionName });
20895
+ if (!item)
20896
+ throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath$2 });
20897
+ abiItem = item;
20898
+ }
20899
+ if (abiItem.type !== "function")
20900
+ throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath$2 });
20901
+ if (!abiItem.outputs)
20902
+ throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath: docsPath$2 });
20903
+ const values = (() => {
20904
+ if (abiItem.outputs.length === 0)
20905
+ return [];
20906
+ if (abiItem.outputs.length === 1)
20907
+ return [result];
20908
+ if (Array.isArray(result))
20909
+ return result;
20910
+ throw new InvalidArrayError$1(result);
20911
+ })();
20912
+ return encodeAbiParameters(abiItem.outputs, values);
20913
+ }
20914
+ const localBatchGatewayUrl = "x-batch-gateway:true";
20915
+ async function localBatchGatewayRequest(parameters) {
20916
+ const { data, ccipRequest } = parameters;
20917
+ const { args: [queries] } = decodeFunctionData({ abi: batchGatewayAbi, data });
20918
+ const failures = [];
20919
+ const responses = [];
20920
+ await Promise.all(queries.map(async (query, i2) => {
20921
+ try {
20922
+ responses[i2] = await ccipRequest(query);
20923
+ failures[i2] = false;
20924
+ } catch (err) {
20925
+ failures[i2] = true;
20926
+ responses[i2] = encodeError(err);
20927
+ }
20928
+ }));
20929
+ return encodeFunctionResult({
20930
+ abi: batchGatewayAbi,
20931
+ functionName: "query",
20932
+ result: [failures, responses]
20933
+ });
20934
+ }
20935
+ function encodeError(error) {
20936
+ if (error.name === "HttpRequestError" && error.status)
20937
+ return encodeErrorResult({
20938
+ abi: batchGatewayAbi,
20939
+ errorName: "HttpError",
20940
+ args: [error.status, error.shortMessage]
20941
+ });
20942
+ return encodeErrorResult({
20943
+ abi: [solidityError],
20944
+ errorName: "Error",
20945
+ args: ["shortMessage" in error ? error.shortMessage : error.message]
20946
+ });
20947
+ }
20349
20948
  function encodedLabelToLabelhash(label) {
20350
20949
  if (label.length !== 66)
20351
20950
  return null;
@@ -20568,7 +21167,7 @@ async function call(client2, args) {
20568
21167
  } catch (err) {
20569
21168
  const data2 = getRevertErrorData(err);
20570
21169
  const { offchainLookup, offchainLookupSignature } = await __vitePreload(async () => {
20571
- const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-Eu5ix3yZ.js");
21170
+ const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-i-oLVbil.js");
20572
21171
  return { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 };
20573
21172
  }, true ? __vite__mapDeps([0,1,2,3]) : void 0);
20574
21173
  if (client2.ccipRead !== false && (data2 == null ? void 0 : data2.slice(0, 10)) === offchainLookupSignature && to)
@@ -20705,17 +21304,23 @@ async function readContract(client2, parameters) {
20705
21304
  });
20706
21305
  }
20707
21306
  }
20708
- async function getEnsAddress(client2, { blockNumber, blockTag, coinType, name: name2, gatewayUrls, strict, universalResolverAddress: universalResolverAddress_ }) {
20709
- let universalResolverAddress = universalResolverAddress_;
20710
- if (!universalResolverAddress) {
20711
- if (!client2.chain)
21307
+ async function getEnsAddress(client2, parameters) {
21308
+ const { blockNumber, blockTag, coinType, name: name2, gatewayUrls, strict } = parameters;
21309
+ const { chain } = client2;
21310
+ const universalResolverAddress = (() => {
21311
+ if (parameters.universalResolverAddress)
21312
+ return parameters.universalResolverAddress;
21313
+ if (!chain)
20712
21314
  throw new Error("client chain not configured. universalResolverAddress is required.");
20713
- universalResolverAddress = getChainContractAddress({
21315
+ return getChainContractAddress({
20714
21316
  blockNumber,
20715
- chain: client2.chain,
21317
+ chain,
20716
21318
  contract: "ensUniversalResolver"
20717
21319
  });
20718
- }
21320
+ })();
21321
+ const tlds = chain == null ? void 0 : chain.ensTlds;
21322
+ if (tlds && !tlds.some((tld) => name2.endsWith(tld)))
21323
+ return null;
20719
21324
  try {
20720
21325
  const functionData = encodeFunctionData({
20721
21326
  abi: addressResolverAbi,
@@ -20726,15 +21331,16 @@ async function getEnsAddress(client2, { blockNumber, blockTag, coinType, name: n
20726
21331
  address: universalResolverAddress,
20727
21332
  abi: universalResolverResolveAbi,
20728
21333
  functionName: "resolve",
20729
- args: [toHex$1(packetToBytes(name2)), functionData],
21334
+ args: [
21335
+ toHex$1(packetToBytes(name2)),
21336
+ functionData,
21337
+ gatewayUrls ?? [localBatchGatewayUrl]
21338
+ ],
20730
21339
  blockNumber,
20731
21340
  blockTag
20732
21341
  };
20733
21342
  const readContractAction = getAction$1(client2, readContract, "readContract");
20734
- const res = gatewayUrls ? await readContractAction({
20735
- ...readContractParameters,
20736
- args: [...readContractParameters.args, gatewayUrls]
20737
- }) : await readContractAction(readContractParameters);
21343
+ const res = await readContractAction(readContractParameters);
20738
21344
  if (res[0] === "0x")
20739
21345
  return null;
20740
21346
  const address = decodeFunctionResult({
@@ -20982,17 +21588,23 @@ async function parseNftAvatarUri(client2, { gatewayUrls, record: record2 }) {
20982
21588
  uri: resolvedNftUri.replace(/(?:0x)?{id}/, uriTokenId)
20983
21589
  });
20984
21590
  }
20985
- async function getEnsText(client2, { blockNumber, blockTag, name: name2, key, gatewayUrls, strict, universalResolverAddress: universalResolverAddress_ }) {
20986
- let universalResolverAddress = universalResolverAddress_;
20987
- if (!universalResolverAddress) {
20988
- if (!client2.chain)
21591
+ async function getEnsText(client2, parameters) {
21592
+ const { blockNumber, blockTag, key, name: name2, gatewayUrls, strict } = parameters;
21593
+ const { chain } = client2;
21594
+ const universalResolverAddress = (() => {
21595
+ if (parameters.universalResolverAddress)
21596
+ return parameters.universalResolverAddress;
21597
+ if (!chain)
20989
21598
  throw new Error("client chain not configured. universalResolverAddress is required.");
20990
- universalResolverAddress = getChainContractAddress({
21599
+ return getChainContractAddress({
20991
21600
  blockNumber,
20992
- chain: client2.chain,
21601
+ chain,
20993
21602
  contract: "ensUniversalResolver"
20994
21603
  });
20995
- }
21604
+ })();
21605
+ const tlds = chain == null ? void 0 : chain.ensTlds;
21606
+ if (tlds && !tlds.some((tld) => name2.endsWith(tld)))
21607
+ return null;
20996
21608
  try {
20997
21609
  const readContractParameters = {
20998
21610
  address: universalResolverAddress,
@@ -21004,16 +21616,14 @@ async function getEnsText(client2, { blockNumber, blockTag, name: name2, key, ga
21004
21616
  abi: textResolverAbi,
21005
21617
  functionName: "text",
21006
21618
  args: [namehash(name2), key]
21007
- })
21619
+ }),
21620
+ gatewayUrls ?? [localBatchGatewayUrl]
21008
21621
  ],
21009
21622
  blockNumber,
21010
21623
  blockTag
21011
21624
  };
21012
21625
  const readContractAction = getAction$1(client2, readContract, "readContract");
21013
- const res = gatewayUrls ? await readContractAction({
21014
- ...readContractParameters,
21015
- args: [...readContractParameters.args, gatewayUrls]
21016
- }) : await readContractAction(readContractParameters);
21626
+ const res = await readContractAction(readContractParameters);
21017
21627
  if (res[0] === "0x")
21018
21628
  return null;
21019
21629
  const record2 = decodeFunctionResult({
@@ -21088,17 +21698,23 @@ async function getEnsName$1(client2, { address, blockNumber, blockTag, gatewayUr
21088
21698
  throw err;
21089
21699
  }
21090
21700
  }
21091
- async function getEnsResolver(client2, { blockNumber, blockTag, name: name2, universalResolverAddress: universalResolverAddress_ }) {
21092
- let universalResolverAddress = universalResolverAddress_;
21093
- if (!universalResolverAddress) {
21094
- if (!client2.chain)
21701
+ async function getEnsResolver(client2, parameters) {
21702
+ const { blockNumber, blockTag, name: name2 } = parameters;
21703
+ const { chain } = client2;
21704
+ const universalResolverAddress = (() => {
21705
+ if (parameters.universalResolverAddress)
21706
+ return parameters.universalResolverAddress;
21707
+ if (!chain)
21095
21708
  throw new Error("client chain not configured. universalResolverAddress is required.");
21096
- universalResolverAddress = getChainContractAddress({
21709
+ return getChainContractAddress({
21097
21710
  blockNumber,
21098
- chain: client2.chain,
21711
+ chain,
21099
21712
  contract: "ensUniversalResolver"
21100
21713
  });
21101
- }
21714
+ })();
21715
+ const tlds = chain == null ? void 0 : chain.ensTlds;
21716
+ if (tlds && !tlds.some((tld) => name2.endsWith(tld)))
21717
+ throw new Error(`${name2} is not a valid ENS TLD (${tlds == null ? void 0 : tlds.join(", ")}) for chain "${chain.name}" (id: ${chain.id}).`);
21102
21718
  const [resolverAddress] = await getAction$1(client2, readContract, "readContract")({
21103
21719
  address: universalResolverAddress,
21104
21720
  abi: [
@@ -21958,7 +22574,6 @@ async function multicall(client2, parameters) {
21958
22574
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
21959
22575
  const _0n$3 = /* @__PURE__ */ BigInt(0);
21960
22576
  const _1n$4 = /* @__PURE__ */ BigInt(1);
21961
- const _2n$2 = /* @__PURE__ */ BigInt(2);
21962
22577
  function isBytes(a2) {
21963
22578
  return a2 instanceof Uint8Array || ArrayBuffer.isView(a2) && a2.constructor.name === "Uint8Array";
21964
22579
  }
@@ -21970,15 +22585,6 @@ function abool(title, value) {
21970
22585
  if (typeof value !== "boolean")
21971
22586
  throw new Error(title + " boolean expected, got " + value);
21972
22587
  }
21973
- const hexes$1 = /* @__PURE__ */ Array.from({ length: 256 }, (_2, i2) => i2.toString(16).padStart(2, "0"));
21974
- function bytesToHex(bytes2) {
21975
- abytes(bytes2);
21976
- let hex = "";
21977
- for (let i2 = 0; i2 < bytes2.length; i2++) {
21978
- hex += hexes$1[bytes2[i2]];
21979
- }
21980
- return hex;
21981
- }
21982
22588
  function numberToHexUnpadded(num) {
21983
22589
  const hex = num.toString(16);
21984
22590
  return hex.length & 1 ? "0" + hex : hex;
@@ -21988,6 +22594,21 @@ function hexToNumber(hex) {
21988
22594
  throw new Error("hex string expected, got " + typeof hex);
21989
22595
  return hex === "" ? _0n$3 : BigInt("0x" + hex);
21990
22596
  }
22597
+ const hasHexBuiltin = (
22598
+ // @ts-ignore
22599
+ typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
22600
+ );
22601
+ const hexes$1 = /* @__PURE__ */ Array.from({ length: 256 }, (_2, i2) => i2.toString(16).padStart(2, "0"));
22602
+ function bytesToHex(bytes2) {
22603
+ abytes(bytes2);
22604
+ if (hasHexBuiltin)
22605
+ return bytes2.toHex();
22606
+ let hex = "";
22607
+ for (let i2 = 0; i2 < bytes2.length; i2++) {
22608
+ hex += hexes$1[bytes2[i2]];
22609
+ }
22610
+ return hex;
22611
+ }
21991
22612
  const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
21992
22613
  function asciiToBase16(ch) {
21993
22614
  if (ch >= asciis._0 && ch <= asciis._9)
@@ -22001,6 +22622,8 @@ function asciiToBase16(ch) {
22001
22622
  function hexToBytes(hex) {
22002
22623
  if (typeof hex !== "string")
22003
22624
  throw new Error("hex string expected, got " + typeof hex);
22625
+ if (hasHexBuiltin)
22626
+ return Uint8Array.fromHex(hex);
22004
22627
  const hl = hex.length;
22005
22628
  const al = hl / 2;
22006
22629
  if (hl % 2)
@@ -22030,9 +22653,6 @@ function numberToBytesBE(n2, len) {
22030
22653
  function numberToBytesLE(n2, len) {
22031
22654
  return numberToBytesBE(n2, len).reverse();
22032
22655
  }
22033
- function numberToVarBytesBE(n2) {
22034
- return hexToBytes(numberToHexUnpadded(n2));
22035
- }
22036
22656
  function ensureBytes(title, hex, expectedLength) {
22037
22657
  let res;
22038
22658
  if (typeof hex === "string") {
@@ -22066,19 +22686,6 @@ function concatBytes(...arrays) {
22066
22686
  }
22067
22687
  return res;
22068
22688
  }
22069
- function equalBytes(a2, b2) {
22070
- if (a2.length !== b2.length)
22071
- return false;
22072
- let diff = 0;
22073
- for (let i2 = 0; i2 < a2.length; i2++)
22074
- diff |= a2[i2] ^ b2[i2];
22075
- return diff === 0;
22076
- }
22077
- function utf8ToBytes(str) {
22078
- if (typeof str !== "string")
22079
- throw new Error("string expected");
22080
- return new Uint8Array(new TextEncoder().encode(str));
22081
- }
22082
22689
  const isPosBig = (n2) => typeof n2 === "bigint" && _0n$3 <= n2;
22083
22690
  function inRange(n2, min2, max2) {
22084
22691
  return isPosBig(n2) && isPosBig(min2) && isPosBig(max2) && min2 <= n2 && n2 < max2;
@@ -22093,14 +22700,8 @@ function bitLen(n2) {
22093
22700
  ;
22094
22701
  return len;
22095
22702
  }
22096
- function bitGet(n2, pos) {
22097
- return n2 >> BigInt(pos) & _1n$4;
22098
- }
22099
- function bitSet(n2, pos, value) {
22100
- return n2 | (value ? _1n$4 : _0n$3) << BigInt(pos);
22101
- }
22102
- const bitMask = (n2) => (_2n$2 << BigInt(n2 - 1)) - _1n$4;
22103
- const u8n = (data) => new Uint8Array(data);
22703
+ const bitMask = (n2) => (_1n$4 << BigInt(n2)) - _1n$4;
22704
+ const u8n = (len) => new Uint8Array(len);
22104
22705
  const u8fr = (arr) => Uint8Array.from(arr);
22105
22706
  function createHmacDrbg(hashLen, qByteLen, hmacFn) {
22106
22707
  if (typeof hashLen !== "number" || hashLen < 2)
@@ -22118,7 +22719,7 @@ function createHmacDrbg(hashLen, qByteLen, hmacFn) {
22118
22719
  i2 = 0;
22119
22720
  };
22120
22721
  const h2 = (...b2) => hmacFn(k2, v2, ...b2);
22121
- const reseed = (seed = u8n()) => {
22722
+ const reseed = (seed = u8n(0)) => {
22122
22723
  k2 = h2(u8fr([0]), seed);
22123
22724
  v2 = h2();
22124
22725
  if (seed.length === 0)
@@ -22179,9 +22780,6 @@ function validateObject(object, validators, optValidators = {}) {
22179
22780
  checkField(fieldName, type, true);
22180
22781
  return object;
22181
22782
  }
22182
- const notImplemented = () => {
22183
- throw new Error("not implemented");
22184
- };
22185
22783
  function memoized(fn) {
22186
22784
  const map = /* @__PURE__ */ new WeakMap();
22187
22785
  return (arg, ...args) => {
@@ -22193,35 +22791,6 @@ function memoized(fn) {
22193
22791
  return computed;
22194
22792
  };
22195
22793
  }
22196
- const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22197
- __proto__: null,
22198
- aInRange,
22199
- abool,
22200
- abytes,
22201
- bitGet,
22202
- bitLen,
22203
- bitMask,
22204
- bitSet,
22205
- bytesToHex,
22206
- bytesToNumberBE,
22207
- bytesToNumberLE,
22208
- concatBytes,
22209
- createHmacDrbg,
22210
- ensureBytes,
22211
- equalBytes,
22212
- hexToBytes,
22213
- hexToNumber,
22214
- inRange,
22215
- isBytes,
22216
- memoized,
22217
- notImplemented,
22218
- numberToBytesBE,
22219
- numberToBytesLE,
22220
- numberToHexUnpadded,
22221
- numberToVarBytesBE,
22222
- utf8ToBytes,
22223
- validateObject
22224
- }, Symbol.toStringTag, { value: "Module" }));
22225
22794
  const version$3 = "0.1.1";
22226
22795
  function getVersion$2() {
22227
22796
  return version$3;
@@ -23617,6 +24186,27 @@ function buildRequest(request2, options2 = {}) {
23617
24186
  // 4902
23618
24187
  case SwitchChainError.code:
23619
24188
  throw new SwitchChainError(err);
24189
+ // 5700
24190
+ case UnsupportedNonOptionalCapabilityError.code:
24191
+ throw new UnsupportedNonOptionalCapabilityError(err);
24192
+ // 5710
24193
+ case UnsupportedChainIdError.code:
24194
+ throw new UnsupportedChainIdError(err);
24195
+ // 5720
24196
+ case DuplicateIdError.code:
24197
+ throw new DuplicateIdError(err);
24198
+ // 5730
24199
+ case UnknownBundleIdError.code:
24200
+ throw new UnknownBundleIdError(err);
24201
+ // 5740
24202
+ case BundleTooLargeError.code:
24203
+ throw new BundleTooLargeError(err);
24204
+ // 5750
24205
+ case AtomicReadyWalletRejectedUpgradeError.code:
24206
+ throw new AtomicReadyWalletRejectedUpgradeError(err);
24207
+ // 5760
24208
+ case AtomicityNotSupportedError.code:
24209
+ throw new AtomicityNotSupportedError(err);
23620
24210
  // CAIP-25: User Rejected Error
23621
24211
  // https://docs.walletconnect.com/2.0/specs/clients/sign/error-codes#rejected-caip-25
23622
24212
  case 5e3:
@@ -25557,11 +26147,30 @@ function validateW(W2, bits) {
25557
26147
  if (!Number.isSafeInteger(W2) || W2 <= 0 || W2 > bits)
25558
26148
  throw new Error("invalid window size, expected [1.." + bits + "], got W=" + W2);
25559
26149
  }
25560
- function calcWOpts(W2, bits) {
25561
- validateW(W2, bits);
25562
- const windows = Math.ceil(bits / W2) + 1;
26150
+ function calcWOpts(W2, scalarBits) {
26151
+ validateW(W2, scalarBits);
26152
+ const windows = Math.ceil(scalarBits / W2) + 1;
25563
26153
  const windowSize = 2 ** (W2 - 1);
25564
- return { windows, windowSize };
26154
+ const maxNumber = 2 ** W2;
26155
+ const mask = bitMask(W2);
26156
+ const shiftBy = BigInt(W2);
26157
+ return { windows, windowSize, mask, maxNumber, shiftBy };
26158
+ }
26159
+ function calcOffsets(n2, window2, wOpts) {
26160
+ const { windowSize, mask, maxNumber, shiftBy } = wOpts;
26161
+ let wbits = Number(n2 & mask);
26162
+ let nextN = n2 >> shiftBy;
26163
+ if (wbits > windowSize) {
26164
+ wbits -= maxNumber;
26165
+ nextN += _1n$2;
26166
+ }
26167
+ const offsetStart = window2 * windowSize;
26168
+ const offset2 = offsetStart + Math.abs(wbits) - 1;
26169
+ const isZero = wbits === 0;
26170
+ const isNeg = wbits < 0;
26171
+ const isNegF = window2 % 2 !== 0;
26172
+ const offsetF = offsetStart;
26173
+ return { nextN, offset: offset2, isZero, isNeg, isNegF, offsetF };
25565
26174
  }
25566
26175
  function validateMSMPoints(points, c2) {
25567
26176
  if (!Array.isArray(points))
@@ -25637,28 +26246,16 @@ function wNAF(c2, bits) {
25637
26246
  * @returns real and fake (for const-time) points
25638
26247
  */
25639
26248
  wNAF(W2, precomputes, n2) {
25640
- const { windows, windowSize } = calcWOpts(W2, bits);
25641
26249
  let p2 = c2.ZERO;
25642
26250
  let f2 = c2.BASE;
25643
- const mask = BigInt(2 ** W2 - 1);
25644
- const maxNumber = 2 ** W2;
25645
- const shiftBy = BigInt(W2);
25646
- for (let window2 = 0; window2 < windows; window2++) {
25647
- const offset2 = window2 * windowSize;
25648
- let wbits = Number(n2 & mask);
25649
- n2 >>= shiftBy;
25650
- if (wbits > windowSize) {
25651
- wbits -= maxNumber;
25652
- n2 += _1n$2;
25653
- }
25654
- const offset1 = offset2;
25655
- const offset22 = offset2 + Math.abs(wbits) - 1;
25656
- const cond1 = window2 % 2 !== 0;
25657
- const cond2 = wbits < 0;
25658
- if (wbits === 0) {
25659
- f2 = f2.add(constTimeNegate(cond1, precomputes[offset1]));
26251
+ const wo = calcWOpts(W2, bits);
26252
+ for (let window2 = 0; window2 < wo.windows; window2++) {
26253
+ const { nextN, offset: offset2, isZero, isNeg, isNegF, offsetF } = calcOffsets(n2, window2, wo);
26254
+ n2 = nextN;
26255
+ if (isZero) {
26256
+ f2 = f2.add(constTimeNegate(isNegF, precomputes[offsetF]));
25660
26257
  } else {
25661
- p2 = p2.add(constTimeNegate(cond2, precomputes[offset22]));
26258
+ p2 = p2.add(constTimeNegate(isNeg, precomputes[offset2]));
25662
26259
  }
25663
26260
  }
25664
26261
  return { p: p2, f: f2 };
@@ -25672,26 +26269,18 @@ function wNAF(c2, bits) {
25672
26269
  * @returns point
25673
26270
  */
25674
26271
  wNAFUnsafe(W2, precomputes, n2, acc = c2.ZERO) {
25675
- const { windows, windowSize } = calcWOpts(W2, bits);
25676
- const mask = BigInt(2 ** W2 - 1);
25677
- const maxNumber = 2 ** W2;
25678
- const shiftBy = BigInt(W2);
25679
- for (let window2 = 0; window2 < windows; window2++) {
25680
- const offset2 = window2 * windowSize;
26272
+ const wo = calcWOpts(W2, bits);
26273
+ for (let window2 = 0; window2 < wo.windows; window2++) {
25681
26274
  if (n2 === _0n$1)
25682
26275
  break;
25683
- let wbits = Number(n2 & mask);
25684
- n2 >>= shiftBy;
25685
- if (wbits > windowSize) {
25686
- wbits -= maxNumber;
25687
- n2 += _1n$2;
25688
- }
25689
- if (wbits === 0)
26276
+ const { nextN, offset: offset2, isZero, isNeg } = calcOffsets(n2, window2, wo);
26277
+ n2 = nextN;
26278
+ if (isZero) {
25690
26279
  continue;
25691
- let curr = precomputes[offset2 + Math.abs(wbits) - 1];
25692
- if (wbits < 0)
25693
- curr = curr.negate();
25694
- acc = acc.add(curr);
26280
+ } else {
26281
+ const item = precomputes[offset2];
26282
+ acc = acc.add(isNeg ? item.negate() : item);
26283
+ }
25695
26284
  }
25696
26285
  return acc;
25697
26286
  },
@@ -25732,15 +26321,15 @@ function pippenger(c2, fieldN, points, scalars) {
25732
26321
  const zero = c2.ZERO;
25733
26322
  const wbits = bitLen(BigInt(points.length));
25734
26323
  const windowSize = wbits > 12 ? wbits - 3 : wbits > 4 ? wbits - 2 : wbits ? 2 : 1;
25735
- const MASK = (1 << windowSize) - 1;
25736
- const buckets = new Array(MASK + 1).fill(zero);
26324
+ const MASK = bitMask(windowSize);
26325
+ const buckets = new Array(Number(MASK) + 1).fill(zero);
25737
26326
  const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;
25738
26327
  let sum = zero;
25739
26328
  for (let i2 = lastBits; i2 >= 0; i2 -= windowSize) {
25740
26329
  buckets.fill(zero);
25741
26330
  for (let j = 0; j < scalars.length; j++) {
25742
26331
  const scalar = scalars[j];
25743
- const wbits2 = Number(scalar >> BigInt(i2) & BigInt(MASK));
26332
+ const wbits2 = Number(scalar >> BigInt(i2) & MASK);
25744
26333
  buckets[wbits2] = buckets[wbits2].add(points[j]);
25745
26334
  }
25746
26335
  let resI = zero;
@@ -25804,7 +26393,6 @@ function validatePointOpts(curve) {
25804
26393
  }
25805
26394
  return Object.freeze({ ...opts });
25806
26395
  }
25807
- const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;
25808
26396
  class DERErr extends Error {
25809
26397
  constructor(m2 = "") {
25810
26398
  super(m2);
@@ -25887,13 +26475,12 @@ const DER = {
25887
26475
  throw new E2("invalid signature integer: negative");
25888
26476
  if (data[0] === 0 && !(data[1] & 128))
25889
26477
  throw new E2("invalid signature integer: unnecessary leading zero");
25890
- return b2n(data);
26478
+ return bytesToNumberBE(data);
25891
26479
  }
25892
26480
  },
25893
26481
  toSig(hex) {
25894
26482
  const { Err: E2, _int: int, _tlv: tlv } = DER;
25895
- const data = typeof hex === "string" ? h2b(hex) : hex;
25896
- abytes(data);
26483
+ const data = ensureBytes("signature", hex);
25897
26484
  const { v: seqBytes, l: seqLeftBytes } = tlv.decode(48, data);
25898
26485
  if (seqLeftBytes.length)
25899
26486
  throw new E2("invalid signature: left bytes after parsing");
@@ -25960,7 +26547,7 @@ function weierstrassPoints(opts) {
25960
26547
  aInRange("private key", num, _1n$1, N10);
25961
26548
  return num;
25962
26549
  }
25963
- function assertPrjPoint(other) {
26550
+ function aprjpoint(other) {
25964
26551
  if (!(other instanceof Point))
25965
26552
  throw new Error("ProjectivePoint expected");
25966
26553
  }
@@ -25999,15 +26586,15 @@ function weierstrassPoints(opts) {
25999
26586
  });
26000
26587
  class Point {
26001
26588
  constructor(px, py, pz) {
26002
- this.px = px;
26003
- this.py = py;
26004
- this.pz = pz;
26005
26589
  if (px == null || !Fp.isValid(px))
26006
26590
  throw new Error("x required");
26007
26591
  if (py == null || !Fp.isValid(py))
26008
26592
  throw new Error("y required");
26009
26593
  if (pz == null || !Fp.isValid(pz))
26010
26594
  throw new Error("z required");
26595
+ this.px = px;
26596
+ this.py = py;
26597
+ this.pz = pz;
26011
26598
  Object.freeze(this);
26012
26599
  }
26013
26600
  // Does not validate if the point is on-curve.
@@ -26074,7 +26661,7 @@ function weierstrassPoints(opts) {
26074
26661
  * Compare one point to another.
26075
26662
  */
26076
26663
  equals(other) {
26077
- assertPrjPoint(other);
26664
+ aprjpoint(other);
26078
26665
  const { px: X1, py: Y1, pz: Z1 } = this;
26079
26666
  const { px: X2, py: Y2, pz: Z2 } = other;
26080
26667
  const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));
@@ -26134,7 +26721,7 @@ function weierstrassPoints(opts) {
26134
26721
  // https://eprint.iacr.org/2015/1060, algorithm 1
26135
26722
  // Cost: 12M + 0S + 3*a + 3*b3 + 23add.
26136
26723
  add(other) {
26137
- assertPrjPoint(other);
26724
+ aprjpoint(other);
26138
26725
  const { px: X1, py: Y1, pz: Z1 } = this;
26139
26726
  const { px: X2, py: Y2, pz: Z2 } = other;
26140
26727
  let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO;
@@ -26380,7 +26967,7 @@ function weierstrass(curveDef) {
26380
26967
  }
26381
26968
  }
26382
26969
  });
26383
- const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength));
26970
+ const numToNByteHex = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength));
26384
26971
  function isBiggerThanHalfOrder(number) {
26385
26972
  const HALF = CURVE_ORDER >> _1n$1;
26386
26973
  return number > HALF;
@@ -26391,10 +26978,13 @@ function weierstrass(curveDef) {
26391
26978
  const slcNum = (b2, from2, to) => bytesToNumberBE(b2.slice(from2, to));
26392
26979
  class Signature {
26393
26980
  constructor(r2, s2, recovery) {
26981
+ aInRange("r", r2, _1n$1, CURVE_ORDER);
26982
+ aInRange("s", s2, _1n$1, CURVE_ORDER);
26394
26983
  this.r = r2;
26395
26984
  this.s = s2;
26396
- this.recovery = recovery;
26397
- this.assertValidity();
26985
+ if (recovery != null)
26986
+ this.recovery = recovery;
26987
+ Object.freeze(this);
26398
26988
  }
26399
26989
  // pair (bytes of r, bytes of s)
26400
26990
  static fromCompact(hex) {
@@ -26408,9 +26998,11 @@ function weierstrass(curveDef) {
26408
26998
  const { r: r2, s: s2 } = DER.toSig(ensureBytes("DER", hex));
26409
26999
  return new Signature(r2, s2);
26410
27000
  }
27001
+ /**
27002
+ * @todo remove
27003
+ * @deprecated
27004
+ */
26411
27005
  assertValidity() {
26412
- aInRange("r", this.r, _1n$1, CURVE_ORDER);
26413
- aInRange("s", this.s, _1n$1, CURVE_ORDER);
26414
27006
  }
26415
27007
  addRecoveryBit(recovery) {
26416
27008
  return new Signature(this.r, this.s, recovery);
@@ -26424,7 +27016,7 @@ function weierstrass(curveDef) {
26424
27016
  if (radj >= Fp.ORDER)
26425
27017
  throw new Error("recovery id 2 or 3 invalid");
26426
27018
  const prefix2 = (rec & 1) === 0 ? "02" : "03";
26427
- const R2 = Point.fromHex(prefix2 + numToNByteStr(radj));
27019
+ const R2 = Point.fromHex(prefix2 + numToNByteHex(radj));
26428
27020
  const ir = invN(radj);
26429
27021
  const u1 = modN(-h2 * ir);
26430
27022
  const u2 = modN(s2 * ir);
@@ -26453,7 +27045,7 @@ function weierstrass(curveDef) {
26453
27045
  return hexToBytes(this.toCompactHex());
26454
27046
  }
26455
27047
  toCompactHex() {
26456
- return numToNByteStr(this.r) + numToNByteStr(this.s);
27048
+ return numToNByteHex(this.r) + numToNByteHex(this.s);
26457
27049
  }
26458
27050
  }
26459
27051
  const utils = {
@@ -26683,13 +27275,9 @@ function sqrtMod(y2) {
26683
27275
  const Fpk1 = Field(secp256k1P, void 0, void 0, { sqrt: sqrtMod });
26684
27276
  const secp256k1 = createCurve({
26685
27277
  a: BigInt(0),
26686
- // equation params: a, b
26687
27278
  b: BigInt(7),
26688
27279
  Fp: Fpk1,
26689
- // Field's prime: 2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n
26690
27280
  n: secp256k1N,
26691
- // Curve order, total count of valid points in the field
26692
- // Base point (x, y) aka generator point
26693
27281
  Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),
26694
27282
  Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),
26695
27283
  h: BigInt(1),
@@ -27003,7 +27591,7 @@ function getAction(client2, actionFn, name2) {
27003
27591
  return action_explicit;
27004
27592
  return (params) => actionFn(client2, params);
27005
27593
  }
27006
- const version$2 = "2.16.7";
27594
+ const version$2 = "2.17.0";
27007
27595
  const getVersion$1 = () => `@wagmi/core@${version$2}`;
27008
27596
  var __classPrivateFieldGet = function(receiver, state, kind, f2) {
27009
27597
  if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a getter");
@@ -28954,7 +29542,7 @@ function WagmiProvider(parameters) {
28954
29542
  const props = { value: config };
28955
29543
  return createElement(Hydrate, parameters, createElement(WagmiContext$1.Provider, props, children));
28956
29544
  }
28957
- const version$1 = "2.14.15";
29545
+ const version$1 = "2.15.0";
28958
29546
  const getVersion = () => `wagmi@${version$1}`;
28959
29547
  class BaseError5 extends BaseError$1 {
28960
29548
  constructor() {
@@ -29112,7 +29700,7 @@ function partialMatchKey(a2, b2) {
29112
29700
  return false;
29113
29701
  }
29114
29702
  if (a2 && b2 && typeof a2 === "object" && typeof b2 === "object") {
29115
- return !Object.keys(b2).some((key) => !partialMatchKey(a2[key], b2[key]));
29703
+ return Object.keys(b2).every((key) => partialMatchKey(a2[key], b2[key]));
29116
29704
  }
29117
29705
  return false;
29118
29706
  }
@@ -29487,6 +30075,7 @@ function createRetryer(config) {
29487
30075
  }
29488
30076
  };
29489
30077
  }
30078
+ var defaultScheduler = (cb) => setTimeout(cb, 0);
29490
30079
  function createNotifyManager() {
29491
30080
  let queue = [];
29492
30081
  let transactions = 0;
@@ -29496,7 +30085,7 @@ function createNotifyManager() {
29496
30085
  let batchNotifyFn = (callback) => {
29497
30086
  callback();
29498
30087
  };
29499
- let scheduleFn = (cb) => setTimeout(cb, 0);
30088
+ let scheduleFn = defaultScheduler;
29500
30089
  const schedule = (callback) => {
29501
30090
  if (transactions) {
29502
30091
  queue.push(callback);
@@ -30105,6 +30694,9 @@ var Mutation = (_f = class extends Removable {
30105
30694
  }
30106
30695
  async execute(variables) {
30107
30696
  var _a2, _b2, _c2, _d2, _e3, _f2, _g2, _h2, _i2, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
30697
+ const onContinue = () => {
30698
+ __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "continue" });
30699
+ };
30108
30700
  __privateSet(this, _retryer2, createRetryer({
30109
30701
  fn: () => {
30110
30702
  if (!this.options.mutationFn) {
@@ -30118,9 +30710,7 @@ var Mutation = (_f = class extends Removable {
30118
30710
  onPause: () => {
30119
30711
  __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "pause" });
30120
30712
  },
30121
- onContinue: () => {
30122
- __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "continue" });
30123
- },
30713
+ onContinue,
30124
30714
  retry: this.options.retry ?? 0,
30125
30715
  retryDelay: this.options.retryDelay,
30126
30716
  networkMode: this.options.networkMode,
@@ -30129,7 +30719,9 @@ var Mutation = (_f = class extends Removable {
30129
30719
  const restored = this.state.status === "pending";
30130
30720
  const isPaused = !__privateGet(this, _retryer2).canStart();
30131
30721
  try {
30132
- if (!restored) {
30722
+ if (restored) {
30723
+ onContinue();
30724
+ } else {
30133
30725
  __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "pending", variables, isPaused });
30134
30726
  await ((_b2 = (_a2 = __privateGet(this, _mutationCache).config).onMutate) == null ? void 0 : _b2.call(
30135
30727
  _a2,
@@ -30527,8 +31119,7 @@ var QueryClient = (_h = class {
30527
31119
  }
30528
31120
  mount() {
30529
31121
  __privateWrapper(this, _mountCount)._++;
30530
- if (__privateGet(this, _mountCount) !== 1)
30531
- return;
31122
+ if (__privateGet(this, _mountCount) !== 1) return;
30532
31123
  __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => {
30533
31124
  if (focused) {
30534
31125
  await this.resumePausedMutations();
@@ -30545,8 +31136,7 @@ var QueryClient = (_h = class {
30545
31136
  unmount() {
30546
31137
  var _a2, _b2;
30547
31138
  __privateWrapper(this, _mountCount)._--;
30548
- if (__privateGet(this, _mountCount) !== 0)
30549
- return;
31139
+ if (__privateGet(this, _mountCount) !== 0) return;
30550
31140
  (_a2 = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a2.call(this);
30551
31141
  __privateSet(this, _unsubscribeFocus, void 0);
30552
31142
  (_b2 = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b2.call(this);
@@ -30558,6 +31148,13 @@ var QueryClient = (_h = class {
30558
31148
  isMutating(filters) {
30559
31149
  return __privateGet(this, _mutationCache2).findAll({ ...filters, status: "pending" }).length;
30560
31150
  }
31151
+ /**
31152
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
31153
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
31154
+ *
31155
+ * Hint: Do not use this function inside a component, because it won't receive updates.
31156
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
31157
+ */
30561
31158
  getQueryData(queryKey) {
30562
31159
  var _a2;
30563
31160
  const options2 = this.defaultQueryOptions({ queryKey });
@@ -30980,40 +31577,18 @@ var QueryObserver = (_i = class extends Subscribable {
30980
31577
  }
30981
31578
  }
30982
31579
  let { error, errorUpdatedAt, status } = newState;
30983
- if (options2.select && newState.data !== void 0) {
30984
- if (prevResult && newState.data === (prevResultState == null ? void 0 : prevResultState.data) && options2.select === __privateGet(this, _selectFn)) {
30985
- data = __privateGet(this, _selectResult);
30986
- } else {
30987
- try {
30988
- __privateSet(this, _selectFn, options2.select);
30989
- data = options2.select(newState.data);
30990
- data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options2);
30991
- __privateSet(this, _selectResult, data);
30992
- __privateSet(this, _selectError, null);
30993
- } catch (selectError) {
30994
- __privateSet(this, _selectError, selectError);
30995
- }
30996
- }
30997
- } else {
30998
- data = newState.data;
30999
- }
31580
+ data = newState.data;
31581
+ let skipSelect = false;
31000
31582
  if (options2.placeholderData !== void 0 && data === void 0 && status === "pending") {
31001
31583
  let placeholderData;
31002
31584
  if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options2.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {
31003
31585
  placeholderData = prevResult.data;
31586
+ skipSelect = true;
31004
31587
  } else {
31005
31588
  placeholderData = typeof options2.placeholderData === "function" ? options2.placeholderData(
31006
31589
  (_a2 = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a2.state.data,
31007
31590
  __privateGet(this, _lastQueryWithDefinedData)
31008
31591
  ) : options2.placeholderData;
31009
- if (options2.select && placeholderData !== void 0) {
31010
- try {
31011
- placeholderData = options2.select(placeholderData);
31012
- __privateSet(this, _selectError, null);
31013
- } catch (selectError) {
31014
- __privateSet(this, _selectError, selectError);
31015
- }
31016
- }
31017
31592
  }
31018
31593
  if (placeholderData !== void 0) {
31019
31594
  status = "success";
@@ -31025,6 +31600,21 @@ var QueryObserver = (_i = class extends Subscribable {
31025
31600
  isPlaceholderData = true;
31026
31601
  }
31027
31602
  }
31603
+ if (options2.select && data !== void 0 && !skipSelect) {
31604
+ if (prevResult && data === (prevResultState == null ? void 0 : prevResultState.data) && options2.select === __privateGet(this, _selectFn)) {
31605
+ data = __privateGet(this, _selectResult);
31606
+ } else {
31607
+ try {
31608
+ __privateSet(this, _selectFn, options2.select);
31609
+ data = options2.select(data);
31610
+ data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options2);
31611
+ __privateSet(this, _selectResult, data);
31612
+ __privateSet(this, _selectError, null);
31613
+ } catch (selectError) {
31614
+ __privateSet(this, _selectError, selectError);
31615
+ }
31616
+ }
31617
+ }
31028
31618
  if (__privateGet(this, _selectError)) {
31029
31619
  error = __privateGet(this, _selectError);
31030
31620
  data = __privateGet(this, _selectResult);
@@ -31623,7 +32213,6 @@ var set = (object, path, value) => {
31623
32213
  object[key] = newValue;
31624
32214
  object = object[key];
31625
32215
  }
31626
- return object;
31627
32216
  };
31628
32217
  const EVENTS = {
31629
32218
  BLUR: "blur",
@@ -31670,31 +32259,44 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
31670
32259
  }
31671
32260
  return result;
31672
32261
  };
31673
- var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
31674
- var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
31675
- updateFormState(formStateData);
31676
- const { name: name2, ...formState } = formStateData;
31677
- return isEmptyObject(formState) || Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all));
31678
- };
31679
- var convertToArrayPayload = (value) => Array.isArray(value) ? value : [value];
31680
- var shouldSubscribeByName = (name2, signalName, exact) => !name2 || !signalName || name2 === signalName || convertToArrayPayload(name2).some((currentName) => currentName && (exact ? currentName === signalName : currentName.startsWith(signalName) || signalName.startsWith(currentName)));
31681
- function useSubscribe(props) {
31682
- const _props = React__default.useRef(props);
31683
- _props.current = props;
31684
- React__default.useEffect(() => {
31685
- const subscription = !props.disabled && _props.current.subject && _props.current.subject.subscribe({
31686
- next: _props.current.next
31687
- });
31688
- return () => {
31689
- subscription && subscription.unsubscribe();
31690
- };
31691
- }, [props.disabled]);
32262
+ var isPrimitive$1 = (value) => isNullOrUndefined(value) || !isObjectType(value);
32263
+ function deepEqual$2(object1, object2) {
32264
+ if (isPrimitive$1(object1) || isPrimitive$1(object2)) {
32265
+ return object1 === object2;
32266
+ }
32267
+ if (isDateObject(object1) && isDateObject(object2)) {
32268
+ return object1.getTime() === object2.getTime();
32269
+ }
32270
+ const keys1 = Object.keys(object1);
32271
+ const keys2 = Object.keys(object2);
32272
+ if (keys1.length !== keys2.length) {
32273
+ return false;
32274
+ }
32275
+ for (const key of keys1) {
32276
+ const val1 = object1[key];
32277
+ if (!keys2.includes(key)) {
32278
+ return false;
32279
+ }
32280
+ if (key !== "ref") {
32281
+ const val2 = object2[key];
32282
+ if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual$2(val1, val2) : val1 !== val2) {
32283
+ return false;
32284
+ }
32285
+ }
32286
+ }
32287
+ return true;
31692
32288
  }
32289
+ const useDeepEqualEffect = (effect, deps) => {
32290
+ const ref = React.useRef(deps);
32291
+ if (!deepEqual$2(deps, ref.current)) {
32292
+ ref.current = deps;
32293
+ }
32294
+ React.useEffect(effect, ref.current);
32295
+ };
31693
32296
  function useFormState(props) {
31694
32297
  const methods = useFormContext();
31695
32298
  const { control = methods.control, disabled, name: name2, exact } = props || {};
31696
32299
  const [formState, updateFormState] = React__default.useState(control._formState);
31697
- const _mounted = React__default.useRef(true);
31698
32300
  const _localProxyFormState = React__default.useRef({
31699
32301
  isDirty: false,
31700
32302
  isLoading: false,
@@ -31705,22 +32307,19 @@ function useFormState(props) {
31705
32307
  isValid: false,
31706
32308
  errors: false
31707
32309
  });
31708
- const _name = React__default.useRef(name2);
31709
- _name.current = name2;
31710
- useSubscribe({
31711
- disabled,
31712
- next: (value) => _mounted.current && shouldSubscribeByName(_name.current, value.name, exact) && shouldRenderFormState(value, _localProxyFormState.current, control._updateFormState) && updateFormState({
31713
- ...control._formState,
31714
- ...value
31715
- }),
31716
- subject: control._subjects.state
31717
- });
32310
+ useDeepEqualEffect(() => control._subscribe({
32311
+ name: name2,
32312
+ formState: _localProxyFormState.current,
32313
+ exact,
32314
+ callback: (formState2) => {
32315
+ !disabled && updateFormState({
32316
+ ...control._formState,
32317
+ ...formState2
32318
+ });
32319
+ }
32320
+ }), [name2, disabled, exact]);
31718
32321
  React__default.useEffect(() => {
31719
- _mounted.current = true;
31720
- _localProxyFormState.current.isValid && control._updateValid(true);
31721
- return () => {
31722
- _mounted.current = false;
31723
- };
32322
+ _localProxyFormState.current.isValid && control._setValid(true);
31724
32323
  }, [control]);
31725
32324
  return React__default.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
31726
32325
  }
@@ -31739,18 +32338,15 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
31739
32338
  function useWatch(props) {
31740
32339
  const methods = useFormContext();
31741
32340
  const { control = methods.control, name: name2, defaultValue, disabled, exact } = props || {};
31742
- const _name = React__default.useRef(name2);
31743
- _name.current = name2;
31744
- useSubscribe({
31745
- disabled,
31746
- subject: control._subjects.values,
31747
- next: (formState) => {
31748
- if (shouldSubscribeByName(_name.current, formState.name, exact)) {
31749
- updateValue(cloneObject(generateWatchOutput(_name.current, control._names, formState.values || control._formValues, false, defaultValue)));
31750
- }
31751
- }
31752
- });
31753
32341
  const [value, updateValue] = React__default.useState(control._getWatch(name2, defaultValue));
32342
+ useDeepEqualEffect(() => control._subscribe({
32343
+ name: name2,
32344
+ formState: {
32345
+ values: true
32346
+ },
32347
+ exact,
32348
+ callback: (formState) => !disabled && updateValue(generateWatchOutput(name2, control._names, formState.values || control._formValues, false, defaultValue))
32349
+ }), [name2, defaultValue, disabled, exact]);
31754
32350
  React__default.useEffect(() => control._removeUnmounted());
31755
32351
  return value;
31756
32352
  }
@@ -31769,6 +32365,7 @@ function useController(props) {
31769
32365
  name: name2,
31770
32366
  exact: true
31771
32367
  });
32368
+ const _props = React__default.useRef(props);
31772
32369
  const _registerProps = React__default.useRef(control.register(name2, {
31773
32370
  ...props.rules,
31774
32371
  value,
@@ -31796,45 +32393,45 @@ function useController(props) {
31796
32393
  get: () => get(formState.errors, name2)
31797
32394
  }
31798
32395
  }), [formState, name2]);
32396
+ const onChange2 = React__default.useCallback((event) => _registerProps.current.onChange({
32397
+ target: {
32398
+ value: getEventValue(event),
32399
+ name: name2
32400
+ },
32401
+ type: EVENTS.CHANGE
32402
+ }), [name2]);
32403
+ const onBlur = React__default.useCallback(() => _registerProps.current.onBlur({
32404
+ target: {
32405
+ value: get(control._formValues, name2),
32406
+ name: name2
32407
+ },
32408
+ type: EVENTS.BLUR
32409
+ }), [name2, control._formValues]);
32410
+ const ref = React__default.useCallback((elm) => {
32411
+ const field2 = get(control._fields, name2);
32412
+ if (field2 && elm) {
32413
+ field2._f.ref = {
32414
+ focus: () => elm.focus(),
32415
+ select: () => elm.select(),
32416
+ setCustomValidity: (message) => elm.setCustomValidity(message),
32417
+ reportValidity: () => elm.reportValidity()
32418
+ };
32419
+ }
32420
+ }, [control._fields, name2]);
31799
32421
  const field = React__default.useMemo(() => ({
31800
32422
  name: name2,
31801
32423
  value,
31802
32424
  ...isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {},
31803
- onChange: (event) => _registerProps.current.onChange({
31804
- target: {
31805
- value: getEventValue(event),
31806
- name: name2
31807
- },
31808
- type: EVENTS.CHANGE
31809
- }),
31810
- onBlur: () => _registerProps.current.onBlur({
31811
- target: {
31812
- value: get(control._formValues, name2),
31813
- name: name2
31814
- },
31815
- type: EVENTS.BLUR
31816
- }),
31817
- ref: (elm) => {
31818
- const field2 = get(control._fields, name2);
31819
- if (field2 && elm) {
31820
- field2._f.ref = {
31821
- focus: () => elm.focus(),
31822
- select: () => elm.select(),
31823
- setCustomValidity: (message) => elm.setCustomValidity(message),
31824
- reportValidity: () => elm.reportValidity()
31825
- };
31826
- }
31827
- }
31828
- }), [
31829
- name2,
31830
- control._formValues,
31831
- disabled,
31832
- formState.disabled,
31833
- value,
31834
- control._fields
31835
- ]);
32425
+ onChange: onChange2,
32426
+ onBlur,
32427
+ ref
32428
+ }), [name2, disabled, formState.disabled, onChange2, onBlur, ref, value]);
31836
32429
  React__default.useEffect(() => {
31837
32430
  const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
32431
+ control.register(name2, {
32432
+ ..._props.current.rules,
32433
+ ...isBoolean(_props.current.disabled) ? { disabled: _props.current.disabled } : {}
32434
+ });
31838
32435
  const updateMounted = (name3, value2) => {
31839
32436
  const field2 = get(control._fields, name3);
31840
32437
  if (field2 && field2._f) {
@@ -31855,9 +32452,8 @@ function useController(props) {
31855
32452
  };
31856
32453
  }, [name2, control, isArrayField, shouldUnregister]);
31857
32454
  React__default.useEffect(() => {
31858
- control._updateDisabledField({
32455
+ control._setDisabledField({
31859
32456
  disabled,
31860
- fields: control._fields,
31861
32457
  name: name2
31862
32458
  });
31863
32459
  }, [disabled, name2, control]);
@@ -31875,44 +32471,35 @@ var appendErrors = (name2, validateAllFieldCriteria, errors, type, message) => v
31875
32471
  [type]: message || true
31876
32472
  }
31877
32473
  } : {};
31878
- var getValidationModes = (mode2) => ({
31879
- isOnSubmit: !mode2 || mode2 === VALIDATION_MODE.onSubmit,
31880
- isOnBlur: mode2 === VALIDATION_MODE.onBlur,
31881
- isOnChange: mode2 === VALIDATION_MODE.onChange,
31882
- isOnAll: mode2 === VALIDATION_MODE.all,
31883
- isOnTouch: mode2 === VALIDATION_MODE.onTouched
31884
- });
31885
- var isWatched = (name2, _names, isBlurEvent) => !isBlurEvent && (_names.watchAll || _names.watch.has(name2) || [..._names.watch].some((watchName) => name2.startsWith(watchName) && /^\.\w+/.test(name2.slice(watchName.length))));
31886
- const iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {
31887
- for (const key of fieldsNames || Object.keys(fields)) {
31888
- const field = get(fields, key);
31889
- if (field) {
31890
- const { _f: _f2, ...currentField } = field;
31891
- if (_f2) {
31892
- if (_f2.refs && _f2.refs[0] && action(_f2.refs[0], key) && !abortEarly) {
31893
- return true;
31894
- } else if (_f2.ref && action(_f2.ref, _f2.name) && !abortEarly) {
31895
- return true;
31896
- } else {
31897
- if (iterateFieldsByAction(currentField, action)) {
31898
- break;
31899
- }
31900
- }
31901
- } else if (isObject(currentField)) {
31902
- if (iterateFieldsByAction(currentField, action)) {
31903
- break;
31904
- }
31905
- }
32474
+ var convertToArrayPayload = (value) => Array.isArray(value) ? value : [value];
32475
+ var createSubject = () => {
32476
+ let _observers2 = [];
32477
+ const next2 = (value) => {
32478
+ for (const observer of _observers2) {
32479
+ observer.next && observer.next(value);
31906
32480
  }
31907
- }
31908
- return;
31909
- };
31910
- var updateFieldArrayRootError = (errors, error, name2) => {
31911
- const fieldArrayErrors = convertToArrayPayload(get(errors, name2));
31912
- set(fieldArrayErrors, "root", error[name2]);
31913
- set(errors, name2, fieldArrayErrors);
31914
- return errors;
32481
+ };
32482
+ const subscribe = (observer) => {
32483
+ _observers2.push(observer);
32484
+ return {
32485
+ unsubscribe: () => {
32486
+ _observers2 = _observers2.filter((o) => o !== observer);
32487
+ }
32488
+ };
32489
+ };
32490
+ const unsubscribe = () => {
32491
+ _observers2 = [];
32492
+ };
32493
+ return {
32494
+ get observers() {
32495
+ return _observers2;
32496
+ },
32497
+ next: next2,
32498
+ subscribe,
32499
+ unsubscribe
32500
+ };
31915
32501
  };
32502
+ var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
31916
32503
  var isFileInput = (element) => element.type === "file";
31917
32504
  var isFunction = (value) => typeof value === "function";
31918
32505
  var isHTMLElement = (value) => {
@@ -31922,198 +32509,10 @@ var isHTMLElement = (value) => {
31922
32509
  const owner = value ? value.ownerDocument : 0;
31923
32510
  return value instanceof (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement);
31924
32511
  };
31925
- var isMessage = (value) => isString$1(value);
32512
+ var isMultipleSelect = (element) => element.type === `select-multiple`;
31926
32513
  var isRadioInput = (element) => element.type === "radio";
31927
- var isRegex = (value) => value instanceof RegExp;
31928
- const defaultResult = {
31929
- value: false,
31930
- isValid: false
31931
- };
31932
- const validResult = { value: true, isValid: true };
31933
- var getCheckboxValue = (options2) => {
31934
- if (Array.isArray(options2)) {
31935
- if (options2.length > 1) {
31936
- const values = options2.filter((option) => option && option.checked && !option.disabled).map((option) => option.value);
31937
- return { value: values, isValid: !!values.length };
31938
- }
31939
- return options2[0].checked && !options2[0].disabled ? (
31940
- // @ts-expect-error expected to work in the browser
31941
- options2[0].attributes && !isUndefined(options2[0].attributes.value) ? isUndefined(options2[0].value) || options2[0].value === "" ? validResult : { value: options2[0].value, isValid: true } : validResult
31942
- ) : defaultResult;
31943
- }
31944
- return defaultResult;
31945
- };
31946
- const defaultReturn = {
31947
- isValid: false,
31948
- value: null
31949
- };
31950
- var getRadioValue = (options2) => Array.isArray(options2) ? options2.reduce((previous, option) => option && option.checked && !option.disabled ? {
31951
- isValid: true,
31952
- value: option.value
31953
- } : previous, defaultReturn) : defaultReturn;
31954
- function getValidateError(result, ref, type = "validate") {
31955
- if (isMessage(result) || Array.isArray(result) && result.every(isMessage) || isBoolean(result) && !result) {
31956
- return {
31957
- type,
31958
- message: isMessage(result) ? result : "",
31959
- ref
31960
- };
31961
- }
31962
- }
31963
- var getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData) ? validationData : {
31964
- value: validationData,
31965
- message: ""
31966
- };
31967
- var validateField = async (field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {
31968
- const { ref, refs, required, maxLength, minLength, min: min2, max: max2, pattern, validate: validate2, name: name2, valueAsNumber, mount } = field._f;
31969
- const inputValue = get(formValues, name2);
31970
- if (!mount || disabledFieldNames.has(name2)) {
31971
- return {};
31972
- }
31973
- const inputRef = refs ? refs[0] : ref;
31974
- const setCustomValidity = (message) => {
31975
- if (shouldUseNativeValidation && inputRef.reportValidity) {
31976
- inputRef.setCustomValidity(isBoolean(message) ? "" : message || "");
31977
- inputRef.reportValidity();
31978
- }
31979
- };
31980
- const error = {};
31981
- const isRadio = isRadioInput(ref);
31982
- const isCheckBox = isCheckBoxInput(ref);
31983
- const isRadioOrCheckbox2 = isRadio || isCheckBox;
31984
- const isEmpty2 = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length;
31985
- const appendErrorsCurry = appendErrors.bind(null, name2, validateAllFieldCriteria, error);
31986
- const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
31987
- const message = exceedMax ? maxLengthMessage : minLengthMessage;
31988
- error[name2] = {
31989
- type: exceedMax ? maxType : minType,
31990
- message,
31991
- ref,
31992
- ...appendErrorsCurry(exceedMax ? maxType : minType, message)
31993
- };
31994
- };
31995
- if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox2 && (isEmpty2 || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
31996
- const { value, message } = isMessage(required) ? { value: !!required, message: required } : getValueAndMessage(required);
31997
- if (value) {
31998
- error[name2] = {
31999
- type: INPUT_VALIDATION_RULES.required,
32000
- message,
32001
- ref: inputRef,
32002
- ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message)
32003
- };
32004
- if (!validateAllFieldCriteria) {
32005
- setCustomValidity(message);
32006
- return error;
32007
- }
32008
- }
32009
- }
32010
- if (!isEmpty2 && (!isNullOrUndefined(min2) || !isNullOrUndefined(max2))) {
32011
- let exceedMax;
32012
- let exceedMin;
32013
- const maxOutput = getValueAndMessage(max2);
32014
- const minOutput = getValueAndMessage(min2);
32015
- if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
32016
- const valueNumber = ref.valueAsNumber || (inputValue ? +inputValue : inputValue);
32017
- if (!isNullOrUndefined(maxOutput.value)) {
32018
- exceedMax = valueNumber > maxOutput.value;
32019
- }
32020
- if (!isNullOrUndefined(minOutput.value)) {
32021
- exceedMin = valueNumber < minOutput.value;
32022
- }
32023
- } else {
32024
- const valueDate = ref.valueAsDate || new Date(inputValue);
32025
- const convertTimeToDate = (time) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time);
32026
- const isTime = ref.type == "time";
32027
- const isWeek = ref.type == "week";
32028
- if (isString$1(maxOutput.value) && inputValue) {
32029
- exceedMax = isTime ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value) : isWeek ? inputValue > maxOutput.value : valueDate > new Date(maxOutput.value);
32030
- }
32031
- if (isString$1(minOutput.value) && inputValue) {
32032
- exceedMin = isTime ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value) : isWeek ? inputValue < minOutput.value : valueDate < new Date(minOutput.value);
32033
- }
32034
- }
32035
- if (exceedMax || exceedMin) {
32036
- getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
32037
- if (!validateAllFieldCriteria) {
32038
- setCustomValidity(error[name2].message);
32039
- return error;
32040
- }
32041
- }
32042
- }
32043
- if ((maxLength || minLength) && !isEmpty2 && (isString$1(inputValue) || isFieldArray && Array.isArray(inputValue))) {
32044
- const maxLengthOutput = getValueAndMessage(maxLength);
32045
- const minLengthOutput = getValueAndMessage(minLength);
32046
- const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value;
32047
- const exceedMin = !isNullOrUndefined(minLengthOutput.value) && inputValue.length < +minLengthOutput.value;
32048
- if (exceedMax || exceedMin) {
32049
- getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
32050
- if (!validateAllFieldCriteria) {
32051
- setCustomValidity(error[name2].message);
32052
- return error;
32053
- }
32054
- }
32055
- }
32056
- if (pattern && !isEmpty2 && isString$1(inputValue)) {
32057
- const { value: patternValue, message } = getValueAndMessage(pattern);
32058
- if (isRegex(patternValue) && !inputValue.match(patternValue)) {
32059
- error[name2] = {
32060
- type: INPUT_VALIDATION_RULES.pattern,
32061
- message,
32062
- ref,
32063
- ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message)
32064
- };
32065
- if (!validateAllFieldCriteria) {
32066
- setCustomValidity(message);
32067
- return error;
32068
- }
32069
- }
32070
- }
32071
- if (validate2) {
32072
- if (isFunction(validate2)) {
32073
- const result = await validate2(inputValue, formValues);
32074
- const validateError = getValidateError(result, inputRef);
32075
- if (validateError) {
32076
- error[name2] = {
32077
- ...validateError,
32078
- ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message)
32079
- };
32080
- if (!validateAllFieldCriteria) {
32081
- setCustomValidity(validateError.message);
32082
- return error;
32083
- }
32084
- }
32085
- } else if (isObject(validate2)) {
32086
- let validationResult = {};
32087
- for (const key in validate2) {
32088
- if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
32089
- break;
32090
- }
32091
- const validateError = getValidateError(await validate2[key](inputValue, formValues), inputRef, key);
32092
- if (validateError) {
32093
- validationResult = {
32094
- ...validateError,
32095
- ...appendErrorsCurry(key, validateError.message)
32096
- };
32097
- setCustomValidity(validateError.message);
32098
- if (validateAllFieldCriteria) {
32099
- error[name2] = validationResult;
32100
- }
32101
- }
32102
- }
32103
- if (!isEmptyObject(validationResult)) {
32104
- error[name2] = {
32105
- ref: inputRef,
32106
- ...validationResult
32107
- };
32108
- if (!validateAllFieldCriteria) {
32109
- return error;
32110
- }
32111
- }
32112
- }
32113
- }
32114
- setCustomValidity(true);
32115
- return error;
32116
- };
32514
+ var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
32515
+ var live = (ref) => isHTMLElement(ref) && ref.isConnected;
32117
32516
  function baseGet(object, updatePath) {
32118
32517
  const length2 = updatePath.slice(0, -1).length;
32119
32518
  let index2 = 0;
@@ -32143,63 +32542,6 @@ function unset(object, path) {
32143
32542
  }
32144
32543
  return object;
32145
32544
  }
32146
- var createSubject = () => {
32147
- let _observers2 = [];
32148
- const next2 = (value) => {
32149
- for (const observer of _observers2) {
32150
- observer.next && observer.next(value);
32151
- }
32152
- };
32153
- const subscribe = (observer) => {
32154
- _observers2.push(observer);
32155
- return {
32156
- unsubscribe: () => {
32157
- _observers2 = _observers2.filter((o) => o !== observer);
32158
- }
32159
- };
32160
- };
32161
- const unsubscribe = () => {
32162
- _observers2 = [];
32163
- };
32164
- return {
32165
- get observers() {
32166
- return _observers2;
32167
- },
32168
- next: next2,
32169
- subscribe,
32170
- unsubscribe
32171
- };
32172
- };
32173
- var isPrimitive$1 = (value) => isNullOrUndefined(value) || !isObjectType(value);
32174
- function deepEqual$2(object1, object2) {
32175
- if (isPrimitive$1(object1) || isPrimitive$1(object2)) {
32176
- return object1 === object2;
32177
- }
32178
- if (isDateObject(object1) && isDateObject(object2)) {
32179
- return object1.getTime() === object2.getTime();
32180
- }
32181
- const keys1 = Object.keys(object1);
32182
- const keys2 = Object.keys(object2);
32183
- if (keys1.length !== keys2.length) {
32184
- return false;
32185
- }
32186
- for (const key of keys1) {
32187
- const val1 = object1[key];
32188
- if (!keys2.includes(key)) {
32189
- return false;
32190
- }
32191
- if (key !== "ref") {
32192
- const val2 = object2[key];
32193
- if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual$2(val1, val2) : val1 !== val2) {
32194
- return false;
32195
- }
32196
- }
32197
- }
32198
- return true;
32199
- }
32200
- var isMultipleSelect = (element) => element.type === `select-multiple`;
32201
- var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
32202
- var live = (ref) => isHTMLElement(ref) && ref.isConnected;
32203
32545
  var objectHasFunction = (data) => {
32204
32546
  for (const key in data) {
32205
32547
  if (isFunction(data[key])) {
@@ -32240,7 +32582,33 @@ function getDirtyFieldsFromDefaultValues(data, formValues, dirtyFieldsFromValues
32240
32582
  return dirtyFieldsFromValues;
32241
32583
  }
32242
32584
  var getDirtyFields = (defaultValues, formValues) => getDirtyFieldsFromDefaultValues(defaultValues, formValues, markFieldsDirty(formValues));
32585
+ const defaultResult = {
32586
+ value: false,
32587
+ isValid: false
32588
+ };
32589
+ const validResult = { value: true, isValid: true };
32590
+ var getCheckboxValue = (options2) => {
32591
+ if (Array.isArray(options2)) {
32592
+ if (options2.length > 1) {
32593
+ const values = options2.filter((option) => option && option.checked && !option.disabled).map((option) => option.value);
32594
+ return { value: values, isValid: !!values.length };
32595
+ }
32596
+ return options2[0].checked && !options2[0].disabled ? (
32597
+ // @ts-expect-error expected to work in the browser
32598
+ options2[0].attributes && !isUndefined(options2[0].attributes.value) ? isUndefined(options2[0].value) || options2[0].value === "" ? validResult : { value: options2[0].value, isValid: true } : validResult
32599
+ ) : defaultResult;
32600
+ }
32601
+ return defaultResult;
32602
+ };
32243
32603
  var getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value) ? value : valueAsNumber ? value === "" ? NaN : value ? +value : value : valueAsDate && isString$1(value) ? new Date(value) : setValueAs ? setValueAs(value) : value;
32604
+ const defaultReturn = {
32605
+ isValid: false,
32606
+ value: null
32607
+ };
32608
+ var getRadioValue = (options2) => Array.isArray(options2) ? options2.reduce((previous, option) => option && option.checked && !option.disabled ? {
32609
+ isValid: true,
32610
+ value: option.value
32611
+ } : previous, defaultReturn) : defaultReturn;
32244
32612
  function getFieldValue(_f2) {
32245
32613
  const ref = _f2.ref;
32246
32614
  if (isFileInput(ref)) {
@@ -32270,10 +32638,43 @@ var getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeVal
32270
32638
  shouldUseNativeValidation
32271
32639
  };
32272
32640
  };
32641
+ var isRegex = (value) => value instanceof RegExp;
32273
32642
  var getRuleValue = (rule) => isUndefined(rule) ? rule : isRegex(rule) ? rule.source : isObject(rule) ? isRegex(rule.value) ? rule.value.source : rule.value : rule;
32643
+ var getValidationModes = (mode2) => ({
32644
+ isOnSubmit: !mode2 || mode2 === VALIDATION_MODE.onSubmit,
32645
+ isOnBlur: mode2 === VALIDATION_MODE.onBlur,
32646
+ isOnChange: mode2 === VALIDATION_MODE.onChange,
32647
+ isOnAll: mode2 === VALIDATION_MODE.all,
32648
+ isOnTouch: mode2 === VALIDATION_MODE.onTouched
32649
+ });
32274
32650
  const ASYNC_FUNCTION = "AsyncFunction";
32275
32651
  var hasPromiseValidation = (fieldReference) => !!fieldReference && !!fieldReference.validate && !!(isFunction(fieldReference.validate) && fieldReference.validate.constructor.name === ASYNC_FUNCTION || isObject(fieldReference.validate) && Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION));
32276
32652
  var hasValidation = (options2) => options2.mount && (options2.required || options2.min || options2.max || options2.maxLength || options2.minLength || options2.pattern || options2.validate);
32653
+ var isWatched = (name2, _names, isBlurEvent) => !isBlurEvent && (_names.watchAll || _names.watch.has(name2) || [..._names.watch].some((watchName) => name2.startsWith(watchName) && /^\.\w+/.test(name2.slice(watchName.length))));
32654
+ const iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {
32655
+ for (const key of fieldsNames || Object.keys(fields)) {
32656
+ const field = get(fields, key);
32657
+ if (field) {
32658
+ const { _f: _f2, ...currentField } = field;
32659
+ if (_f2) {
32660
+ if (_f2.refs && _f2.refs[0] && action(_f2.refs[0], key) && !abortEarly) {
32661
+ return true;
32662
+ } else if (_f2.ref && action(_f2.ref, _f2.name) && !abortEarly) {
32663
+ return true;
32664
+ } else {
32665
+ if (iterateFieldsByAction(currentField, action)) {
32666
+ break;
32667
+ }
32668
+ }
32669
+ } else if (isObject(currentField)) {
32670
+ if (iterateFieldsByAction(currentField, action)) {
32671
+ break;
32672
+ }
32673
+ }
32674
+ }
32675
+ }
32676
+ return;
32677
+ };
32277
32678
  function schemaErrorLookup(errors, _fields, name2) {
32278
32679
  const error = get(errors, name2);
32279
32680
  if (error || isKey(name2)) {
@@ -32302,6 +32703,12 @@ function schemaErrorLookup(errors, _fields, name2) {
32302
32703
  name: name2
32303
32704
  };
32304
32705
  }
32706
+ var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
32707
+ updateFormState(formStateData);
32708
+ const { name: name2, ...formState } = formStateData;
32709
+ return isEmptyObject(formState) || Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all));
32710
+ };
32711
+ var shouldSubscribeByName = (name2, signalName, exact) => !name2 || !signalName || name2 === signalName || convertToArrayPayload(name2).some((currentName) => currentName && (exact ? currentName === signalName : currentName.startsWith(signalName) || signalName.startsWith(currentName)));
32305
32712
  var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode2) => {
32306
32713
  if (mode2.isOnAll) {
32307
32714
  return false;
@@ -32315,6 +32722,176 @@ var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode2
32315
32722
  return true;
32316
32723
  };
32317
32724
  var unsetEmptyArray = (ref, name2) => !compact(get(ref, name2)).length && unset(ref, name2);
32725
+ var updateFieldArrayRootError = (errors, error, name2) => {
32726
+ const fieldArrayErrors = convertToArrayPayload(get(errors, name2));
32727
+ set(fieldArrayErrors, "root", error[name2]);
32728
+ set(errors, name2, fieldArrayErrors);
32729
+ return errors;
32730
+ };
32731
+ var isMessage = (value) => isString$1(value);
32732
+ function getValidateError(result, ref, type = "validate") {
32733
+ if (isMessage(result) || Array.isArray(result) && result.every(isMessage) || isBoolean(result) && !result) {
32734
+ return {
32735
+ type,
32736
+ message: isMessage(result) ? result : "",
32737
+ ref
32738
+ };
32739
+ }
32740
+ }
32741
+ var getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData) ? validationData : {
32742
+ value: validationData,
32743
+ message: ""
32744
+ };
32745
+ var validateField = async (field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {
32746
+ const { ref, refs, required, maxLength, minLength, min: min2, max: max2, pattern, validate: validate2, name: name2, valueAsNumber, mount } = field._f;
32747
+ const inputValue = get(formValues, name2);
32748
+ if (!mount || disabledFieldNames.has(name2)) {
32749
+ return {};
32750
+ }
32751
+ const inputRef = refs ? refs[0] : ref;
32752
+ const setCustomValidity = (message) => {
32753
+ if (shouldUseNativeValidation && inputRef.reportValidity) {
32754
+ inputRef.setCustomValidity(isBoolean(message) ? "" : message || "");
32755
+ inputRef.reportValidity();
32756
+ }
32757
+ };
32758
+ const error = {};
32759
+ const isRadio = isRadioInput(ref);
32760
+ const isCheckBox = isCheckBoxInput(ref);
32761
+ const isRadioOrCheckbox2 = isRadio || isCheckBox;
32762
+ const isEmpty2 = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length;
32763
+ const appendErrorsCurry = appendErrors.bind(null, name2, validateAllFieldCriteria, error);
32764
+ const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
32765
+ const message = exceedMax ? maxLengthMessage : minLengthMessage;
32766
+ error[name2] = {
32767
+ type: exceedMax ? maxType : minType,
32768
+ message,
32769
+ ref,
32770
+ ...appendErrorsCurry(exceedMax ? maxType : minType, message)
32771
+ };
32772
+ };
32773
+ if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox2 && (isEmpty2 || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
32774
+ const { value, message } = isMessage(required) ? { value: !!required, message: required } : getValueAndMessage(required);
32775
+ if (value) {
32776
+ error[name2] = {
32777
+ type: INPUT_VALIDATION_RULES.required,
32778
+ message,
32779
+ ref: inputRef,
32780
+ ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message)
32781
+ };
32782
+ if (!validateAllFieldCriteria) {
32783
+ setCustomValidity(message);
32784
+ return error;
32785
+ }
32786
+ }
32787
+ }
32788
+ if (!isEmpty2 && (!isNullOrUndefined(min2) || !isNullOrUndefined(max2))) {
32789
+ let exceedMax;
32790
+ let exceedMin;
32791
+ const maxOutput = getValueAndMessage(max2);
32792
+ const minOutput = getValueAndMessage(min2);
32793
+ if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
32794
+ const valueNumber = ref.valueAsNumber || (inputValue ? +inputValue : inputValue);
32795
+ if (!isNullOrUndefined(maxOutput.value)) {
32796
+ exceedMax = valueNumber > maxOutput.value;
32797
+ }
32798
+ if (!isNullOrUndefined(minOutput.value)) {
32799
+ exceedMin = valueNumber < minOutput.value;
32800
+ }
32801
+ } else {
32802
+ const valueDate = ref.valueAsDate || new Date(inputValue);
32803
+ const convertTimeToDate = (time) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time);
32804
+ const isTime = ref.type == "time";
32805
+ const isWeek = ref.type == "week";
32806
+ if (isString$1(maxOutput.value) && inputValue) {
32807
+ exceedMax = isTime ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value) : isWeek ? inputValue > maxOutput.value : valueDate > new Date(maxOutput.value);
32808
+ }
32809
+ if (isString$1(minOutput.value) && inputValue) {
32810
+ exceedMin = isTime ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value) : isWeek ? inputValue < minOutput.value : valueDate < new Date(minOutput.value);
32811
+ }
32812
+ }
32813
+ if (exceedMax || exceedMin) {
32814
+ getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
32815
+ if (!validateAllFieldCriteria) {
32816
+ setCustomValidity(error[name2].message);
32817
+ return error;
32818
+ }
32819
+ }
32820
+ }
32821
+ if ((maxLength || minLength) && !isEmpty2 && (isString$1(inputValue) || isFieldArray && Array.isArray(inputValue))) {
32822
+ const maxLengthOutput = getValueAndMessage(maxLength);
32823
+ const minLengthOutput = getValueAndMessage(minLength);
32824
+ const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value;
32825
+ const exceedMin = !isNullOrUndefined(minLengthOutput.value) && inputValue.length < +minLengthOutput.value;
32826
+ if (exceedMax || exceedMin) {
32827
+ getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
32828
+ if (!validateAllFieldCriteria) {
32829
+ setCustomValidity(error[name2].message);
32830
+ return error;
32831
+ }
32832
+ }
32833
+ }
32834
+ if (pattern && !isEmpty2 && isString$1(inputValue)) {
32835
+ const { value: patternValue, message } = getValueAndMessage(pattern);
32836
+ if (isRegex(patternValue) && !inputValue.match(patternValue)) {
32837
+ error[name2] = {
32838
+ type: INPUT_VALIDATION_RULES.pattern,
32839
+ message,
32840
+ ref,
32841
+ ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message)
32842
+ };
32843
+ if (!validateAllFieldCriteria) {
32844
+ setCustomValidity(message);
32845
+ return error;
32846
+ }
32847
+ }
32848
+ }
32849
+ if (validate2) {
32850
+ if (isFunction(validate2)) {
32851
+ const result = await validate2(inputValue, formValues);
32852
+ const validateError = getValidateError(result, inputRef);
32853
+ if (validateError) {
32854
+ error[name2] = {
32855
+ ...validateError,
32856
+ ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message)
32857
+ };
32858
+ if (!validateAllFieldCriteria) {
32859
+ setCustomValidity(validateError.message);
32860
+ return error;
32861
+ }
32862
+ }
32863
+ } else if (isObject(validate2)) {
32864
+ let validationResult = {};
32865
+ for (const key in validate2) {
32866
+ if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
32867
+ break;
32868
+ }
32869
+ const validateError = getValidateError(await validate2[key](inputValue, formValues), inputRef, key);
32870
+ if (validateError) {
32871
+ validationResult = {
32872
+ ...validateError,
32873
+ ...appendErrorsCurry(key, validateError.message)
32874
+ };
32875
+ setCustomValidity(validateError.message);
32876
+ if (validateAllFieldCriteria) {
32877
+ error[name2] = validationResult;
32878
+ }
32879
+ }
32880
+ }
32881
+ if (!isEmptyObject(validationResult)) {
32882
+ error[name2] = {
32883
+ ref: inputRef,
32884
+ ...validationResult
32885
+ };
32886
+ if (!validateAllFieldCriteria) {
32887
+ return error;
32888
+ }
32889
+ }
32890
+ }
32891
+ }
32892
+ setCustomValidity(true);
32893
+ return error;
32894
+ };
32318
32895
  const defaultOptions = {
32319
32896
  mode: VALIDATION_MODE.onSubmit,
32320
32897
  reValidateMode: VALIDATION_MODE.onChange,
@@ -32328,6 +32905,7 @@ function createFormControl(props = {}) {
32328
32905
  let _formState = {
32329
32906
  submitCount: 0,
32330
32907
  isDirty: false,
32908
+ isReady: false,
32331
32909
  isLoading: isFunction(_options.defaultValues),
32332
32910
  isValidating: false,
32333
32911
  isSubmitted: false,
@@ -32340,8 +32918,8 @@ function createFormControl(props = {}) {
32340
32918
  errors: _options.errors || {},
32341
32919
  disabled: _options.disabled || false
32342
32920
  };
32343
- let _fields = {};
32344
- let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values) ? cloneObject(_options.defaultValues || _options.values) || {} : {};
32921
+ const _fields = {};
32922
+ let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values) ? cloneObject(_options.values || _options.defaultValues) || {} : {};
32345
32923
  let _formValues = _options.shouldUnregister ? {} : cloneObject(_defaultValues);
32346
32924
  let _state = {
32347
32925
  action: false,
@@ -32366,8 +32944,10 @@ function createFormControl(props = {}) {
32366
32944
  isValid: false,
32367
32945
  errors: false
32368
32946
  };
32947
+ let _proxySubscribeFormState = {
32948
+ ..._proxyFormState
32949
+ };
32369
32950
  const _subjects = {
32370
- values: createSubject(),
32371
32951
  array: createSubject(),
32372
32952
  state: createSubject()
32373
32953
  };
@@ -32378,9 +32958,9 @@ function createFormControl(props = {}) {
32378
32958
  clearTimeout(timer);
32379
32959
  timer = setTimeout(callback, wait2);
32380
32960
  };
32381
- const _updateValid = async (shouldUpdateValid) => {
32382
- if (!_options.disabled && (_proxyFormState.isValid || shouldUpdateValid)) {
32383
- const isValid = _options.resolver ? isEmptyObject((await _executeSchema()).errors) : await executeBuiltInValidation(_fields, true);
32961
+ const _setValid = async (shouldUpdateValid) => {
32962
+ if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
32963
+ const isValid = _options.resolver ? isEmptyObject((await _runSchema()).errors) : await executeBuiltInValidation(_fields, true);
32384
32964
  if (isValid !== _formState.isValid) {
32385
32965
  _subjects.state.next({
32386
32966
  isValid
@@ -32389,7 +32969,7 @@ function createFormControl(props = {}) {
32389
32969
  }
32390
32970
  };
32391
32971
  const _updateIsValidating = (names, isValidating) => {
32392
- if (!_options.disabled && (_proxyFormState.isValidating || _proxyFormState.validatingFields)) {
32972
+ if (!_options.disabled && (_proxyFormState.isValidating || _proxyFormState.validatingFields || _proxySubscribeFormState.isValidating || _proxySubscribeFormState.validatingFields)) {
32393
32973
  (names || Array.from(_names.mount)).forEach((name2) => {
32394
32974
  if (name2) {
32395
32975
  isValidating ? set(_formState.validatingFields, name2, isValidating) : unset(_formState.validatingFields, name2);
@@ -32401,7 +32981,7 @@ function createFormControl(props = {}) {
32401
32981
  });
32402
32982
  }
32403
32983
  };
32404
- const _updateFieldArray = (name2, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
32984
+ const _setFieldArray = (name2, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
32405
32985
  if (args && method && !_options.disabled) {
32406
32986
  _state.action = true;
32407
32987
  if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name2))) {
@@ -32413,11 +32993,11 @@ function createFormControl(props = {}) {
32413
32993
  shouldSetValues && set(_formState.errors, name2, errors);
32414
32994
  unsetEmptyArray(_formState.errors, name2);
32415
32995
  }
32416
- if (_proxyFormState.touchedFields && shouldUpdateFieldsAndState && Array.isArray(get(_formState.touchedFields, name2))) {
32996
+ if ((_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && shouldUpdateFieldsAndState && Array.isArray(get(_formState.touchedFields, name2))) {
32417
32997
  const touchedFields = method(get(_formState.touchedFields, name2), args.argA, args.argB);
32418
32998
  shouldSetValues && set(_formState.touchedFields, name2, touchedFields);
32419
32999
  }
32420
- if (_proxyFormState.dirtyFields) {
33000
+ if (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) {
32421
33001
  _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);
32422
33002
  }
32423
33003
  _subjects.state.next({
@@ -32449,7 +33029,7 @@ function createFormControl(props = {}) {
32449
33029
  if (field) {
32450
33030
  const defaultValue = get(_formValues, name2, isUndefined(value) ? get(_defaultValues, name2) : value);
32451
33031
  isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name2, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name2, defaultValue);
32452
- _state.mount && _updateValid();
33032
+ _state.mount && _setValid();
32453
33033
  }
32454
33034
  };
32455
33035
  const updateTouchAndDirty = (name2, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
@@ -32459,25 +33039,24 @@ function createFormControl(props = {}) {
32459
33039
  name: name2
32460
33040
  };
32461
33041
  if (!_options.disabled) {
32462
- const disabledField = !!(get(_fields, name2) && get(_fields, name2)._f && get(_fields, name2)._f.disabled);
32463
33042
  if (!isBlurEvent || shouldDirty) {
32464
- if (_proxyFormState.isDirty) {
33043
+ if (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty) {
32465
33044
  isPreviousDirty = _formState.isDirty;
32466
33045
  _formState.isDirty = output.isDirty = _getDirty();
32467
33046
  shouldUpdateField = isPreviousDirty !== output.isDirty;
32468
33047
  }
32469
- const isCurrentFieldPristine = disabledField || deepEqual$2(get(_defaultValues, name2), fieldValue);
32470
- isPreviousDirty = !!(!disabledField && get(_formState.dirtyFields, name2));
32471
- isCurrentFieldPristine || disabledField ? unset(_formState.dirtyFields, name2) : set(_formState.dirtyFields, name2, true);
33048
+ const isCurrentFieldPristine = deepEqual$2(get(_defaultValues, name2), fieldValue);
33049
+ isPreviousDirty = !!get(_formState.dirtyFields, name2);
33050
+ isCurrentFieldPristine ? unset(_formState.dirtyFields, name2) : set(_formState.dirtyFields, name2, true);
32472
33051
  output.dirtyFields = _formState.dirtyFields;
32473
- shouldUpdateField = shouldUpdateField || _proxyFormState.dirtyFields && isPreviousDirty !== !isCurrentFieldPristine;
33052
+ shouldUpdateField = shouldUpdateField || (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) && isPreviousDirty !== !isCurrentFieldPristine;
32474
33053
  }
32475
33054
  if (isBlurEvent) {
32476
33055
  const isPreviousFieldTouched = get(_formState.touchedFields, name2);
32477
33056
  if (!isPreviousFieldTouched) {
32478
33057
  set(_formState.touchedFields, name2, isBlurEvent);
32479
33058
  output.touchedFields = _formState.touchedFields;
32480
- shouldUpdateField = shouldUpdateField || _proxyFormState.touchedFields && isPreviousFieldTouched !== isBlurEvent;
33059
+ shouldUpdateField = shouldUpdateField || (_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && isPreviousFieldTouched !== isBlurEvent;
32481
33060
  }
32482
33061
  }
32483
33062
  shouldUpdateField && shouldRender && _subjects.state.next(output);
@@ -32486,7 +33065,7 @@ function createFormControl(props = {}) {
32486
33065
  };
32487
33066
  const shouldRenderByError = (name2, isValid, error, fieldState) => {
32488
33067
  const previousFieldError = get(_formState.errors, name2);
32489
- const shouldUpdateValid = _proxyFormState.isValid && isBoolean(isValid) && _formState.isValid !== isValid;
33068
+ const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isBoolean(isValid) && _formState.isValid !== isValid;
32490
33069
  if (_options.delayError && error) {
32491
33070
  delayErrorCallback = debounce2(() => updateErrors(name2, error));
32492
33071
  delayErrorCallback(_options.delayError);
@@ -32509,14 +33088,14 @@ function createFormControl(props = {}) {
32509
33088
  _subjects.state.next(updatedFormState);
32510
33089
  }
32511
33090
  };
32512
- const _executeSchema = async (name2) => {
33091
+ const _runSchema = async (name2) => {
32513
33092
  _updateIsValidating(name2, true);
32514
33093
  const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name2 || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
32515
33094
  _updateIsValidating(name2);
32516
33095
  return result;
32517
33096
  };
32518
33097
  const executeSchemaAndUpdateState = async (names) => {
32519
- const { errors } = await _executeSchema(names);
33098
+ const { errors } = await _runSchema(names);
32520
33099
  if (names) {
32521
33100
  for (const name2 of names) {
32522
33101
  const error = get(errors, name2);
@@ -32590,9 +33169,9 @@ function createFormControl(props = {}) {
32590
33169
  } else {
32591
33170
  fieldReference.ref.value = fieldValue;
32592
33171
  if (!fieldReference.ref.type) {
32593
- _subjects.values.next({
33172
+ _subjects.state.next({
32594
33173
  name: name2,
32595
- values: { ..._formValues }
33174
+ values: cloneObject(_formValues)
32596
33175
  });
32597
33176
  }
32598
33177
  }
@@ -32617,9 +33196,9 @@ function createFormControl(props = {}) {
32617
33196
  if (isFieldArray) {
32618
33197
  _subjects.array.next({
32619
33198
  name: name2,
32620
- values: { ..._formValues }
33199
+ values: cloneObject(_formValues)
32621
33200
  });
32622
- if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields) && options2.shouldDirty) {
33201
+ if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields || _proxySubscribeFormState.isDirty || _proxySubscribeFormState.dirtyFields) && options2.shouldDirty) {
32623
33202
  _subjects.state.next({
32624
33203
  name: name2,
32625
33204
  dirtyFields: getDirtyFields(_defaultValues, _formValues),
@@ -32630,9 +33209,9 @@ function createFormControl(props = {}) {
32630
33209
  field && !field._f && !isNullOrUndefined(cloneValue) ? setValues(name2, cloneValue, options2) : setFieldValue(name2, cloneValue, options2);
32631
33210
  }
32632
33211
  isWatched(name2, _names) && _subjects.state.next({ ..._formState });
32633
- _subjects.values.next({
33212
+ _subjects.state.next({
32634
33213
  name: _state.mount ? name2 : void 0,
32635
- values: { ..._formValues }
33214
+ values: cloneObject(_formValues)
32636
33215
  });
32637
33216
  };
32638
33217
  const onChange2 = async (event) => {
@@ -32641,14 +33220,13 @@ function createFormControl(props = {}) {
32641
33220
  let name2 = target.name;
32642
33221
  let isFieldValueUpdated = true;
32643
33222
  const field = get(_fields, name2);
32644
- const getCurrentFieldValue = () => target.type ? getFieldValue(field._f) : getEventValue(event);
32645
33223
  const _updateIsFieldValueUpdated = (fieldValue) => {
32646
33224
  isFieldValueUpdated = Number.isNaN(fieldValue) || isDateObject(fieldValue) && isNaN(fieldValue.getTime()) || deepEqual$2(fieldValue, get(_formValues, name2, fieldValue));
32647
33225
  };
32648
33226
  if (field) {
32649
33227
  let error;
32650
33228
  let isValid;
32651
- const fieldValue = getCurrentFieldValue();
33229
+ const fieldValue = target.type ? getFieldValue(field._f) : getEventValue(event);
32652
33230
  const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;
32653
33231
  const shouldSkipValidation = !hasValidation(field._f) && !_options.resolver && !get(_formState.errors, name2) && !field._f.deps || skipValidation(isBlurEvent, get(_formState.touchedFields, name2), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);
32654
33232
  const watched = isWatched(name2, _names, isBlurEvent);
@@ -32659,26 +33237,28 @@ function createFormControl(props = {}) {
32659
33237
  } else if (field._f.onChange) {
32660
33238
  field._f.onChange(event);
32661
33239
  }
32662
- const fieldState = updateTouchAndDirty(name2, fieldValue, isBlurEvent, false);
33240
+ const fieldState = updateTouchAndDirty(name2, fieldValue, isBlurEvent);
32663
33241
  const shouldRender = !isEmptyObject(fieldState) || watched;
32664
- !isBlurEvent && _subjects.values.next({
33242
+ !isBlurEvent && _subjects.state.next({
32665
33243
  name: name2,
32666
33244
  type: event.type,
32667
- values: { ..._formValues }
33245
+ values: cloneObject(_formValues)
32668
33246
  });
32669
33247
  if (shouldSkipValidation) {
32670
- if (_proxyFormState.isValid) {
32671
- if (_options.mode === "onBlur" && isBlurEvent) {
32672
- _updateValid();
33248
+ if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
33249
+ if (_options.mode === "onBlur") {
33250
+ if (isBlurEvent) {
33251
+ _setValid();
33252
+ }
32673
33253
  } else if (!isBlurEvent) {
32674
- _updateValid();
33254
+ _setValid();
32675
33255
  }
32676
33256
  }
32677
33257
  return shouldRender && _subjects.state.next({ name: name2, ...watched ? {} : fieldState });
32678
33258
  }
32679
33259
  !isBlurEvent && watched && _subjects.state.next({ ..._formState });
32680
33260
  if (_options.resolver) {
32681
- const { errors } = await _executeSchema([name2]);
33261
+ const { errors } = await _runSchema([name2]);
32682
33262
  _updateIsFieldValueUpdated(fieldValue);
32683
33263
  if (isFieldValueUpdated) {
32684
33264
  const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name2);
@@ -32695,7 +33275,7 @@ function createFormControl(props = {}) {
32695
33275
  if (isFieldValueUpdated) {
32696
33276
  if (error) {
32697
33277
  isValid = false;
32698
- } else if (_proxyFormState.isValid) {
33278
+ } else if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
32699
33279
  isValid = await executeBuiltInValidation(_fields, true);
32700
33280
  }
32701
33281
  }
@@ -32726,12 +33306,12 @@ function createFormControl(props = {}) {
32726
33306
  const field = get(_fields, fieldName);
32727
33307
  return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);
32728
33308
  }))).every(Boolean);
32729
- !(!validationResult && !_formState.isValid) && _updateValid();
33309
+ !(!validationResult && !_formState.isValid) && _setValid();
32730
33310
  } else {
32731
33311
  validationResult = isValid = await executeBuiltInValidation(_fields);
32732
33312
  }
32733
33313
  _subjects.state.next({
32734
- ...!isString$1(name2) || _proxyFormState.isValid && isValid !== _formState.isValid ? {} : { name: name2 },
33314
+ ...!isString$1(name2) || (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isValid !== _formState.isValid ? {} : { name: name2 },
32735
33315
  ..._options.resolver || !name2 ? { isValid } : {},
32736
33316
  errors: _formState.errors
32737
33317
  });
@@ -32773,9 +33353,31 @@ function createFormControl(props = {}) {
32773
33353
  });
32774
33354
  options2 && options2.shouldFocus && ref && ref.focus && ref.focus();
32775
33355
  };
32776
- const watch = (name2, defaultValue) => isFunction(name2) ? _subjects.values.subscribe({
33356
+ const watch = (name2, defaultValue) => isFunction(name2) ? _subjects.state.subscribe({
32777
33357
  next: (payload) => name2(_getWatch(void 0, defaultValue), payload)
32778
33358
  }) : _getWatch(name2, defaultValue, true);
33359
+ const _subscribe = (props2) => _subjects.state.subscribe({
33360
+ next: (formState) => {
33361
+ if (shouldSubscribeByName(props2.name, formState.name, props2.exact) && shouldRenderFormState(formState, props2.formState || _proxyFormState, _setFormState, props2.reRenderRoot)) {
33362
+ props2.callback({
33363
+ values: { ..._formValues },
33364
+ ..._formState,
33365
+ ...formState
33366
+ });
33367
+ }
33368
+ }
33369
+ }).unsubscribe;
33370
+ const subscribe = (props2) => {
33371
+ _state.mount = true;
33372
+ _proxySubscribeFormState = {
33373
+ ..._proxySubscribeFormState,
33374
+ ...props2.formState
33375
+ };
33376
+ return _subscribe({
33377
+ ...props2,
33378
+ formState: _proxySubscribeFormState
33379
+ });
33380
+ };
32779
33381
  const unregister = (name2, options2 = {}) => {
32780
33382
  for (const fieldName of name2 ? convertToArrayPayload(name2) : _names.mount) {
32781
33383
  _names.mount.delete(fieldName);
@@ -32790,19 +33392,18 @@ function createFormControl(props = {}) {
32790
33392
  !options2.keepIsValidating && unset(_formState.validatingFields, fieldName);
32791
33393
  !_options.shouldUnregister && !options2.keepDefaultValue && unset(_defaultValues, fieldName);
32792
33394
  }
32793
- _subjects.values.next({
32794
- values: { ..._formValues }
33395
+ _subjects.state.next({
33396
+ values: cloneObject(_formValues)
32795
33397
  });
32796
33398
  _subjects.state.next({
32797
33399
  ..._formState,
32798
33400
  ...!options2.keepDirty ? {} : { isDirty: _getDirty() }
32799
33401
  });
32800
- !options2.keepIsValid && _updateValid();
33402
+ !options2.keepIsValid && _setValid();
32801
33403
  };
32802
- const _updateDisabledField = ({ disabled, name: name2, field, fields }) => {
33404
+ const _setDisabledField = ({ disabled, name: name2 }) => {
32803
33405
  if (isBoolean(disabled) && _state.mount || !!disabled || _names.disabled.has(name2)) {
32804
33406
  disabled ? _names.disabled.add(name2) : _names.disabled.delete(name2);
32805
- updateTouchAndDirty(name2, getFieldValue(field ? field._f : get(fields, name2)._f), false, false, true);
32806
33407
  }
32807
33408
  };
32808
33409
  const register = (name2, options2 = {}) => {
@@ -32819,8 +33420,7 @@ function createFormControl(props = {}) {
32819
33420
  });
32820
33421
  _names.mount.add(name2);
32821
33422
  if (field) {
32822
- _updateDisabledField({
32823
- field,
33423
+ _setDisabledField({
32824
33424
  disabled: isBoolean(options2.disabled) ? options2.disabled : _options.disabled,
32825
33425
  name: name2
32826
33426
  });
@@ -32898,21 +33498,21 @@ function createFormControl(props = {}) {
32898
33498
  e2.persist && e2.persist();
32899
33499
  }
32900
33500
  let fieldValues = cloneObject(_formValues);
32901
- if (_names.disabled.size) {
32902
- for (const name2 of _names.disabled) {
32903
- set(fieldValues, name2, void 0);
32904
- }
32905
- }
32906
33501
  _subjects.state.next({
32907
33502
  isSubmitting: true
32908
33503
  });
32909
33504
  if (_options.resolver) {
32910
- const { errors, values } = await _executeSchema();
33505
+ const { errors, values } = await _runSchema();
32911
33506
  _formState.errors = errors;
32912
33507
  fieldValues = values;
32913
33508
  } else {
32914
33509
  await executeBuiltInValidation(_fields);
32915
33510
  }
33511
+ if (_names.disabled.size) {
33512
+ for (const name2 of _names.disabled) {
33513
+ set(fieldValues, name2, void 0);
33514
+ }
33515
+ }
32916
33516
  unset(_formState.errors, "root");
32917
33517
  if (isEmptyObject(_formState.errors)) {
32918
33518
  _subjects.state.next({
@@ -32958,7 +33558,7 @@ function createFormControl(props = {}) {
32958
33558
  }
32959
33559
  if (!options2.keepError) {
32960
33560
  unset(_formState.errors, name2);
32961
- _proxyFormState.isValid && _updateValid();
33561
+ _proxyFormState.isValid && _setValid();
32962
33562
  }
32963
33563
  _subjects.state.next({ ..._formState });
32964
33564
  }
@@ -32996,13 +33596,15 @@ function createFormControl(props = {}) {
32996
33596
  }
32997
33597
  }
32998
33598
  }
32999
- _fields = {};
33599
+ for (const fieldName of _names.mount) {
33600
+ setValue(fieldName, get(values, fieldName));
33601
+ }
33000
33602
  }
33001
- _formValues = _options.shouldUnregister ? keepStateOptions.keepDefaultValues ? cloneObject(_defaultValues) : {} : cloneObject(values);
33603
+ _formValues = cloneObject(values);
33002
33604
  _subjects.array.next({
33003
33605
  values: { ...values }
33004
33606
  });
33005
- _subjects.values.next({
33607
+ _subjects.state.next({
33006
33608
  values: { ...values }
33007
33609
  });
33008
33610
  }
@@ -33040,7 +33642,7 @@ function createFormControl(props = {}) {
33040
33642
  }
33041
33643
  }
33042
33644
  };
33043
- const _updateFormState = (updatedFormState) => {
33645
+ const _setFormState = (updatedFormState) => {
33044
33646
  _formState = {
33045
33647
  ..._formState,
33046
33648
  ...updatedFormState
@@ -33052,28 +33654,28 @@ function createFormControl(props = {}) {
33052
33654
  isLoading: false
33053
33655
  });
33054
33656
  });
33055
- return {
33657
+ const methods = {
33056
33658
  control: {
33057
33659
  register,
33058
33660
  unregister,
33059
33661
  getFieldState,
33060
33662
  handleSubmit,
33061
33663
  setError,
33062
- _executeSchema,
33664
+ _subscribe,
33665
+ _runSchema,
33063
33666
  _getWatch,
33064
33667
  _getDirty,
33065
- _updateValid,
33066
- _removeUnmounted,
33067
- _updateFieldArray,
33068
- _updateDisabledField,
33668
+ _setValid,
33669
+ _setFieldArray,
33670
+ _setDisabledField,
33671
+ _setErrors,
33069
33672
  _getFieldArray,
33070
33673
  _reset,
33071
33674
  _resetDefaultValues,
33072
- _updateFormState,
33675
+ _removeUnmounted,
33073
33676
  _disableForm,
33074
33677
  _subjects,
33075
33678
  _proxyFormState,
33076
- _setErrors,
33077
33679
  get _fields() {
33078
33680
  return _fields;
33079
33681
  },
@@ -33098,9 +33700,6 @@ function createFormControl(props = {}) {
33098
33700
  get _formState() {
33099
33701
  return _formState;
33100
33702
  },
33101
- set _formState(value) {
33102
- _formState = value;
33103
- },
33104
33703
  get _options() {
33105
33704
  return _options;
33106
33705
  },
@@ -33111,6 +33710,7 @@ function createFormControl(props = {}) {
33111
33710
  };
33112
33711
  }
33113
33712
  },
33713
+ subscribe,
33114
33714
  trigger,
33115
33715
  register,
33116
33716
  handleSubmit,
@@ -33125,7 +33725,12 @@ function createFormControl(props = {}) {
33125
33725
  setFocus,
33126
33726
  getFieldState
33127
33727
  };
33728
+ return {
33729
+ ...methods,
33730
+ formControl: methods
33731
+ };
33128
33732
  }
33733
+ const useIsomorphicLayoutEffect$2 = typeof window !== "undefined" ? React__default.useLayoutEffect : React__default.useEffect;
33129
33734
  function useForm(props = {}) {
33130
33735
  const _formControl = React__default.useRef(void 0);
33131
33736
  const _values = React__default.useRef(void 0);
@@ -33143,25 +33748,50 @@ function useForm(props = {}) {
33143
33748
  validatingFields: {},
33144
33749
  errors: props.errors || {},
33145
33750
  disabled: props.disabled || false,
33751
+ isReady: false,
33146
33752
  defaultValues: isFunction(props.defaultValues) ? void 0 : props.defaultValues
33147
33753
  });
33148
33754
  if (!_formControl.current) {
33149
33755
  _formControl.current = {
33150
- ...createFormControl(props),
33756
+ ...props.formControl ? props.formControl : createFormControl(props),
33151
33757
  formState
33152
33758
  };
33759
+ if (props.formControl && props.defaultValues && !isFunction(props.defaultValues)) {
33760
+ props.formControl.reset(props.defaultValues, props.resetOptions);
33761
+ }
33153
33762
  }
33154
33763
  const control = _formControl.current.control;
33155
33764
  control._options = props;
33156
- useSubscribe({
33157
- subject: control._subjects.state,
33158
- next: (value) => {
33159
- if (shouldRenderFormState(value, control._proxyFormState, control._updateFormState, true)) {
33160
- updateFormState({ ...control._formState });
33161
- }
33162
- }
33163
- });
33765
+ useIsomorphicLayoutEffect$2(() => {
33766
+ const sub = control._subscribe({
33767
+ formState: control._proxyFormState,
33768
+ callback: () => updateFormState({ ...control._formState }),
33769
+ reRenderRoot: true
33770
+ });
33771
+ updateFormState((data) => ({
33772
+ ...data,
33773
+ isReady: true
33774
+ }));
33775
+ control._formState.isReady = true;
33776
+ return sub;
33777
+ }, [control]);
33164
33778
  React__default.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
33779
+ React__default.useEffect(() => {
33780
+ if (props.mode) {
33781
+ control._options.mode = props.mode;
33782
+ }
33783
+ if (props.reValidateMode) {
33784
+ control._options.reValidateMode = props.reValidateMode;
33785
+ }
33786
+ if (props.errors && !isEmptyObject(props.errors)) {
33787
+ control._setErrors(props.errors);
33788
+ }
33789
+ }, [control, props.errors, props.mode, props.reValidateMode]);
33790
+ React__default.useEffect(() => {
33791
+ props.shouldUnregister && control._subjects.state.next({
33792
+ values: control._getWatch()
33793
+ });
33794
+ }, [control, props.shouldUnregister]);
33165
33795
  React__default.useEffect(() => {
33166
33796
  if (control._proxyFormState.isDirty) {
33167
33797
  const isDirty = control._getDirty();
@@ -33180,15 +33810,10 @@ function useForm(props = {}) {
33180
33810
  } else {
33181
33811
  control._resetDefaultValues();
33182
33812
  }
33183
- }, [props.values, control]);
33184
- React__default.useEffect(() => {
33185
- if (props.errors) {
33186
- control._setErrors(props.errors);
33187
- }
33188
- }, [props.errors, control]);
33813
+ }, [control, props.values]);
33189
33814
  React__default.useEffect(() => {
33190
33815
  if (!control._state.mount) {
33191
- control._updateValid();
33816
+ control._setValid();
33192
33817
  control._state.mount = true;
33193
33818
  }
33194
33819
  if (control._state.watch) {
@@ -33197,11 +33822,6 @@ function useForm(props = {}) {
33197
33822
  }
33198
33823
  control._removeUnmounted();
33199
33824
  });
33200
- React__default.useEffect(() => {
33201
- props.shouldUnregister && control._subjects.values.next({
33202
- values: control._getWatch()
33203
- });
33204
- }, [props.shouldUnregister, control]);
33205
33825
  _formControl.current.formState = getProxyFormState(formState, control);
33206
33826
  return _formControl.current;
33207
33827
  }
@@ -33914,7 +34534,7 @@ var TooltipProvider = (props) => {
33914
34534
  disableHoverableContent = false,
33915
34535
  children
33916
34536
  } = props;
33917
- const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);
34537
+ const isOpenDelayedRef = React.useRef(true);
33918
34538
  const isPointerInTransitRef = React.useRef(false);
33919
34539
  const skipDelayTimerRef = React.useRef(0);
33920
34540
  React.useEffect(() => {
@@ -33925,16 +34545,16 @@ var TooltipProvider = (props) => {
33925
34545
  TooltipProviderContextProvider,
33926
34546
  {
33927
34547
  scope: __scopeTooltip,
33928
- isOpenDelayed,
34548
+ isOpenDelayedRef,
33929
34549
  delayDuration,
33930
34550
  onOpen: React.useCallback(() => {
33931
34551
  window.clearTimeout(skipDelayTimerRef.current);
33932
- setIsOpenDelayed(false);
34552
+ isOpenDelayedRef.current = false;
33933
34553
  }, []),
33934
34554
  onClose: React.useCallback(() => {
33935
34555
  window.clearTimeout(skipDelayTimerRef.current);
33936
34556
  skipDelayTimerRef.current = window.setTimeout(
33937
- () => setIsOpenDelayed(true),
34557
+ () => isOpenDelayedRef.current = true,
33938
34558
  skipDelayDuration
33939
34559
  );
33940
34560
  }, [skipDelayDuration]),
@@ -33955,7 +34575,7 @@ var Tooltip$1 = (props) => {
33955
34575
  __scopeTooltip,
33956
34576
  children,
33957
34577
  open: openProp,
33958
- defaultOpen = false,
34578
+ defaultOpen,
33959
34579
  onOpenChange,
33960
34580
  disableHoverableContent: disableHoverableContentProp,
33961
34581
  delayDuration: delayDurationProp
@@ -33968,9 +34588,9 @@ var Tooltip$1 = (props) => {
33968
34588
  const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
33969
34589
  const delayDuration = delayDurationProp ?? providerContext.delayDuration;
33970
34590
  const wasOpenDelayedRef = React.useRef(false);
33971
- const [open = false, setOpen] = useControllableState({
34591
+ const [open, setOpen] = useControllableState({
33972
34592
  prop: openProp,
33973
- defaultProp: defaultOpen,
34593
+ defaultProp: defaultOpen ?? false,
33974
34594
  onChange: (open2) => {
33975
34595
  if (open2) {
33976
34596
  providerContext.onOpen();
@@ -33979,7 +34599,8 @@ var Tooltip$1 = (props) => {
33979
34599
  providerContext.onClose();
33980
34600
  }
33981
34601
  onOpenChange == null ? void 0 : onOpenChange(open2);
33982
- }
34602
+ },
34603
+ caller: TOOLTIP_NAME
33983
34604
  });
33984
34605
  const stateAttribute = React.useMemo(() => {
33985
34606
  return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
@@ -34021,9 +34642,9 @@ var Tooltip$1 = (props) => {
34021
34642
  trigger,
34022
34643
  onTriggerChange: setTrigger,
34023
34644
  onTriggerEnter: React.useCallback(() => {
34024
- if (providerContext.isOpenDelayed) handleDelayedOpen();
34645
+ if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
34025
34646
  else handleOpen();
34026
- }, [providerContext.isOpenDelayed, handleDelayedOpen, handleOpen]),
34647
+ }, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
34027
34648
  onTriggerLeave: React.useCallback(() => {
34028
34649
  if (disableHoverableContent) {
34029
34650
  handleClose();
@@ -34074,6 +34695,9 @@ var TooltipTrigger = React.forwardRef(
34074
34695
  hasPointerMoveOpenedRef.current = false;
34075
34696
  }),
34076
34697
  onPointerDown: composeEventHandlers(props.onPointerDown, () => {
34698
+ if (context.open) {
34699
+ context.onClose();
34700
+ }
34077
34701
  isPointerDownRef.current = true;
34078
34702
  document.addEventListener("pointerup", handlePointerUp, { once: true });
34079
34703
  }),
@@ -34168,6 +34792,7 @@ var TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {
34168
34792
  return /* @__PURE__ */ jsx$1(TooltipContentImpl, { ...props, ref: composedRefs });
34169
34793
  });
34170
34794
  var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
34795
+ var Slottable = /* @__PURE__ */ createSlottable("TooltipContent");
34171
34796
  var TooltipContentImpl = React.forwardRef(
34172
34797
  (props, forwardedRef) => {
34173
34798
  const {
@@ -34307,10 +34932,12 @@ function isPointInPolygon(point, polygon2) {
34307
34932
  const { x: x2, y: y2 } = point;
34308
34933
  let inside = false;
34309
34934
  for (let i2 = 0, j = polygon2.length - 1; i2 < polygon2.length; j = i2++) {
34310
- const xi = polygon2[i2].x;
34311
- const yi = polygon2[i2].y;
34312
- const xj = polygon2[j].x;
34313
- const yj = polygon2[j].y;
34935
+ const ii = polygon2[i2];
34936
+ const jj = polygon2[j];
34937
+ const xi = ii.x;
34938
+ const yi = ii.y;
34939
+ const xj = jj.x;
34940
+ const yj = jj.y;
34314
34941
  const intersect = yi > y2 !== yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi;
34315
34942
  if (intersect) inside = !inside;
34316
34943
  }
@@ -34481,7 +35108,7 @@ const buttonVariants = cva(cn("inline-flex items-center justify-center gap-2", "
34481
35108
  }
34482
35109
  });
34483
35110
  const Button2 = React__default.forwardRef(({ variant, className, asChild = false, ...props }, ref) => {
34484
- const Comp = asChild ? Slot : "button";
35111
+ const Comp = asChild ? Slot$3 : "button";
34485
35112
  return jsx$1(Comp, { className: cn(buttonVariants({ variant, className })), ref, ...props });
34486
35113
  });
34487
35114
  const inputBaseStyles = cn(
@@ -34527,7 +35154,8 @@ var Tabs$1 = React.forwardRef(
34527
35154
  const [value, setValue] = useControllableState({
34528
35155
  prop: valueProp,
34529
35156
  onChange: onValueChange,
34530
- defaultProp: defaultValue
35157
+ defaultProp: defaultValue ?? "",
35158
+ caller: TABS_NAME
34531
35159
  });
34532
35160
  return /* @__PURE__ */ jsx$1(
34533
35161
  TabsProvider,
@@ -38029,6 +38657,7 @@ const berachain = /* @__PURE__ */ defineChain({
38029
38657
  url: "https://berascan.com"
38030
38658
  }
38031
38659
  },
38660
+ ensTlds: [".bera"],
38032
38661
  testnet: false
38033
38662
  });
38034
38663
  const berachainBepolia = /* @__PURE__ */ defineChain({
@@ -38103,6 +38732,7 @@ const berachainTestnetbArtio = /* @__PURE__ */ defineChain({
38103
38732
  blockCreated: 7736795
38104
38733
  }
38105
38734
  },
38735
+ ensTlds: [".bera"],
38106
38736
  rpcUrls: {
38107
38737
  default: { http: ["https://bartio.rpc.berachain.com"] }
38108
38738
  },
@@ -38873,18 +39503,11 @@ const fees = {
38873
39503
  var _a2;
38874
39504
  if (!((_a2 = params.request) == null ? void 0 : _a2.feeCurrency))
38875
39505
  return null;
38876
- const [gasPrice, maxPriorityFeePerGas, cel2] = await Promise.all([
39506
+ const [gasPrice, maxPriorityFeePerGas] = await Promise.all([
38877
39507
  estimateFeePerGasInFeeCurrency(params.client, params.request.feeCurrency),
38878
- estimateMaxPriorityFeePerGasInFeeCurrency(params.client, params.request.feeCurrency),
38879
- isCel2(params.client)
39508
+ estimateMaxPriorityFeePerGasInFeeCurrency(params.client, params.request.feeCurrency)
38880
39509
  ]);
38881
- const maxFeePerGas = cel2 ? (
38882
- // eth_gasPrice for cel2 returns baseFeePerGas + maxPriorityFeePerGas
38883
- params.multiply(gasPrice - maxPriorityFeePerGas) + maxPriorityFeePerGas
38884
- ) : (
38885
- // eth_gasPrice for Celo L1 returns (baseFeePerGas * multiplier), where the multiplier is 2 by default.
38886
- gasPrice + maxPriorityFeePerGas
38887
- );
39510
+ const maxFeePerGas = params.multiply(gasPrice - maxPriorityFeePerGas) + maxPriorityFeePerGas;
38888
39511
  return {
38889
39512
  maxFeePerGas,
38890
39513
  maxPriorityFeePerGas
@@ -38905,11 +39528,6 @@ async function estimateMaxPriorityFeePerGasInFeeCurrency(client2, feeCurrency) {
38905
39528
  });
38906
39529
  return BigInt(feesPerGas);
38907
39530
  }
38908
- async function isCel2(client2) {
38909
- const proxyAdminAddress = "0x4200000000000000000000000000000000000018";
38910
- const code2 = await getCode(client2, { address: proxyAdminAddress });
38911
- return Boolean(code2);
38912
- }
38913
39531
  function isEmpty(value) {
38914
39532
  return value === 0 || value === 0n || value === void 0 || value === null || value === "0" || value === "" || typeof value === "string" && (trim(value).toLowerCase() === "0x" || trim(value).toLowerCase() === "0x00");
38915
39533
  }
@@ -39259,7 +39877,7 @@ const confluxESpace = /* @__PURE__ */ defineChain({
39259
39877
  blockExplorers: {
39260
39878
  default: {
39261
39879
  name: "ConfluxScan",
39262
- url: "https://evm.confluxscan.io"
39880
+ url: "https://evm.confluxscan.org"
39263
39881
  }
39264
39882
  },
39265
39883
  contracts: {
@@ -39284,7 +39902,7 @@ const confluxESpaceTestnet = /* @__PURE__ */ defineChain({
39284
39902
  blockExplorers: {
39285
39903
  default: {
39286
39904
  name: "ConfluxScan",
39287
- url: "https://evmtestnet.confluxscan.io"
39905
+ url: "https://evmtestnet.confluxscan.org"
39288
39906
  }
39289
39907
  },
39290
39908
  contracts: {
@@ -39319,6 +39937,58 @@ const coreDao = /* @__PURE__ */ defineChain({
39319
39937
  },
39320
39938
  testnet: false
39321
39939
  });
39940
+ const coreTestnet1 = /* @__PURE__ */ defineChain({
39941
+ id: 1115,
39942
+ name: "Core Testnet",
39943
+ nativeCurrency: {
39944
+ decimals: 18,
39945
+ name: "tCore",
39946
+ symbol: "TCORE"
39947
+ },
39948
+ rpcUrls: {
39949
+ default: { http: ["https://rpc.test.btcs.network"] }
39950
+ },
39951
+ blockExplorers: {
39952
+ default: {
39953
+ name: "Core Testnet",
39954
+ url: "https://scan.test.btcs.network",
39955
+ apiUrl: "https://api.test.btcs.network/api"
39956
+ }
39957
+ },
39958
+ contracts: {
39959
+ multicall3: {
39960
+ address: "0xCcddF20A1932537123C2E48Bd8e00b108B8f7569",
39961
+ blockCreated: 29350509
39962
+ }
39963
+ },
39964
+ testnet: true
39965
+ });
39966
+ const coreTestnet2 = /* @__PURE__ */ defineChain({
39967
+ id: 1114,
39968
+ name: "Core Testnet2",
39969
+ nativeCurrency: {
39970
+ decimals: 18,
39971
+ name: "tCore2",
39972
+ symbol: "TCORE2"
39973
+ },
39974
+ rpcUrls: {
39975
+ default: { http: ["https://rpc.test2.btcs.network"] }
39976
+ },
39977
+ blockExplorers: {
39978
+ default: {
39979
+ name: "Core Testnet2",
39980
+ url: "https://scan.test2.btcs.network",
39981
+ apiUrl: "https://api.test2.btcs.network/api"
39982
+ }
39983
+ },
39984
+ contracts: {
39985
+ multicall3: {
39986
+ address: "0x3CB285ff3Cd5C7C7e570b1E7DE3De17A0f985e56",
39987
+ blockCreated: 3838600
39988
+ }
39989
+ },
39990
+ testnet: true
39991
+ });
39322
39992
  const sourceId$P = 1;
39323
39993
  const corn = /* @__PURE__ */ defineChain({
39324
39994
  id: 21e6,
@@ -41832,6 +42502,30 @@ const gravity = /* @__PURE__ */ defineChain({
41832
42502
  }
41833
42503
  }
41834
42504
  });
42505
+ const gunz = /* @__PURE__ */ defineChain({
42506
+ id: 43419,
42507
+ name: "Gunz Mainnet",
42508
+ nativeCurrency: { name: "GUN", symbol: "GUN", decimals: 18 },
42509
+ rpcUrls: {
42510
+ default: {
42511
+ http: [
42512
+ "https://rpc.gunzchain.io/ext/bc/2M47TxWHGnhNtq6pM5zPXdATBtuqubxn5EPFgFmEawCQr9WFML/rpc"
42513
+ ]
42514
+ }
42515
+ },
42516
+ blockExplorers: {
42517
+ default: {
42518
+ name: "Gunz Explorer",
42519
+ url: "https://gunzscan.io/"
42520
+ }
42521
+ },
42522
+ contracts: {
42523
+ multicall3: {
42524
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
42525
+ blockCreated: 70502
42526
+ }
42527
+ }
42528
+ });
41835
42529
  const guruNetwork = /* @__PURE__ */ defineChain({
41836
42530
  id: 260,
41837
42531
  name: "Guru Network Mainnet",
@@ -42260,6 +42954,12 @@ const hoodi = /* @__PURE__ */ defineChain({
42260
42954
  url: "https://hoodi.etherscan.io"
42261
42955
  }
42262
42956
  },
42957
+ contracts: {
42958
+ multicall3: {
42959
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
42960
+ blockCreated: 2589
42961
+ }
42962
+ },
42263
42963
  testnet: true
42264
42964
  });
42265
42965
  const hpb = /* @__PURE__ */ defineChain({
@@ -43473,6 +44173,23 @@ const lavita = /* @__PURE__ */ defineChain({
43473
44173
  },
43474
44174
  testnet: false
43475
44175
  });
44176
+ const lens = /* @__PURE__ */ defineChain({
44177
+ id: 232,
44178
+ name: "Lens",
44179
+ nativeCurrency: { name: "GHO", symbol: "GHO", decimals: 18 },
44180
+ rpcUrls: {
44181
+ default: {
44182
+ http: ["https://rpc.lens.xyz"]
44183
+ }
44184
+ },
44185
+ blockExplorers: {
44186
+ default: {
44187
+ name: "Lens Block Explorer",
44188
+ url: "https://explorer.lens.xyz",
44189
+ apiUrl: "https://explorer.lens.xyz/api"
44190
+ }
44191
+ }
44192
+ });
43476
44193
  const lensTestnet = /* @__PURE__ */ defineChain({
43477
44194
  id: 37111,
43478
44195
  name: "Lens Testnet",
@@ -43492,6 +44209,23 @@ const lensTestnet = /* @__PURE__ */ defineChain({
43492
44209
  },
43493
44210
  testnet: true
43494
44211
  });
44212
+ const lestnet = /* @__PURE__ */ defineChain({
44213
+ id: 21363,
44214
+ name: "Lestnet",
44215
+ nativeCurrency: { name: "Lestnet Ether", symbol: "LETH", decimals: 18 },
44216
+ rpcUrls: {
44217
+ default: {
44218
+ http: ["https://service.lestnet.org"]
44219
+ }
44220
+ },
44221
+ blockExplorers: {
44222
+ default: {
44223
+ name: "Lestnet Explorer",
44224
+ url: "https://explore.lestnet.org"
44225
+ }
44226
+ },
44227
+ testnet: true
44228
+ });
43495
44229
  const lightlinkPegasus = /* @__PURE__ */ defineChain({
43496
44230
  id: 1891,
43497
44231
  name: "LightLink Pegasus Testnet",
@@ -43650,8 +44384,17 @@ const linea = /* @__PURE__ */ defineChain({
43650
44384
  multicall3: {
43651
44385
  address: "0xcA11bde05977b3631167028862bE2a173976CA11",
43652
44386
  blockCreated: 42
44387
+ },
44388
+ ensRegistry: {
44389
+ address: "0x50130b669B28C339991d8676FA73CF122a121267",
44390
+ blockCreated: 6682888
44391
+ },
44392
+ ensUniversalResolver: {
44393
+ address: "0x3aA974fb3f8C1E02796048BDCdeD79e9D53a6965",
44394
+ blockCreated: 6683e3
43653
44395
  }
43654
44396
  },
44397
+ ensTlds: [".linea.eth"],
43655
44398
  testnet: false
43656
44399
  });
43657
44400
  const lineaGoerli = /* @__PURE__ */ defineChain({
@@ -43701,8 +44444,17 @@ const lineaSepolia = /* @__PURE__ */ defineChain({
43701
44444
  multicall3: {
43702
44445
  address: "0xca11bde05977b3631167028862be2a173976ca11",
43703
44446
  blockCreated: 227427
44447
+ },
44448
+ ensRegistry: {
44449
+ address: "0x5B2636F0f2137B4aE722C01dd5122D7d3e9541f7",
44450
+ blockCreated: 2395094
44451
+ },
44452
+ ensUniversalResolver: {
44453
+ address: "0x72560a31B3DAEE82B984a7F51c6b3b1bb7CC9F50",
44454
+ blockCreated: 2395255
43704
44455
  }
43705
44456
  },
44457
+ ensTlds: [".linea.eth"],
43706
44458
  testnet: true
43707
44459
  });
43708
44460
  const lineaTestnet = /* @__PURE__ */ defineChain({
@@ -44363,6 +45115,11 @@ const megaethTestnet = /* @__PURE__ */ defineChain({
44363
45115
  url: "https://www.megaexplorer.xyz/"
44364
45116
  }
44365
45117
  },
45118
+ contracts: {
45119
+ multicall3: {
45120
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11"
45121
+ }
45122
+ },
44366
45123
  testnet: true
44367
45124
  });
44368
45125
  const mekong = /* @__PURE__ */ defineChain({
@@ -44606,11 +45363,10 @@ const metis = /* @__PURE__ */ defineChain({
44606
45363
  "https://metis-andromeda.rpc.thirdweb.com",
44607
45364
  "https://metis-andromeda.gateway.tenderly.co",
44608
45365
  "https://metis.api.onfinality.io/public",
44609
- "wss://metis-rpc.publicnode.com",
44610
45366
  "https://andromeda.metis.io/?owner=1088",
44611
- "wss://metis.drpc.org",
44612
45367
  "https://metis-mainnet.public.blastapi.io"
44613
- ]
45368
+ ],
45369
+ webSocket: ["wss://metis-rpc.publicnode.com", "wss://metis.drpc.org"]
44614
45370
  }
44615
45371
  },
44616
45372
  blockExplorers: {
@@ -44638,11 +45394,11 @@ const metisSepolia = /* @__PURE__ */ defineChain({
44638
45394
  rpcUrls: {
44639
45395
  default: {
44640
45396
  http: [
44641
- "wss://metis-sepolia-rpc.publicnode.com",
44642
45397
  "https://sepolia.metisdevops.link",
44643
45398
  "https://metis-sepolia-rpc.publicnode.com",
44644
45399
  "https://metis-sepolia.gateway.tenderly.co"
44645
- ]
45400
+ ],
45401
+ webSocket: ["wss://metis-sepolia-rpc.publicnode.com"]
44646
45402
  }
44647
45403
  },
44648
45404
  blockExplorers: {
@@ -45230,7 +45986,7 @@ const newton = /* @__PURE__ */ defineChain({
45230
45986
  },
45231
45987
  rpcUrls: {
45232
45988
  default: {
45233
- http: ["hhttps://global.rpc.mainnet.newtonproject.org"]
45989
+ http: ["https://global.rpc.mainnet.newtonproject.org"]
45234
45990
  }
45235
45991
  },
45236
45992
  blockExplorers: {
@@ -45813,14 +46569,14 @@ const peaq = /* @__PURE__ */ defineChain({
45813
46569
  rpcUrls: {
45814
46570
  default: {
45815
46571
  http: [
46572
+ "https://peaq-rpc.publicnode.com",
45816
46573
  "https://peaq.api.onfinality.io/public",
45817
46574
  "https://peaq-rpc.dwellir.com",
45818
- "https://peaq-rpc.publicnode.com",
45819
46575
  "https://evm.peaq.network"
45820
46576
  ],
45821
46577
  webSocket: [
45822
- "wss://peaq.api.onfinality.io/public",
45823
46578
  "wss://peaq-rpc.publicnode.com",
46579
+ "wss://peaq.api.onfinality.io/public",
45824
46580
  "wss://peaq-rpc.dwellir.com"
45825
46581
  ]
45826
46582
  }
@@ -46109,8 +46865,8 @@ const plumeMainnet = /* @__PURE__ */ defineChain({
46109
46865
  },
46110
46866
  contracts: {
46111
46867
  multicall3: {
46112
- address: "0xF9DA0EF6635F6134D9d1B7eAE025159D26ce5838",
46113
- blockCreated: 4150
46868
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
46869
+ blockCreated: 39679
46114
46870
  }
46115
46871
  },
46116
46872
  sourceId: sourceId$o
@@ -46139,8 +46895,8 @@ const plumeSepolia = /* @__PURE__ */ defineChain({
46139
46895
  },
46140
46896
  contracts: {
46141
46897
  multicall3: {
46142
- address: "0x59218e2df2A2E7Ba0de00c023e80906Ba47cB4C8",
46143
- blockCreated: 1681
46898
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
46899
+ blockCreated: 199712
46144
46900
  }
46145
46901
  },
46146
46902
  testnet: true,
@@ -47674,7 +48430,7 @@ const skaleBlockBrawlers = /* @__PURE__ */ defineChain({
47674
48430
  });
47675
48431
  const skaleCalypso = /* @__PURE__ */ defineChain({
47676
48432
  id: 1564830818,
47677
- name: "SKALE | Calypso NFT Hub",
48433
+ name: "SKALE Calypso Hub",
47678
48434
  nativeCurrency: { name: "sFUEL", symbol: "sFUEL", decimals: 18 },
47679
48435
  rpcUrls: {
47680
48436
  default: {
@@ -47761,7 +48517,7 @@ const skaleCryptoColosseum = /* @__PURE__ */ defineChain({
47761
48517
  });
47762
48518
  const skaleEuropa = /* @__PURE__ */ defineChain({
47763
48519
  id: 2046399126,
47764
- name: "SKALE | Europa Liquidity Hub",
48520
+ name: "SKALE Europa Hub",
47765
48521
  nativeCurrency: { name: "sFUEL", symbol: "sFUEL", decimals: 18 },
47766
48522
  rpcUrls: {
47767
48523
  default: {
@@ -47808,7 +48564,7 @@ const skaleEuropaTestnet = /* @__PURE__ */ defineChain({
47808
48564
  });
47809
48565
  const skaleExorde = /* @__PURE__ */ defineChain({
47810
48566
  id: 2139927552,
47811
- name: "SKALE | Exorde",
48567
+ name: "Exorde Network",
47812
48568
  nativeCurrency: { name: "sFUEL", symbol: "sFUEL", decimals: 18 },
47813
48569
  rpcUrls: {
47814
48570
  default: {
@@ -47844,7 +48600,7 @@ const skaleHumanProtocol = /* @__PURE__ */ defineChain({
47844
48600
  });
47845
48601
  const skaleNebula = /* @__PURE__ */ defineChain({
47846
48602
  id: 1482601649,
47847
- name: "SKALE | Nebula Gaming Hub",
48603
+ name: "SKALE Nebula Hub",
47848
48604
  nativeCurrency: { name: "sFUEL", symbol: "sFUEL", decimals: 18 },
47849
48605
  rpcUrls: {
47850
48606
  default: {
@@ -47909,7 +48665,7 @@ const skaleRazor = /* @__PURE__ */ defineChain({
47909
48665
  });
47910
48666
  const skaleTitan = /* @__PURE__ */ defineChain({
47911
48667
  id: 1350216234,
47912
- name: "SKALE | Titan Community Hub",
48668
+ name: "SKALE Titan Hub",
47913
48669
  nativeCurrency: { name: "sFUEL", symbol: "sFUEL", decimals: 18 },
47914
48670
  rpcUrls: {
47915
48671
  default: {
@@ -47932,7 +48688,7 @@ const skaleTitan = /* @__PURE__ */ defineChain({
47932
48688
  });
47933
48689
  const skaleTitanTestnet = /* @__PURE__ */ defineChain({
47934
48690
  id: 1020352220,
47935
- name: "SKALE Titan Hub",
48691
+ name: "SKALE Titan Testnet",
47936
48692
  nativeCurrency: { name: "sFUEL", symbol: "sFUEL", decimals: 18 },
47937
48693
  rpcUrls: {
47938
48694
  default: {
@@ -48469,6 +49225,7 @@ const story = /* @__PURE__ */ defineChain({
48469
49225
  apiUrl: "https://storyscan.xyz/api/v2"
48470
49226
  }
48471
49227
  },
49228
+ ensTlds: [".ip"],
48472
49229
  testnet: false
48473
49230
  });
48474
49231
  const storyAeneid = /* @__PURE__ */ defineChain({
@@ -48504,6 +49261,7 @@ const storyAeneid = /* @__PURE__ */ defineChain({
48504
49261
  apiUrl: "https://aeneid.storyscan.xyz/api/v2"
48505
49262
  }
48506
49263
  },
49264
+ ensTlds: [".ip"],
48507
49265
  testnet: true
48508
49266
  });
48509
49267
  const storyOdyssey = /* @__PURE__ */ defineChain({
@@ -48766,6 +49524,31 @@ const swellchain = /* @__PURE__ */ defineChain({
48766
49524
  }
48767
49525
  }
48768
49526
  });
49527
+ const swellchainTestnet = /* @__PURE__ */ defineChain({
49528
+ ...chainConfig$2,
49529
+ id: 1924,
49530
+ name: "Swellchain Testnet",
49531
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
49532
+ rpcUrls: {
49533
+ default: {
49534
+ http: ["https://swell-testnet.alt.technology"]
49535
+ }
49536
+ },
49537
+ blockExplorers: {
49538
+ default: {
49539
+ name: "Swellchain Testnet Explorer",
49540
+ url: "https://swell-testnet-explorer.alt.technology",
49541
+ apiUrl: "https://swell-testnet-explorer.alt.technology/api"
49542
+ }
49543
+ },
49544
+ contracts: {
49545
+ ...chainConfig$2.contracts,
49546
+ multicall3: {
49547
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
49548
+ blockCreated: 1
49549
+ }
49550
+ }
49551
+ });
48769
49552
  const swissdlt = /* @__PURE__ */ defineChain({
48770
49553
  id: 94,
48771
49554
  name: "SwissDLT Mainnet",
@@ -49307,6 +50090,23 @@ const tron = /* @__PURE__ */ defineChain({
49307
50090
  }
49308
50091
  }
49309
50092
  });
50093
+ const tronShasta = /* @__PURE__ */ defineChain({
50094
+ id: 2494104990,
50095
+ name: "Tron Shasta",
50096
+ nativeCurrency: { name: "TRON", symbol: "TRX", decimals: 6 },
50097
+ rpcUrls: {
50098
+ default: {
50099
+ http: ["https://api.shasta.trongrid.io/jsonrpc"]
50100
+ }
50101
+ },
50102
+ blockExplorers: {
50103
+ default: {
50104
+ name: "Tronscan",
50105
+ url: "https://shasta.tronscan.org"
50106
+ }
50107
+ },
50108
+ testnet: true
50109
+ });
49310
50110
  const ubiq = /* @__PURE__ */ defineChain({
49311
50111
  id: 8,
49312
50112
  name: "Ubiq Mainnet",
@@ -49794,6 +50594,25 @@ const wemixTestnet = /* @__PURE__ */ defineChain({
49794
50594
  },
49795
50595
  testnet: true
49796
50596
  });
50597
+ const westendAssetHub = /* @__PURE__ */ defineChain({
50598
+ id: 420420421,
50599
+ name: "Westend Asset Hub",
50600
+ nativeCurrency: {
50601
+ decimals: 18,
50602
+ name: "Westies",
50603
+ symbol: "WND"
50604
+ },
50605
+ rpcUrls: {
50606
+ default: { http: ["https://westend-asset-hub-eth-rpc.polkadot.io"] }
50607
+ },
50608
+ blockExplorers: {
50609
+ default: {
50610
+ name: "subscan",
50611
+ url: "https://westend-asset-hub-eth-explorer.parity.io"
50612
+ }
50613
+ },
50614
+ testnet: true
50615
+ });
49797
50616
  const whitechain = /* @__PURE__ */ defineChain({
49798
50617
  testnet: false,
49799
50618
  name: "Whitechain",
@@ -51046,6 +51865,8 @@ const chains = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
51046
51865
  confluxESpace,
51047
51866
  confluxESpaceTestnet,
51048
51867
  coreDao,
51868
+ coreTestnet1,
51869
+ coreTestnet2,
51049
51870
  corn,
51050
51871
  cornTestnet,
51051
51872
  crab,
@@ -51154,6 +51975,7 @@ const chains = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
51154
51975
  godwoken,
51155
51976
  goerli,
51156
51977
  gravity,
51978
+ gunz,
51157
51979
  guruNetwork,
51158
51980
  guruTestnet,
51159
51981
  ham,
@@ -51226,7 +52048,9 @@ const chains = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
51226
52048
  l3x,
51227
52049
  l3xTestnet,
51228
52050
  lavita,
52051
+ lens,
51229
52052
  lensTestnet,
52053
+ lestnet,
51230
52054
  lightlinkPegasus,
51231
52055
  lightlinkPhoenix,
51232
52056
  linea,
@@ -51434,6 +52258,7 @@ const chains = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
51434
52258
  swanProximaTestnet,
51435
52259
  swanSaturnTestnet,
51436
52260
  swellchain,
52261
+ swellchainTestnet,
51437
52262
  swissdlt,
51438
52263
  syscoin,
51439
52264
  syscoinTestnet,
@@ -51460,6 +52285,7 @@ const chains = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
51460
52285
  treasure,
51461
52286
  treasureTopaz,
51462
52287
  tron,
52288
+ tronShasta,
51463
52289
  ubiq,
51464
52290
  ultra,
51465
52291
  ultraTestnet,
@@ -51483,6 +52309,7 @@ const chains = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
51483
52309
  weaveVMAlphanet,
51484
52310
  wemix,
51485
52311
  wemixTestnet,
52312
+ westendAssetHub,
51486
52313
  whitechain,
51487
52314
  whitechainTestnet,
51488
52315
  wmcTestnet,
@@ -52858,7 +53685,7 @@ const buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /
52858
53685
  mountCallbacks,
52859
53686
  unmountCallbacks,
52860
53687
  storeHooks,
52861
- // atom intercepters
53688
+ // atom interceptors
52862
53689
  atomRead,
52863
53690
  atomWrite,
52864
53691
  atomOnInit,
@@ -52993,8 +53820,7 @@ function createStore() {
52993
53820
  if ((__vite_import_meta_env__$2 ? "production" : void 0) !== "production") {
52994
53821
  return createDevStoreRev4();
52995
53822
  }
52996
- const store = INTERNAL_buildStoreRev1();
52997
- return store;
53823
+ return INTERNAL_buildStoreRev1();
52998
53824
  }
52999
53825
  let defaultStore;
53000
53826
  function getDefaultStore() {
@@ -53036,20 +53862,23 @@ function Provider({
53036
53862
  );
53037
53863
  }
53038
53864
  const isPromiseLike$1 = (x2) => typeof (x2 == null ? void 0 : x2.then) === "function";
53039
- const attachPromiseMeta = (promise) => {
53040
- promise.status = "pending";
53041
- promise.then(
53042
- (v2) => {
53043
- promise.status = "fulfilled";
53044
- promise.value = v2;
53045
- },
53046
- (e2) => {
53047
- promise.status = "rejected";
53048
- promise.reason = e2;
53049
- }
53050
- );
53865
+ const attachPromiseStatus = (promise) => {
53866
+ if (!promise.status) {
53867
+ promise.status = "pending";
53868
+ promise.then(
53869
+ (v2) => {
53870
+ promise.status = "fulfilled";
53871
+ promise.value = v2;
53872
+ },
53873
+ (e2) => {
53874
+ promise.status = "rejected";
53875
+ promise.reason = e2;
53876
+ }
53877
+ );
53878
+ }
53051
53879
  };
53052
- const use = React__default.use || ((promise) => {
53880
+ const use = React__default.use || // A shim for older React versions
53881
+ ((promise) => {
53053
53882
  if (promise.status === "pending") {
53054
53883
  throw promise;
53055
53884
  } else if (promise.status === "fulfilled") {
@@ -53057,7 +53886,7 @@ const use = React__default.use || ((promise) => {
53057
53886
  } else if (promise.status === "rejected") {
53058
53887
  throw promise.reason;
53059
53888
  } else {
53060
- attachPromiseMeta(promise);
53889
+ attachPromiseStatus(promise);
53061
53890
  throw promise;
53062
53891
  }
53063
53892
  });
@@ -53100,6 +53929,7 @@ const createContinuablePromise = (promise, getValue) => {
53100
53929
  return continuablePromise;
53101
53930
  };
53102
53931
  function useAtomValue(atom2, options2) {
53932
+ const { delay, unstable_promiseStatus: promiseStatus = !React__default.use } = {};
53103
53933
  const store = useStore();
53104
53934
  const [[valueFromReducer, storeFromReducer, atomFromReducer], rerender] = useReducer(
53105
53935
  (prev2) => {
@@ -53117,17 +53947,34 @@ function useAtomValue(atom2, options2) {
53117
53947
  rerender();
53118
53948
  value = store.get(atom2);
53119
53949
  }
53120
- const delay = void 0;
53121
53950
  useEffect(() => {
53122
53951
  const unsub = store.sub(atom2, () => {
53952
+ if (promiseStatus) {
53953
+ try {
53954
+ const value2 = store.get(atom2);
53955
+ if (isPromiseLike$1(value2)) {
53956
+ attachPromiseStatus(
53957
+ createContinuablePromise(value2, () => store.get(atom2))
53958
+ );
53959
+ }
53960
+ } catch (e2) {
53961
+ }
53962
+ }
53963
+ if (typeof delay === "number") {
53964
+ setTimeout(rerender, delay);
53965
+ return;
53966
+ }
53123
53967
  rerender();
53124
53968
  });
53125
53969
  rerender();
53126
53970
  return unsub;
53127
- }, [store, atom2, delay]);
53971
+ }, [store, atom2, delay, promiseStatus]);
53128
53972
  useDebugValue(value);
53129
53973
  if (isPromiseLike$1(value)) {
53130
53974
  const promise = createContinuablePromise(value, () => store.get(atom2));
53975
+ if (promiseStatus) {
53976
+ attachPromiseStatus(promise);
53977
+ }
53131
53978
  return use(promise);
53132
53979
  }
53133
53980
  return value;
@@ -73811,7 +74658,7 @@ const useFilteredDocumentModels = () => {
73811
74658
  return filteredDocumentModels;
73812
74659
  };
73813
74660
  async function loadBaseEditors() {
73814
- const documentModelEditor = await __vitePreload(() => import("./index-BQuSynqj.js"), true ? __vite__mapDeps([4,2,1,3]) : void 0);
74661
+ const documentModelEditor = await __vitePreload(() => import("./index-B469WXKP.js"), true ? __vite__mapDeps([4,2,1,3]) : void 0);
73815
74662
  await __vitePreload(() => Promise.resolve({}), true ? __vite__mapDeps([5]) : void 0);
73816
74663
  const module = documentModelEditor.documentModelEditorModule;
73817
74664
  return [module];
@@ -73962,11 +74809,11 @@ const connectCrypto = (async () => {
73962
74809
  return window.connectCrypto;
73963
74810
  }
73964
74811
  const { ConnectCrypto: ConnectCrypto2 } = await __vitePreload(async () => {
73965
- const { ConnectCrypto: ConnectCrypto3 } = await import("./index-CXtQlZED.js");
74812
+ const { ConnectCrypto: ConnectCrypto3 } = await import("./index-M4h38SB3.js");
73966
74813
  return { ConnectCrypto: ConnectCrypto3 };
73967
74814
  }, true ? __vite__mapDeps([6,1,2,3]) : void 0);
73968
74815
  const { BrowserKeyStorage: BrowserKeyStorage2 } = await __vitePreload(async () => {
73969
- const { BrowserKeyStorage: BrowserKeyStorage3 } = await import("./index-CXtQlZED.js");
74816
+ const { BrowserKeyStorage: BrowserKeyStorage3 } = await import("./index-M4h38SB3.js");
73970
74817
  return { BrowserKeyStorage: BrowserKeyStorage3 };
73971
74818
  }, true ? __vite__mapDeps([6,1,2,3]) : void 0);
73972
74819
  const connectCrypto2 = new ConnectCrypto2(new BrowserKeyStorage2());
@@ -74015,7 +74862,7 @@ function useRenown() {
74015
74862
  return;
74016
74863
  }
74017
74864
  const { initRenownBrowser } = await __vitePreload(async () => {
74018
- const { initRenownBrowser: initRenownBrowser2 } = await import("./index-CXtQlZED.js");
74865
+ const { initRenownBrowser: initRenownBrowser2 } = await import("./index-M4h38SB3.js");
74019
74866
  return { initRenownBrowser: initRenownBrowser2 };
74020
74867
  }, true ? __vite__mapDeps([6,1,2,3]) : void 0);
74021
74868
  const renownBrowser = initRenownBrowser(did2);
@@ -81456,16 +82303,16 @@ function useHotkeys(keys, callback, options2, dependencies) {
81456
82303
  }
81457
82304
  };
81458
82305
  var domNode = ref || (_options == null ? void 0 : _options.document) || document;
81459
- domNode.addEventListener("keyup", handleKeyUp);
81460
- domNode.addEventListener("keydown", handleKeyDown);
82306
+ domNode.addEventListener("keyup", handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);
82307
+ domNode.addEventListener("keydown", handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);
81461
82308
  if (proxy) {
81462
82309
  parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
81463
82310
  return proxy.addHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));
81464
82311
  });
81465
82312
  }
81466
82313
  return function() {
81467
- domNode.removeEventListener("keyup", handleKeyUp);
81468
- domNode.removeEventListener("keydown", handleKeyDown);
82314
+ domNode.removeEventListener("keyup", handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);
82315
+ domNode.removeEventListener("keydown", handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);
81469
82316
  if (proxy) {
81470
82317
  parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
81471
82318
  return proxy.removeHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));
@@ -82899,7 +83746,7 @@ function Home() {
82899
83746
  /* @__PURE__ */ jsx$1(HomeScreenAddDriveItem, { onClick: onAddDriveClick })
82900
83747
  ] });
82901
83748
  }
82902
- const Content = React__default.lazy(() => __vitePreload(() => import("./content-ZNvpO_Bf.js"), true ? __vite__mapDeps([7,2,1,3]) : void 0));
83749
+ const Content = React__default.lazy(() => __vitePreload(() => import("./content-CsEKVDJz.js"), true ? __vite__mapDeps([7,2,1,3]) : void 0));
82903
83750
  async function createRouter(routes) {
82904
83751
  var _a2;
82905
83752
  const isPackaged = await ((_a2 = window.electronAPI) == null ? void 0 : _a2.isPackaged());
@@ -83051,12 +83898,14 @@ export {
83051
83898
  stringify$1 as aQ,
83052
83899
  decodeErrorResult as aR,
83053
83900
  isAddressEqual as aS,
83054
- call as aT,
83055
- concat$3 as aU,
83056
- encodeAbiParameters as aV,
83057
- HttpRequestError as aW,
83058
- isHex as aX,
83059
- app as aY,
83901
+ localBatchGatewayUrl as aT,
83902
+ localBatchGatewayRequest as aU,
83903
+ call as aV,
83904
+ concat$3 as aW,
83905
+ encodeAbiParameters as aX,
83906
+ HttpRequestError as aY,
83907
+ isHex as aZ,
83908
+ app as a_,
83060
83909
  useFilteredDocumentModels as aa,
83061
83910
  useDriveEditor as ab,
83062
83911
  useDocumentDriveById as ac,
@@ -83072,7 +83921,7 @@ export {
83072
83921
  cva as am,
83073
83922
  FormProvider as an,
83074
83923
  Controller as ao,
83075
- Slot as ap,
83924
+ Slot$3 as ap,
83076
83925
  useForm as aq,
83077
83926
  Root2 as ar,
83078
83927
  List as as,