{"status":"1","message":"OK","result":[{"SourceCode":"{{\"language\":\"Solidity\",\"sources\":{\"src/facets/WithdrawalFacet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.24;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {LibAuth} from \\\"../libraries/LibAuth.sol\\\";\\nimport {LibEIP712} from \\\"../libraries/LibEIP712.sol\\\";\\nimport {LibDirectMode} from \\\"../libraries/LibDirectMode.sol\\\";\\nimport {LibReentrancyGuard} from \\\"../libraries/LibReentrancyGuard.sol\\\";\\n\\n// ============ Withdrawal EIP-712 Type Hashes (facet-local) ============\\n\\nbytes32 constant EXECUTOR_WITHDRAWAL_TYPEHASH = keccak256(\\n    \\\"ExecutorWithdrawal(bytes32 signer,address token,address to,uint256 amount,uint256 nonce,uint256 deadline)\\\"\\n);\\n\\nbytes32 constant DIRECT_WITHDRAWAL_TYPEHASH = keccak256(\\n    \\\"DirectWithdrawal(bytes32 signer,address token,address to,uint256 amount,uint256 nonce,uint256 deadline)\\\"\\n);\\n\\n/**\\n * @title WithdrawalFacet\\n * @notice Handles wallet withdrawals (executor co-signed and direct)\\n * @dev Uses unified owner signatures (ECDSA, EIP-1271, or WebAuthn) for user operations.\\n *\\n * Withdrawal patterns:\\n * 1. Executor (owner + executor co-sign) - When executor is active:\\n *    - User signs with any registered signer\\n *    - Factory executor co-signs (EOA or SC via SignatureChecker)\\n *    - Withdrawal executes immediately\\n *\\n * 2. Direct (owner only) - When user is in direct mode:\\n *    - User must enter direct mode (1h cooldown)\\n *    - After direct mode activates, user can withdraw directly\\n *    - No executor signature required\\n *\\n * ACCESS CONTROL:\\n * | Function                  | Who Can Call                          |\\n * |---------------------------|---------------------------------------|\\n * | executorEthWithdrawal     | Any signer + factory executor co-sign |\\n * | executorTokenWithdrawal   | Any signer + factory executor co-sign |\\n * | directEthWithdrawal       | Any registered signer (in direct mode)|\\n * | directTokenWithdrawal     | Any registered signer (in direct mode)|\\n */\\ncontract WithdrawalFacet {\\n    using SafeERC20 for IERC20;\\n\\n    /// @dev Thrown when the signature deadline has passed\\n    error WithdrawalExpired();\\n\\n    /// @dev Thrown when recipient address is zero\\n    error ZeroAddress();\\n\\n    /// @dev Thrown when withdrawal amount is zero\\n    error ZeroAmount();\\n\\n    /// @dev Thrown when trying to withdraw ETH via executor token withdrawal function\\n    error UseExecutorEthWithdrawal();\\n\\n    /// @dev Thrown when trying to withdraw ETH via direct token withdrawal function\\n    error UseDirectEthWithdrawal();\\n\\n    /// @dev Thrown when ETH transfer fails\\n    error EthTransferFailed();\\n\\n    // events\\n\\n    event ExecutorWithdrawal(address indexed token, address indexed to, uint256 amount);\\n\\n    event DirectWithdrawal(address indexed token, address indexed to, uint256 amount);\\n\\n    // ============ View Functions ============\\n\\n    /// @notice Get ETH balance of this wallet\\n    function ethBalance() external view returns (uint256) {\\n        return address(this).balance;\\n    }\\n\\n    /// @notice Get ERC20 token balance of this wallet\\n    /// @param token ERC20 token contract address\\n    /// @return The token balance held by this wallet\\n    function tokenBalance(address token) external view returns (uint256) {\\n        return IERC20(token).balanceOf(address(this));\\n    }\\n\\n    // ============ Executor Withdrawals (Owner + Executor Co-Signed) ============\\n\\n    /// @notice Executor ETH withdrawal with dual signature (owner + executor)\\n    /// @param signer Expected signer key bound into payload and nonce scope\\n    /// @param to Recipient address\\n    /// @param amount ETH amount in wei\\n    /// @param nonce Per-signer nonce for replay protection\\n    /// @param deadline Signature expiration timestamp\\n    /// @param ownerSig Type-prefixed signature from any registered signer\\n    /// @param executorSig Executor co-signature (ECDSA or EIP-1271)\\n    function executorEthWithdrawal(\\n        bytes32 signer,\\n        address to,\\n        uint256 amount,\\n        uint256 nonce,\\n        uint256 deadline,\\n        bytes calldata ownerSig,\\n        bytes calldata executorSig\\n    ) external {\\n        LibReentrancyGuard.enforceNonReentrant();\\n\\n        LibDirectMode.enforceExecutorNotBlocked();\\n        if (block.timestamp > deadline) revert WithdrawalExpired();\\n        if (to == address(0)) revert ZeroAddress();\\n        if (amount == 0) revert ZeroAmount();\\n\\n        bytes32 structHash = _hashExecutorWithdrawal(signer, address(0), to, amount, nonce, deadline);\\n        bytes32 digest = LibEIP712.toTypedDataHash(structHash);\\n\\n        bytes32 signerKey = LibAuth.verifyOwnerSignature(digest, ownerSig);\\n        if (signerKey != signer) revert LibAuth.SignerMismatch(signer, signerKey);\\n        LibAuth.verifyExecutorSignature(digest, executorSig);\\n        LibAuth._useCheckedNonce(signerKey, nonce);\\n\\n        // `to` and `amount` are bound into the EIP-712 digest verified by the\\n        // owner + executor signatures above — funds cannot be redirected without\\n        // a valid signature over this exact recipient. Slither's arbitrary-send-eth\\n        // detector only recognizes msg.sender-based guards, not signature auth.\\n        // slither-disable-next-line arbitrary-send-eth\\n        (bool success,) = to.call{value: amount}(\\\"\\\");\\n        if (!success) revert EthTransferFailed();\\n\\n        // Event after ETH transfer is intentional — emit reflects executed transfer.\\n        // Reentrancy guarded by LibReentrancyGuard.enforceNonReentrant().\\n        // slither-disable-next-line reentrancy-events\\n        emit ExecutorWithdrawal(address(0), to, amount);\\n\\n        LibReentrancyGuard.clearReentrantFlag();\\n    }\\n\\n    /// @notice Executor ERC20 token withdrawal with dual signature (owner + executor)\\n    /// @param signer Expected signer key bound into payload and nonce scope\\n    /// @param token ERC20 token contract address\\n    /// @param to Recipient address\\n    /// @param amount Token amount\\n    /// @param nonce Per-signer nonce for replay protection\\n    /// @param deadline Signature expiration timestamp\\n    /// @param ownerSig Type-prefixed signature from any registered signer\\n    /// @param executorSig Executor co-signature (ECDSA or EIP-1271)\\n    function executorTokenWithdrawal(\\n        bytes32 signer,\\n        address token,\\n        address to,\\n        uint256 amount,\\n        uint256 nonce,\\n        uint256 deadline,\\n        bytes calldata ownerSig,\\n        bytes calldata executorSig\\n    ) external {\\n        LibReentrancyGuard.enforceNonReentrant();\\n\\n        LibDirectMode.enforceExecutorNotBlocked();\\n        if (block.timestamp > deadline) revert WithdrawalExpired();\\n        if (token == address(0)) revert UseExecutorEthWithdrawal();\\n        if (to == address(0)) revert ZeroAddress();\\n        if (amount == 0) revert ZeroAmount();\\n\\n        bytes32 structHash = _hashExecutorWithdrawal(signer, token, to, amount, nonce, deadline);\\n        bytes32 digest = LibEIP712.toTypedDataHash(structHash);\\n\\n        bytes32 signerKey = LibAuth.verifyOwnerSignature(digest, ownerSig);\\n        if (signerKey != signer) revert LibAuth.SignerMismatch(signer, signerKey);\\n        LibAuth.verifyExecutorSignature(digest, executorSig);\\n        LibAuth._useCheckedNonce(signerKey, nonce);\\n\\n        IERC20(token).safeTransfer(to, amount);\\n\\n        emit ExecutorWithdrawal(token, to, amount);\\n\\n        LibReentrancyGuard.clearReentrantFlag();\\n    }\\n\\n    // ============ Direct Withdrawals (When In Direct Mode) ============\\n\\n    /// @notice Direct ETH withdrawal when user is in direct mode\\n    /// @param signer Expected signer key bound into payload and nonce scope\\n    /// @param to Recipient address\\n    /// @param amount ETH amount in wei\\n    /// @param nonce Per-signer nonce for replay protection\\n    /// @param deadline Signature expiration timestamp\\n    /// @param ownerSig Type-prefixed signature from any registered signer\\n    function directEthWithdrawal(\\n        bytes32 signer,\\n        address to,\\n        uint256 amount,\\n        uint256 nonce,\\n        uint256 deadline,\\n        bytes calldata ownerSig\\n    ) external {\\n        LibReentrancyGuard.enforceNonReentrant();\\n\\n        // CHECKS - User must be in direct mode\\n        if (!LibDirectMode.isDirectMode()) {\\n            revert LibDirectMode.DirectAccessNotAvailable();\\n        }\\n        if (block.timestamp > deadline) revert WithdrawalExpired();\\n        if (to == address(0)) revert ZeroAddress();\\n        if (amount == 0) revert ZeroAmount();\\n\\n        // EFFECTS\\n        bytes32 structHash = _hashDirectWithdrawal(\\n            signer,\\n            address(0), // ETH\\n            to,\\n            amount,\\n            nonce,\\n            deadline\\n        );\\n        bytes32 digest = LibEIP712.toTypedDataHash(structHash);\\n\\n        bytes32 signerKey = LibAuth.verifyOwnerSignature(digest, ownerSig);\\n        if (signerKey != signer) revert LibAuth.SignerMismatch(signer, signerKey);\\n        LibAuth._useCheckedNonce(signerKey, nonce);\\n\\n        // INTERACTIONS\\n        // `to` and `amount` are bound into the EIP-712 digest verified by the\\n        // owner signature above — funds cannot be redirected without a valid\\n        // signature over this exact recipient. Direct mode allows the user to\\n        // bypass executor co-signature; signature auth still binds destination.\\n        // slither-disable-next-line arbitrary-send-eth\\n        (bool success,) = to.call{value: amount}(\\\"\\\");\\n        if (!success) revert EthTransferFailed();\\n\\n        // Event after ETH transfer is intentional — emit reflects executed transfer.\\n        // Reentrancy guarded by LibReentrancyGuard.enforceNonReentrant().\\n        // slither-disable-next-line reentrancy-events\\n        emit DirectWithdrawal(address(0), to, amount);\\n\\n        LibReentrancyGuard.clearReentrantFlag();\\n    }\\n\\n    /// @notice Direct ERC20 token withdrawal when user is in direct mode\\n    /// @param signer Expected signer key bound into payload and nonce scope\\n    /// @param token ERC20 token address\\n    /// @param to Recipient address\\n    /// @param amount Token amount\\n    /// @param nonce Per-signer nonce for replay protection\\n    /// @param deadline Signature expiration timestamp\\n    /// @param ownerSig Type-prefixed signature from any registered signer\\n    function directTokenWithdrawal(\\n        bytes32 signer,\\n        address token,\\n        address to,\\n        uint256 amount,\\n        uint256 nonce,\\n        uint256 deadline,\\n        bytes calldata ownerSig\\n    ) external {\\n        LibReentrancyGuard.enforceNonReentrant();\\n\\n        // CHECKS - User must be in direct mode\\n        if (!LibDirectMode.isDirectMode()) {\\n            revert LibDirectMode.DirectAccessNotAvailable();\\n        }\\n        if (block.timestamp > deadline) revert WithdrawalExpired();\\n        if (token == address(0)) revert UseDirectEthWithdrawal();\\n        if (to == address(0)) revert ZeroAddress();\\n        if (amount == 0) revert ZeroAmount();\\n\\n        // EFFECTS\\n        bytes32 structHash = _hashDirectWithdrawal(signer, token, to, amount, nonce, deadline);\\n        bytes32 digest = LibEIP712.toTypedDataHash(structHash);\\n\\n        bytes32 signerKey = LibAuth.verifyOwnerSignature(digest, ownerSig);\\n        if (signerKey != signer) revert LibAuth.SignerMismatch(signer, signerKey);\\n        LibAuth._useCheckedNonce(signerKey, nonce);\\n\\n        // INTERACTIONS\\n        IERC20(token).safeTransfer(to, amount);\\n\\n        emit DirectWithdrawal(token, to, amount);\\n\\n        LibReentrancyGuard.clearReentrantFlag();\\n    }\\n\\n    // ============ Private EIP-712 Hash Functions ============\\n\\n    function _hashExecutorWithdrawal(\\n        bytes32 signer,\\n        address token,\\n        address to,\\n        uint256 amount,\\n        uint256 nonce,\\n        uint256 deadline\\n    ) private pure returns (bytes32) {\\n        return keccak256(abi.encode(EXECUTOR_WITHDRAWAL_TYPEHASH, signer, token, to, amount, nonce, deadline));\\n    }\\n\\n    function _hashDirectWithdrawal(\\n        bytes32 signer,\\n        address token,\\n        address to,\\n        uint256 amount,\\n        uint256 nonce,\\n        uint256 deadline\\n    ) private pure returns (bytes32) {\\n        return keccak256(abi.encode(DIRECT_WITHDRAWAL_TYPEHASH, signer, token, to, amount, nonce, deadline));\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity >=0.4.16;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n    /**\\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n     * another (`to`).\\n     *\\n     * Note that `value` may be zero.\\n     */\\n    event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n    /**\\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n     * a call to {approve}. `value` is the new allowance.\\n     */\\n    event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n    /**\\n     * @dev Returns the value of tokens in existence.\\n     */\\n    function totalSupply() external view returns (uint256);\\n\\n    /**\\n     * @dev Returns the value of tokens owned by `account`.\\n     */\\n    function balanceOf(address account) external view returns (uint256);\\n\\n    /**\\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * Emits a {Transfer} event.\\n     */\\n    function transfer(address to, uint256 value) external returns (bool);\\n\\n    /**\\n     * @dev Returns the remaining number of tokens that `spender` will be\\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n     * zero by default.\\n     *\\n     * This value changes when {approve} or {transferFrom} are called.\\n     */\\n    function allowance(address owner, address spender) external view returns (uint256);\\n\\n    /**\\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n     * caller's tokens.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n     * that someone may use both the old and the new allowance by unfortunate\\n     * transaction ordering. One possible solution to mitigate this race\\n     * condition is to first reduce the spender's allowance to 0 and set the\\n     * desired value afterwards:\\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n     *\\n     * Emits an {Approval} event.\\n     */\\n    function approve(address spender, uint256 value) external returns (bool);\\n\\n    /**\\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n     * allowance mechanism. `value` is then deducted from the caller's\\n     * allowance.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * Emits a {Transfer} event.\\n     */\\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC1363} from \\\"../../../interfaces/IERC1363.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n    /**\\n     * @dev An operation with an ERC-20 token failed.\\n     */\\n    error SafeERC20FailedOperation(address token);\\n\\n    /**\\n     * @dev Indicates a failed `decreaseAllowance` request.\\n     */\\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n    /**\\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n     * non-reverting calls are assumed to be successful.\\n     */\\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n        if (!_safeTransfer(token, to, value, true)) {\\n            revert SafeERC20FailedOperation(address(token));\\n        }\\n    }\\n\\n    /**\\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n     */\\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n        if (!_safeTransferFrom(token, from, to, value, true)) {\\n            revert SafeERC20FailedOperation(address(token));\\n        }\\n    }\\n\\n    /**\\n     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.\\n     */\\n    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {\\n        return _safeTransfer(token, to, value, false);\\n    }\\n\\n    /**\\n     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.\\n     */\\n    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {\\n        return _safeTransferFrom(token, from, to, value, false);\\n    }\\n\\n    /**\\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n     * non-reverting calls are assumed to be successful.\\n     *\\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n     * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n     */\\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n        uint256 oldAllowance = token.allowance(address(this), spender);\\n        forceApprove(token, spender, oldAllowance + value);\\n    }\\n\\n    /**\\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n     * value, non-reverting calls are assumed to be successful.\\n     *\\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n     * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n     */\\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n        unchecked {\\n            uint256 currentAllowance = token.allowance(address(this), spender);\\n            if (currentAllowance < requestedDecrease) {\\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n            }\\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\\n        }\\n    }\\n\\n    /**\\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n     * to be set to zero before setting it to a non-zero value, such as USDT.\\n     *\\n     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\\n     * only sets the \\\"standard\\\" allowance. Any temporary allowance will remain active, in addition to the value being\\n     * set here.\\n     */\\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n        if (!_safeApprove(token, spender, value, false)) {\\n            if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));\\n            if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));\\n        }\\n    }\\n\\n    /**\\n     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\\n     * code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when\\n     * targeting contracts.\\n     *\\n     * Reverts if the returned value is other than `true`.\\n     */\\n    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n        if (to.code.length == 0) {\\n            safeTransfer(token, to, value);\\n        } else if (!token.transferAndCall(to, value, data)) {\\n            revert SafeERC20FailedOperation(address(token));\\n        }\\n    }\\n\\n    /**\\n     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\\n     * has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when\\n     * targeting contracts.\\n     *\\n     * Reverts if the returned value is other than `true`.\\n     */\\n    function transferFromAndCallRelaxed(\\n        IERC1363 token,\\n        address from,\\n        address to,\\n        uint256 value,\\n        bytes memory data\\n    ) internal {\\n        if (to.code.length == 0) {\\n            safeTransferFrom(token, from, to, value);\\n        } else if (!token.transferFromAndCall(from, to, value, data)) {\\n            revert SafeERC20FailedOperation(address(token));\\n        }\\n    }\\n\\n    /**\\n     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n     * targeting contracts.\\n     *\\n     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\\n     * Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\\n     * once without retrying, and relies on the returned value to be true.\\n     *\\n     * Reverts if the returned value is other than `true`.\\n     */\\n    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n        if (to.code.length == 0) {\\n            forceApprove(token, to, value);\\n        } else if (!token.approveAndCall(to, value, data)) {\\n            revert SafeERC20FailedOperation(address(token));\\n        }\\n    }\\n\\n    /**\\n     * @dev Imitates a Solidity `token.transfer(to, value)` call, relaxing the requirement on the return value: the\\n     * return value is optional (but if data is returned, it must not be false).\\n     *\\n     * @param token The token targeted by the call.\\n     * @param to The recipient of the tokens\\n     * @param value The amount of token to transfer\\n     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.\\n     */\\n    function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {\\n        bytes4 selector = IERC20.transfer.selector;\\n\\n        assembly (\\\"memory-safe\\\") {\\n            let fmp := mload(0x40)\\n            mstore(0x00, selector)\\n            mstore(0x04, and(to, shr(96, not(0))))\\n            mstore(0x24, value)\\n            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)\\n            // if call success and return is true, all is good.\\n            // otherwise (not success or return is not true), we need to perform further checks\\n            if iszero(and(success, eq(mload(0x00), 1))) {\\n                // if the call was a failure and bubble is enabled, bubble the error\\n                if and(iszero(success), bubble) {\\n                    returndatacopy(fmp, 0x00, returndatasize())\\n                    revert(fmp, returndatasize())\\n                }\\n                // if the return value is not true, then the call is only successful if:\\n                // - the token address has code\\n                // - the returndata is empty\\n                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))\\n            }\\n            mstore(0x40, fmp)\\n        }\\n    }\\n\\n    /**\\n     * @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, relaxing the requirement on the return\\n     * value: the return value is optional (but if data is returned, it must not be false).\\n     *\\n     * @param token The token targeted by the call.\\n     * @param from The sender of the tokens\\n     * @param to The recipient of the tokens\\n     * @param value The amount of token to transfer\\n     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.\\n     */\\n    function _safeTransferFrom(\\n        IERC20 token,\\n        address from,\\n        address to,\\n        uint256 value,\\n        bool bubble\\n    ) private returns (bool success) {\\n        bytes4 selector = IERC20.transferFrom.selector;\\n\\n        assembly (\\\"memory-safe\\\") {\\n            let fmp := mload(0x40)\\n            mstore(0x00, selector)\\n            mstore(0x04, and(from, shr(96, not(0))))\\n            mstore(0x24, and(to, shr(96, not(0))))\\n            mstore(0x44, value)\\n            success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)\\n            // if call success and return is true, all is good.\\n            // otherwise (not success or return is not true), we need to perform further checks\\n            if iszero(and(success, eq(mload(0x00), 1))) {\\n                // if the call was a failure and bubble is enabled, bubble the error\\n                if and(iszero(success), bubble) {\\n                    returndatacopy(fmp, 0x00, returndatasize())\\n                    revert(fmp, returndatasize())\\n                }\\n                // if the return value is not true, then the call is only successful if:\\n                // - the token address has code\\n                // - the returndata is empty\\n                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))\\n            }\\n            mstore(0x40, fmp)\\n            mstore(0x60, 0)\\n        }\\n    }\\n\\n    /**\\n     * @dev Imitates a Solidity `token.approve(spender, value)` call, relaxing the requirement on the return value:\\n     * the return value is optional (but if data is returned, it must not be false).\\n     *\\n     * @param token The token targeted by the call.\\n     * @param spender The spender of the tokens\\n     * @param value The amount of token to transfer\\n     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.\\n     */\\n    function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {\\n        bytes4 selector = IERC20.approve.selector;\\n\\n        assembly (\\\"memory-safe\\\") {\\n            let fmp := mload(0x40)\\n            mstore(0x00, selector)\\n            mstore(0x04, and(spender, shr(96, not(0))))\\n            mstore(0x24, value)\\n            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)\\n            // if call success and return is true, all is good.\\n            // otherwise (not success or return is not true), we need to perform further checks\\n            if iszero(and(success, eq(mload(0x00), 1))) {\\n                // if the call was a failure and bubble is enabled, bubble the error\\n                if and(iszero(success), bubble) {\\n                    returndatacopy(fmp, 0x00, returndatasize())\\n                    revert(fmp, returndatasize())\\n                }\\n                // if the return value is not true, then the call is only successful if:\\n                // - the token address has code\\n                // - the returndata is empty\\n                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))\\n            }\\n            mstore(0x40, fmp)\\n        }\\n    }\\n}\\n\"},\"src/libraries/LibAuth.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.24;\\n\\nimport {ECDSA} from \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport {SignatureChecker} from \\\"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\\\";\\nimport {WebAuthn} from \\\"@openzeppelin/contracts/utils/cryptography/WebAuthn.sol\\\";\\nimport {P256} from \\\"@openzeppelin/contracts/utils/cryptography/P256.sol\\\";\\nimport {LibFactory} from \\\"./LibFactory.sol\\\";\\nimport {IUserProxyFactory} from \\\"../interfaces/IUserProxyFactory.sol\\\";\\n\\n/**\\n * @title LibAuth\\n * @notice Unified authentication library for diamond-pattern smart wallets\\n * @dev Supports both address-based owners (EOA/smart contract) and P256 passkey\\n *      owners, with unified signature verification via a type-prefix byte.\\n *\\n * Storage layout (diamond storage at keccak256(\\\"wallet.auth.storage.v1\\\")):\\n * - owners[]:       Array of registered EOA/SC addresses\\n * - passkeys[]:     Array of P256 public key coordinates\\n * - signerNonces:   Per-signer replay protection counters (mapping(bytes32 => uint256))\\n * - Timelocked pending additions/removals for both owner types\\n *\\n * Signature format (first byte = type discriminator):\\n * - 0x00: ECDSA — recover signer from sig[1:], verify isOwner\\n * - 0x01: EIP-1271 — extract address from sig[1:21], verify via SignatureChecker\\n * - 0x02: WebAuthn — decode sig[1:] as WebAuthnAuth, verify against any passkey\\n *\\n * Security considerations:\\n * - Linear scans for owner/passkey lookups are acceptable because arrays are\\n *   bounded by MAX_OWNERS (10) and MAX_PASSKEYS (10).\\n * - All signer additions/removals go through timelocked pending states to give\\n *   wallet owners time to detect and cancel unauthorized changes.\\n * - Last-signer protection prevents removing the final signer (across both types).\\n * - Recovery paths (addPasskeyDirect, addOwnerDirect) bypass timelocks but are\\n *   only callable from the RecoveryFacet after its own delay has passed.\\n */\\nlibrary LibAuth {\\n    // ============ Errors ============\\n\\n    /// @dev Thrown when trying to initialize an already initialized wallet\\n    error AlreadyInitialized();\\n\\n    /// @dev Thrown when passkey public key coordinates are zero\\n    error InvalidPublicKey();\\n\\n    /// @dev Thrown when owner address is the zero address\\n    error InvalidOwnerAddress();\\n\\n    /// @dev Thrown when passkey index is out of bounds\\n    error PasskeyIndexOutOfBounds();\\n\\n    /// @dev Thrown when trying to remove the last signer (across both types)\\n    error CannotRemoveLastSigner();\\n\\n    /// @dev Thrown when passkey already exists in the active set\\n    error PasskeyAlreadyExists();\\n\\n    /// @dev Thrown when owner address already exists in the active set\\n    error OwnerAlreadyExists();\\n\\n    /// @dev Thrown when passkey coordinates are not a valid P256 curve point\\n    error PublicKeyNotOnCurve();\\n\\n    // -- Pending passkey errors --\\n\\n    /// @dev Thrown when pending passkey action does not exist\\n    error PendingPasskeyNotFound();\\n\\n    /// @dev Thrown when pending passkey cooldown has not elapsed\\n    error PendingPasskeyNotReady();\\n\\n    /// @dev Thrown when passkey already has a pending addition\\n    error PasskeyAlreadyPending();\\n\\n    /// @dev Thrown when pending passkey removal does not exist\\n    error PendingPasskeyRemovalNotFound();\\n\\n    /// @dev Thrown when pending passkey removal cooldown has not elapsed\\n    error PendingPasskeyRemovalNotReady();\\n\\n    /// @dev Thrown when passkey already has a pending removal\\n    error PasskeyRemovalAlreadyPending();\\n\\n    /// @dev Thrown when maximum number of passkeys reached\\n    error MaxPasskeysReached();\\n\\n    // -- Pending owner errors --\\n\\n    /// @dev Thrown when pending owner action does not exist\\n    error PendingOwnerNotFound();\\n\\n    /// @dev Thrown when pending owner cooldown has not elapsed\\n    error PendingOwnerNotReady();\\n\\n    /// @dev Thrown when owner already has a pending addition\\n    error OwnerAlreadyPending();\\n\\n    /// @dev Thrown when pending owner removal does not exist\\n    error PendingOwnerRemovalNotFound();\\n\\n    /// @dev Thrown when pending owner removal cooldown has not elapsed\\n    error PendingOwnerRemovalNotReady();\\n\\n    /// @dev Thrown when owner already has a pending removal\\n    error OwnerRemovalAlreadyPending();\\n\\n    /// @dev Thrown when maximum number of owners reached\\n    error MaxOwnersReached();\\n\\n    /// @dev Thrown when a pending action array has reached the maximum size\\n    error MaxPendingActionsReached();\\n\\n    // -- Lookup errors (during timelocked removal execution) --\\n\\n    /// @dev Thrown when a passkey scheduled for removal no longer exists\\n    error PasskeyNotFound();\\n\\n    /// @dev Thrown when an owner scheduled for removal no longer exists\\n    error OwnerNotFound();\\n\\n    // -- Signature verification errors --\\n\\n    /// @dev Thrown when the signature type prefix byte is unknown\\n    error InvalidSignatureType();\\n\\n    /// @dev Thrown when WebAuthn signature verification fails against all passkeys\\n    error InvalidWebAuthnSignature();\\n\\n    /// @dev Thrown when WebAuthnAuth struct fails basic validation\\n    error InvalidWebAuthnAuthStruct();\\n\\n    /// @dev Thrown when no signers (owners or passkeys) are registered\\n    error NoSignersRegistered();\\n\\n    /// @dev Thrown when ECDSA-recovered address is not a registered owner\\n    error NotAuthorizedOwner();\\n\\n    /// @dev Thrown when EIP-1271 contract signature verification fails\\n    error InvalidContractSignature();\\n\\n    /// @dev Thrown when signature payload is empty (no type byte)\\n    error EmptySignature();\\n\\n    /// @dev Thrown when executor address is not set in factory\\n    error ExecutorNotSet();\\n\\n    /// @dev Thrown when executor signature verification fails\\n    error InvalidExecutorSignature();\\n\\n    /// @dev Thrown when a per-signer nonce doesn't match the expected value\\n    error InvalidNonce(bytes32 signerKey, uint256 expected);\\n\\n    /// @dev Thrown when the recovered signer does not match the expected signer key\\n    error SignerMismatch(bytes32 expected, bytes32 actual);\\n\\n    /// @dev Thrown when the pending owner is the current executor (TOCTOU re-check)\\n    error ExecutorCannotBeOwner();\\n\\n    /// @dev Thrown when a pending action has expired (past its TTL)\\n    error PendingActionExpired();\\n\\n    // ============ Constants ============\\n\\n    /// @notice Diamond storage slot for AuthStorage\\n    bytes32 constant AUTH_STORAGE_POSITION = keccak256(\\\"wallet.auth.storage.v1\\\");\\n\\n    /// @notice Maximum number of address owners per wallet (prevents gas DoS)\\n    uint256 constant MAX_OWNERS = 10;\\n\\n    /// @notice Maximum number of passkeys per wallet (prevents gas DoS)\\n    uint256 constant MAX_PASSKEYS = 10;\\n\\n    /// @notice Maximum number of pending actions per type (prevents gas DoS from unbounded arrays)\\n    uint256 constant MAX_PENDING_ACTIONS = 20;\\n\\n    /// @notice Default cooldown for signer additions (24 hours)\\n    uint256 constant DEFAULT_SIGNER_ADDITION_COOLDOWN = 24 hours;\\n\\n    /// @notice Default cooldown for signer removals (24 hours)\\n    uint256 constant DEFAULT_SIGNER_REMOVAL_COOLDOWN = 24 hours;\\n\\n    /// @notice Time-to-live for pending signer actions (7 days from initiation)\\n    uint256 constant PENDING_ACTION_TTL = 7 days;\\n\\n    // -- Signature type discriminators (first byte of ownerSig) --\\n\\n    /// @notice ECDSA signature from an EOA owner\\n    uint8 constant SIG_TYPE_ECDSA = 0;\\n\\n    /// @notice EIP-1271 signature from a smart contract owner\\n    uint8 constant SIG_TYPE_EIP1271 = 1;\\n\\n    /// @notice WebAuthn/P256 signature from a passkey owner\\n    uint8 constant SIG_TYPE_WEBAUTHN = 2;\\n\\n    /// @notice Whether to require User Verification (biometric/PIN) for WebAuthn signatures\\n    /// @dev Set to false for convenience mode; upgrade implementation to enable stricter security.\\n    bool constant REQUIRE_USER_VERIFICATION = false;\\n\\n    /// @notice Byte length of an encoded address signer (used in RecoveryFacet)\\n    uint256 constant SIGNER_LENGTH_ADDRESS = 20;\\n\\n    /// @notice Byte length of an encoded passkey signer (qx + qy, used in RecoveryFacet)\\n    uint256 constant SIGNER_LENGTH_PASSKEY = 64;\\n\\n    /// @notice Minimum authenticatorData length: 32 (rpIdHash) + 1 (flags) + 4 (signCount)\\n    uint256 constant MIN_AUTHENTICATOR_DATA_LENGTH = 37;\\n\\n    // ============ Types ============\\n\\n    /// @notice P256 public key coordinates\\n    struct Passkey {\\n        bytes32 qx;\\n        bytes32 qy;\\n    }\\n\\n    /// @notice Pending owner addition (timelocked for security)\\n    struct PendingOwner {\\n        address owner; // Address to add as owner\\n        uint64 activatesAt; // Timestamp when addition can be executed\\n        uint64 expiresAt; // Timestamp when this pending action expires\\n        bool exists; // Whether this pending entry exists\\n    }\\n\\n    /// @notice Pending owner removal (timelocked for security)\\n    struct PendingOwnerRemoval {\\n        address owner; // Address to remove\\n        uint64 executesAt; // Timestamp when removal can be executed\\n        uint64 expiresAt; // Timestamp when this pending action expires\\n        bool exists; // Whether this pending entry exists\\n    }\\n\\n    /// @notice Pending passkey addition (timelocked for security)\\n    struct PendingPasskey {\\n        bytes32 qx; // P256 X coordinate\\n        bytes32 qy; // P256 Y coordinate\\n        uint64 activatesAt; // Timestamp when passkey can be activated\\n        uint64 expiresAt; // Timestamp when this pending action expires\\n        bool exists; // Whether this pending entry exists\\n    }\\n\\n    /// @notice Pending passkey removal (timelocked for security)\\n    struct PendingPasskeyRemoval {\\n        uint256 passkeyIndex; // Index of passkey to remove\\n        bytes32 qx; // P256 X coordinate (for verification)\\n        bytes32 qy; // P256 Y coordinate (for verification)\\n        uint64 executesAt; // Timestamp when removal can be executed\\n        uint64 expiresAt; // Timestamp when this pending action expires\\n        bool exists; // Whether this pending entry exists\\n    }\\n\\n    /// @notice Main authentication storage struct (diamond storage)\\n    struct AuthStorage {\\n        // -- Active signers --\\n        address[] owners; // Registered EOA/SC addresses\\n        Passkey[] passkeys; // Registered P256 public keys\\n\\n        // -- Replay protection --\\n        mapping(bytes32 => uint256) signerNonces; // per-signer nonce (0 = first use)\\n\\n        // -- Cooldown configuration --\\n        uint256 signerAdditionCooldown; // Cooldown for new signer additions\\n        uint256 signerRemovalCooldown; // Cooldown for signer removals\\n\\n        // -- Pending owner additions --\\n        mapping(bytes32 => PendingOwner) pendingOwners;\\n        bytes32[] pendingOwnerIds;\\n\\n        // -- Pending owner removals --\\n        mapping(bytes32 => PendingOwnerRemoval) pendingOwnerRemovals;\\n        bytes32[] pendingOwnerRemovalIds;\\n\\n        // -- Pending passkey additions --\\n        mapping(bytes32 => PendingPasskey) pendingPasskeys;\\n        bytes32[] pendingPasskeyIds;\\n\\n        // -- Pending passkey removals --\\n        mapping(bytes32 => PendingPasskeyRemoval) pendingPasskeyRemovals;\\n        bytes32[] pendingPasskeyRemovalIds;\\n    }\\n\\n    // ============ Storage Access ============\\n\\n    /// @notice Access the AuthStorage struct at its diamond storage slot\\n    /// @return aus Storage pointer to AuthStorage\\n    function authStorage() internal pure returns (AuthStorage storage aus) {\\n        bytes32 position = AUTH_STORAGE_POSITION;\\n        assembly {\\n            aus.slot := position\\n        }\\n    }\\n\\n    // ============ Initialization ============\\n\\n    /// @notice Initialize wallet with a single passkey owner\\n    /// @param _qx P256 public key X coordinate\\n    /// @param _qy P256 public key Y coordinate\\n    function initializeWithPasskey(bytes32 _qx, bytes32 _qy) internal {\\n        AuthStorage storage aus = authStorage();\\n        if (aus.owners.length + aus.passkeys.length > 0) revert AlreadyInitialized();\\n        if (_qx == bytes32(0) || _qy == bytes32(0)) revert InvalidPublicKey();\\n        if (!P256.isValidPublicKey(_qx, _qy)) revert PublicKeyNotOnCurve();\\n\\n        aus.passkeys.push(Passkey({qx: _qx, qy: _qy}));\\n        _setDefaultCooldowns(aus);\\n    }\\n\\n    /// @notice Initialize wallet with a single address owner\\n    /// @param _owner EOA or smart contract address\\n    function initializeWithOwner(address _owner) internal {\\n        AuthStorage storage aus = authStorage();\\n        if (aus.owners.length + aus.passkeys.length > 0) revert AlreadyInitialized();\\n        if (_owner == address(0)) revert InvalidOwnerAddress();\\n        if (_owner == address(this)) revert InvalidOwnerAddress();\\n\\n        address currentExecutor = IUserProxyFactory(LibFactory.getFactory()).executor();\\n        if (_owner == currentExecutor) revert ExecutorCannotBeOwner();\\n\\n        aus.owners.push(_owner);\\n        _setDefaultCooldowns(aus);\\n    }\\n\\n    /// @notice Initialize wallet with both a passkey and an address owner\\n    /// @param _qx P256 public key X coordinate\\n    /// @param _qy P256 public key Y coordinate\\n    /// @param _owner EOA or smart contract address\\n    function initializeWithBoth(bytes32 _qx, bytes32 _qy, address _owner) internal {\\n        AuthStorage storage aus = authStorage();\\n        if (aus.owners.length + aus.passkeys.length > 0) revert AlreadyInitialized();\\n        if (_qx == bytes32(0) || _qy == bytes32(0)) revert InvalidPublicKey();\\n        if (!P256.isValidPublicKey(_qx, _qy)) revert PublicKeyNotOnCurve();\\n        if (_owner == address(0)) revert InvalidOwnerAddress();\\n        if (_owner == address(this)) revert InvalidOwnerAddress();\\n\\n        address currentExecutor = IUserProxyFactory(LibFactory.getFactory()).executor();\\n        if (_owner == currentExecutor) revert ExecutorCannotBeOwner();\\n\\n        aus.passkeys.push(Passkey({qx: _qx, qy: _qy}));\\n        aus.owners.push(_owner);\\n        _setDefaultCooldowns(aus);\\n    }\\n\\n    /// @dev Set default cooldown values on the storage struct\\n    function _setDefaultCooldowns(AuthStorage storage aus) private {\\n        aus.signerAdditionCooldown = DEFAULT_SIGNER_ADDITION_COOLDOWN;\\n        aus.signerRemovalCooldown = DEFAULT_SIGNER_REMOVAL_COOLDOWN;\\n    }\\n\\n    // ============ Signature Verification ============\\n\\n    /**\\n     * @notice Verify that a signature was produced by a registered owner or passkey\\n     * @dev The first byte of `ownerSig` is a type discriminator:\\n     *      - 0x00 (ECDSA):   sig[1:] is a 65-byte ECDSA signature; recovered address must be an owner\\n     *      - 0x01 (EIP1271): sig[1:21] is the signer address, sig[21:] is the contract signature\\n     *      - 0x02 (WebAuthn): sig[1:] is ABI-encoded WebAuthn.WebAuthnAuth; verified against all passkeys\\n     *\\n     * @param digest The EIP-712 digest that was signed\\n     * @param ownerSig The type-prefixed signature bytes\\n     * @return signerKey The bytes32 key identifying which signer was verified\\n     *         (from _ownerKey for EOA/EIP-1271, from _passkeyKey for WebAuthn)\\n     *\\n     * @custom:reverts EmptySignature if ownerSig is empty\\n     * @custom:reverts InvalidSignatureType if type byte is unknown\\n     * @custom:reverts NotAuthorizedOwner if ECDSA signer is not an owner\\n     * @custom:reverts InvalidContractSignature if EIP-1271 verification fails\\n     * @custom:reverts InvalidWebAuthnSignature if no passkey matches the WebAuthn signature\\n     * @custom:reverts NoSignersRegistered if no passkeys exist (for WebAuthn path)\\n     */\\n    function verifyOwnerSignature(bytes32 digest, bytes calldata ownerSig) internal view returns (bytes32 signerKey) {\\n        if (ownerSig.length == 0) revert EmptySignature();\\n\\n        uint8 sigType = uint8(ownerSig[0]);\\n\\n        if (sigType == SIG_TYPE_ECDSA) {\\n            return _verifyECDSA(digest, ownerSig[1:]);\\n        } else if (sigType == SIG_TYPE_EIP1271) {\\n            return _verifyEIP1271(digest, ownerSig[1:]);\\n        } else if (sigType == SIG_TYPE_WEBAUTHN) {\\n            return _verifyWebAuthn(digest, ownerSig[1:]);\\n        } else {\\n            revert InvalidSignatureType();\\n        }\\n    }\\n\\n    /**\\n     * @notice Verify that a signature was produced by the factory executor\\n     * @dev Used by dual-sign functions (withdrawals, allowance setting).\\n     *      Supports both EOA executors (ECDSA) and SC executors (EIP-1271) via SignatureChecker.\\n     *\\n     * @param digest The EIP-712 digest that was signed\\n     * @param executorSig The executor's signature bytes\\n     */\\n    function verifyExecutorSignature(bytes32 digest, bytes calldata executorSig) internal view {\\n        address factoryExecutor = IUserProxyFactory(LibFactory.getFactory()).executor();\\n        if (factoryExecutor == address(0)) revert ExecutorNotSet();\\n        if (!SignatureChecker.isValidSignatureNowCalldata(factoryExecutor, digest, executorSig)) {\\n            revert InvalidExecutorSignature();\\n        }\\n    }\\n\\n    /**\\n     * @dev Verify an ECDSA signature and confirm the recovered address is a registered owner\\n     * @param digest The signed digest\\n     * @param sig The 65-byte ECDSA signature (v, r, s)\\n     * @return signerKey The owner key for the recovered address\\n     */\\n    function _verifyECDSA(bytes32 digest, bytes calldata sig) private view returns (bytes32) {\\n        address recovered = ECDSA.recoverCalldata(digest, sig);\\n        if (!isOwner(recovered)) revert NotAuthorizedOwner();\\n        return _ownerKey(recovered);\\n    }\\n\\n    /**\\n     * @dev Verify an EIP-1271 smart contract signature\\n     * @param digest The signed digest\\n     * @param payload sig[1:] after the type byte, where first 20 bytes = signer address\\n     * @return signerKey The owner key for the contract signer address\\n     */\\n    function _verifyEIP1271(bytes32 digest, bytes calldata payload) private view returns (bytes32) {\\n        // Need at least 20 bytes for the address\\n        if (payload.length < SIGNER_LENGTH_ADDRESS) revert InvalidContractSignature();\\n\\n        address signer = address(bytes20(payload[:SIGNER_LENGTH_ADDRESS]));\\n        if (!isOwner(signer)) revert NotAuthorizedOwner();\\n        if (signer.code.length == 0) revert InvalidContractSignature();\\n\\n        bytes calldata contractSig = payload[SIGNER_LENGTH_ADDRESS:];\\n        // SignatureChecker.isValidSignatureNow handles both EOA and ERC-1271 verification.\\n        // We use the memory overload since calldata→memory conversion is needed for\\n        // the external call to the signer contract.\\n        bool valid = SignatureChecker.isValidSignatureNow(signer, digest, bytes(contractSig));\\n        if (!valid) revert InvalidContractSignature();\\n        return _ownerKey(signer);\\n    }\\n\\n    /**\\n     * @dev Verify a WebAuthn signature against all registered passkeys\\n     * @param digest The signed digest (used as the WebAuthn challenge)\\n     * @param payload ABI-encoded WebAuthn.WebAuthnAuth struct\\n     * @return signerKey The passkey key for the matched passkey\\n     */\\n    function _verifyWebAuthn(bytes32 digest, bytes calldata payload) private view returns (bytes32) {\\n        // Decode the WebAuthn auth struct from the payload\\n        WebAuthn.WebAuthnAuth memory auth = abi.decode(payload, (WebAuthn.WebAuthnAuth));\\n\\n        // Validate auth struct format before trying any signature verification\\n        _validateWebAuthnAuthStruct(auth);\\n\\n        // Get all passkeys from storage\\n        AuthStorage storage aus = authStorage();\\n        uint256 pkCount = aus.passkeys.length;\\n        if (pkCount == 0) revert NoSignersRegistered();\\n\\n        // Build the challenge as bytes (WebAuthn.verify expects bytes memory)\\n        bytes memory challenge = abi.encodePacked(digest);\\n\\n        // Try each passkey — succeed if any matches\\n        for (uint256 i = 0; i < pkCount;) {\\n            bool valid =\\n                WebAuthn.verify(challenge, auth, aus.passkeys[i].qx, aus.passkeys[i].qy, REQUIRE_USER_VERIFICATION);\\n            if (valid) return _passkeyKey(aus.passkeys[i].qx, aus.passkeys[i].qy);\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n\\n        // No passkey matched\\n        revert InvalidWebAuthnSignature();\\n    }\\n\\n    /**\\n     * @dev Validate basic constraints on a WebAuthnAuth struct before verification\\n     * @param auth The WebAuthn assertion data to validate\\n     *\\n     * Requirements:\\n     * - r and s must be non-zero (valid P256 signature components)\\n     * - authenticatorData must be at least 37 bytes (rpIdHash + flags + signCount)\\n     * - clientDataJSON must be non-empty\\n     * - challengeIndex and typeIndex must be within clientDataJSON bounds\\n     */\\n    function _validateWebAuthnAuthStruct(WebAuthn.WebAuthnAuth memory auth) private pure {\\n        // Signature components must be non-zero\\n        if (auth.r == bytes32(0) || auth.s == bytes32(0)) {\\n            revert InvalidWebAuthnAuthStruct();\\n        }\\n\\n        if (auth.authenticatorData.length < MIN_AUTHENTICATOR_DATA_LENGTH) {\\n            revert InvalidWebAuthnAuthStruct();\\n        }\\n\\n        // ClientDataJSON must be non-empty\\n        if (bytes(auth.clientDataJSON).length == 0) {\\n            revert InvalidWebAuthnAuthStruct();\\n        }\\n\\n        // Indexes must be within clientDataJSON bounds\\n        uint256 jsonLen = bytes(auth.clientDataJSON).length;\\n        if (auth.challengeIndex >= jsonLen || auth.typeIndex >= jsonLen) {\\n            revert InvalidWebAuthnAuthStruct();\\n        }\\n    }\\n\\n    // ============ Query Functions ============\\n\\n    /// @notice Check if an address is a registered owner\\n    /// @param _owner Address to check\\n    /// @return True if `_owner` is in the owners array\\n    function isOwner(address _owner) internal view returns (bool) {\\n        AuthStorage storage aus = authStorage();\\n        uint256 len = aus.owners.length;\\n        for (uint256 i = 0; i < len;) {\\n            if (aus.owners[i] == _owner) {\\n                return true;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n        return false;\\n    }\\n\\n    /// @notice Check if a passkey with the given coordinates is registered\\n    /// @param _qx P256 X coordinate\\n    /// @param _qy P256 Y coordinate\\n    /// @return True if a matching passkey exists\\n    function hasPasskey(bytes32 _qx, bytes32 _qy) internal view returns (bool) {\\n        AuthStorage storage aus = authStorage();\\n        uint256 len = aus.passkeys.length;\\n        for (uint256 i = 0; i < len;) {\\n            if (aus.passkeys[i].qx == _qx && aus.passkeys[i].qy == _qy) {\\n                return true;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n        return false;\\n    }\\n\\n    /// @notice Get the total count of all signers (owners + passkeys)\\n    /// @return Total number of registered signers\\n    function totalSignerCount() internal view returns (uint256) {\\n        AuthStorage storage aus = authStorage();\\n        return aus.owners.length + aus.passkeys.length;\\n    }\\n\\n    /// @notice Get all registered address owners\\n    /// @return Array of owner addresses\\n    function getOwners() internal view returns (address[] memory) {\\n        return authStorage().owners;\\n    }\\n\\n    /// @notice Get the number of registered address owners\\n    /// @return Count of owners\\n    function getOwnerCount() internal view returns (uint256) {\\n        return authStorage().owners.length;\\n    }\\n\\n    /// @notice Get all registered passkeys\\n    /// @return Array of Passkey structs\\n    function getPasskeys() internal view returns (Passkey[] memory) {\\n        return authStorage().passkeys;\\n    }\\n\\n    /// @notice Get the number of registered passkeys\\n    /// @return Count of passkeys\\n    function getPasskeyCount() internal view returns (uint256) {\\n        return authStorage().passkeys.length;\\n    }\\n\\n    /// @notice Get passkey coordinates at a specific index\\n    /// @param index Index in the passkeys array\\n    /// @return qx P256 X coordinate\\n    /// @return qy P256 Y coordinate\\n    function getPasskey(uint256 index) internal view returns (bytes32 qx, bytes32 qy) {\\n        AuthStorage storage aus = authStorage();\\n        if (index >= aus.passkeys.length) revert PasskeyIndexOutOfBounds();\\n        Passkey storage pk = aus.passkeys[index];\\n        return (pk.qx, pk.qy);\\n    }\\n\\n    // ============ Signer Key Derivation ============\\n\\n    /// @notice Derive nonce key for an EOA owner\\n    /// @dev Zero-padded address. Cannot collide with keccak256 outputs (12 zero top bytes)\\n    function _ownerKey(address owner) internal pure returns (bytes32) {\\n        return bytes32(uint256(uint160(owner)));\\n    }\\n\\n    /// @notice Derive nonce key for a WebAuthn passkey\\n    /// @dev keccak256 of coordinates. Collision with address keys: 2^-96 probability\\n    function _passkeyKey(bytes32 qx, bytes32 qy) internal pure returns (bytes32) {\\n        return keccak256(abi.encode(qx, qy));\\n    }\\n\\n    // ============ Nonce Management ============\\n\\n    /// @notice Validate and consume a per-signer nonce\\n    /// @param signerKey The signer identifier (from _ownerKey or _passkeyKey)\\n    /// @param nonce The nonce value the caller claims is current\\n    function _useCheckedNonce(bytes32 signerKey, uint256 nonce) internal {\\n        AuthStorage storage aus = authStorage();\\n        uint256 current = aus.signerNonces[signerKey];\\n        if (nonce != current) revert InvalidNonce(signerKey, current);\\n        unchecked {\\n            aus.signerNonces[signerKey] = current + 1;\\n        }\\n    }\\n\\n    /// @notice Get current nonce for a specific signer without incrementing\\n    /// @param signerKey The signer identifier (from _ownerKey or _passkeyKey)\\n    /// @return The current nonce value for this signer\\n    function getNonce(bytes32 signerKey) internal view returns (uint256) {\\n        return authStorage().signerNonces[signerKey];\\n    }\\n\\n    // ============ Last-Signer Protection ============\\n\\n    /// @notice Revert if removing a signer would leave zero signers\\n    /// @dev Called before any signer removal to prevent wallet lockout\\n    function enforceNotLastSigner() internal view {\\n        if (totalSignerCount() <= 1) revert CannotRemoveLastSigner();\\n    }\\n\\n    // ============ Owner Management (Timelocked) ============\\n\\n    /**\\n     * @notice Initiate a timelocked owner addition\\n     * @param _owner Address to add as owner\\n     * @return actionId Unique identifier for this pending action\\n     *\\n     * @custom:reverts InvalidOwnerAddress if address is zero\\n     * @custom:reverts OwnerAlreadyExists if address is already an owner\\n     * @custom:reverts OwnerAlreadyPending if address already has a pending addition\\n     */\\n    function initiateAddOwner(address _owner) internal returns (bytes32 actionId) {\\n        // Prune expired pending actions first to avoid MaxPendingActionsReached false positives\\n        _pruneExpiredOwnerActions();\\n\\n        if (_owner == address(0)) revert InvalidOwnerAddress();\\n        if (_owner == address(this)) revert InvalidOwnerAddress();\\n\\n        AuthStorage storage aus = authStorage();\\n\\n        if (isOwner(_owner)) revert OwnerAlreadyExists();\\n        // Cap check deferred to executeAddOwner() to allow concurrent add+remove at max capacity\\n\\n        actionId = keccak256(abi.encodePacked(\\\"addOwner\\\", _owner, block.timestamp));\\n        if (aus.pendingOwners[actionId].exists) revert OwnerAlreadyPending();\\n\\n        // Check the address isn't already pending with a different action ID\\n        uint256 pendingLen = aus.pendingOwnerIds.length;\\n        for (uint256 i = 0; i < pendingLen;) {\\n            PendingOwner storage pending = aus.pendingOwners[aus.pendingOwnerIds[i]];\\n            if (pending.exists && pending.owner == _owner) {\\n                revert OwnerAlreadyPending();\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n\\n        uint256 cooldown = aus.signerAdditionCooldown; // guaranteed non-zero by _setDefaultCooldowns() during initialization\\n        uint64 activatesAt = uint64(block.timestamp + cooldown);\\n\\n        aus.pendingOwners[actionId] = PendingOwner({\\n            owner: _owner,\\n            activatesAt: activatesAt,\\n            expiresAt: uint64(block.timestamp + PENDING_ACTION_TTL),\\n            exists: true\\n        });\\n        if (aus.pendingOwnerIds.length >= MAX_PENDING_ACTIONS) revert MaxPendingActionsReached();\\n        aus.pendingOwnerIds.push(actionId);\\n\\n        return actionId;\\n    }\\n\\n    /**\\n     * @notice Execute a pending owner addition after cooldown has elapsed\\n     * @param actionId The action ID from initiateAddOwner\\n     *\\n     * @custom:reverts PendingOwnerNotFound if actionId doesn't exist\\n     * @custom:reverts PendingOwnerNotReady if cooldown hasn't elapsed\\n     * @custom:reverts OwnerAlreadyExists if owner was added by other means\\n     * @custom:reverts MaxOwnersReached if at the owner limit\\n     */\\n    function executeAddOwner(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        PendingOwner storage pending = aus.pendingOwners[actionId];\\n\\n        if (!pending.exists) revert PendingOwnerNotFound();\\n        if (block.timestamp > pending.expiresAt) revert PendingActionExpired();\\n        if (block.timestamp < pending.activatesAt) revert PendingOwnerNotReady();\\n\\n        if (isOwner(pending.owner)) revert OwnerAlreadyExists();\\n\\n        // Re-check executor at execution time (executor may have changed during cooldown)\\n        address currentExecutor = IUserProxyFactory(LibFactory.getFactory()).executor();\\n        if (pending.owner == currentExecutor) revert ExecutorCannotBeOwner();\\n\\n        // Check max owners limit (owners may have been added between initiation and execution)\\n        if (aus.owners.length >= MAX_OWNERS) revert MaxOwnersReached();\\n\\n        aus.owners.push(pending.owner);\\n        _removePendingOwner(actionId);\\n    }\\n\\n    /**\\n     * @notice Cancel a pending owner addition\\n     * @param actionId The action ID to cancel\\n     *\\n     * @custom:reverts PendingOwnerNotFound if actionId doesn't exist\\n     */\\n    function cancelAddOwner(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        if (!aus.pendingOwners[actionId].exists) revert PendingOwnerNotFound();\\n\\n        _removePendingOwner(actionId);\\n    }\\n\\n    /**\\n     * @notice Initiate a timelocked owner removal\\n     * @param _owner Address to remove\\n     * @return actionId Unique identifier for this pending action\\n     *\\n     * @custom:reverts NotAuthorizedOwner if address is not an owner\\n     * @custom:reverts CannotRemoveLastSigner if this is the only signer\\n     * @custom:reverts OwnerRemovalAlreadyPending if already pending removal\\n     */\\n    function initiateRemoveOwner(address _owner) internal returns (bytes32 actionId) {\\n        // Prune expired pending actions first to avoid MaxPendingActionsReached false positives\\n        _pruneExpiredOwnerActions();\\n\\n        if (!isOwner(_owner)) revert NotAuthorizedOwner();\\n\\n        // Check this wouldn't remove the last signer\\n        enforceNotLastSigner();\\n\\n        AuthStorage storage aus = authStorage();\\n\\n        // Generate unique action ID\\n        actionId = keccak256(abi.encodePacked(\\\"removeOwner\\\", _owner, block.timestamp));\\n        if (aus.pendingOwnerRemovals[actionId].exists) revert OwnerRemovalAlreadyPending();\\n\\n        // Check if this owner already has a pending removal with a different action ID\\n        uint256 pendingLen = aus.pendingOwnerRemovalIds.length;\\n        for (uint256 i = 0; i < pendingLen;) {\\n            PendingOwnerRemoval storage pending = aus.pendingOwnerRemovals[aus.pendingOwnerRemovalIds[i]];\\n            if (pending.exists && pending.owner == _owner) {\\n                revert OwnerRemovalAlreadyPending();\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n\\n        uint256 cooldown = aus.signerRemovalCooldown; // guaranteed non-zero by _setDefaultCooldowns() during initialization\\n        uint64 executesAt = uint64(block.timestamp + cooldown);\\n\\n        aus.pendingOwnerRemovals[actionId] = PendingOwnerRemoval({\\n            owner: _owner, executesAt: executesAt, expiresAt: uint64(block.timestamp + PENDING_ACTION_TTL), exists: true\\n        });\\n        if (aus.pendingOwnerRemovalIds.length >= MAX_PENDING_ACTIONS) revert MaxPendingActionsReached();\\n        aus.pendingOwnerRemovalIds.push(actionId);\\n\\n        return actionId;\\n    }\\n\\n    /**\\n     * @notice Execute a pending owner removal after cooldown has elapsed\\n     * @param actionId The action ID from initiateRemoveOwner\\n     *\\n     * @custom:reverts PendingOwnerRemovalNotFound if actionId doesn't exist\\n     * @custom:reverts PendingOwnerRemovalNotReady if cooldown hasn't elapsed\\n     * @custom:reverts CannotRemoveLastSigner if this would remove the last signer\\n     */\\n    function executeRemoveOwner(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        PendingOwnerRemoval storage pending = aus.pendingOwnerRemovals[actionId];\\n\\n        if (!pending.exists) revert PendingOwnerRemovalNotFound();\\n        if (block.timestamp > pending.expiresAt) revert PendingActionExpired();\\n        if (block.timestamp < pending.executesAt) revert PendingOwnerRemovalNotReady();\\n\\n        // Re-check last-signer protection (state may have changed since initiation)\\n        enforceNotLastSigner();\\n\\n        // Find the owner by address (index might have shifted)\\n        address ownerToRemove = pending.owner;\\n        uint256 ownerLen = aus.owners.length;\\n        uint256 indexToRemove = type(uint256).max;\\n        for (uint256 i = 0; i < ownerLen;) {\\n            if (aus.owners[i] == ownerToRemove) {\\n                indexToRemove = i;\\n                break;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n\\n        // Owner must still exist (may have been removed by other means)\\n        if (indexToRemove == type(uint256).max) revert OwnerNotFound();\\n\\n        // Swap-and-pop remove\\n        aus.owners[indexToRemove] = aus.owners[ownerLen - 1];\\n        aus.owners.pop();\\n\\n        _removePendingOwnerRemoval(actionId);\\n    }\\n\\n    /**\\n     * @notice Cancel a pending owner removal\\n     * @param actionId The action ID to cancel\\n     *\\n     * @custom:reverts PendingOwnerRemovalNotFound if actionId doesn't exist\\n     */\\n    function cancelRemoveOwner(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        if (!aus.pendingOwnerRemovals[actionId].exists) revert PendingOwnerRemovalNotFound();\\n\\n        _removePendingOwnerRemoval(actionId);\\n    }\\n\\n    // ============ Pending Owner Query Functions ============\\n\\n    /// @notice Get pending owner addition info\\n    /// @param actionId The action ID to query\\n    /// @return owner The pending owner address\\n    /// @return activatesAt Timestamp when the addition can be executed\\n    /// @return exists Whether the pending entry exists\\n    function getPendingOwner(bytes32 actionId) internal view returns (address owner, uint64 activatesAt, bool exists) {\\n        PendingOwner storage pending = authStorage().pendingOwners[actionId];\\n        return (pending.owner, pending.activatesAt, pending.exists);\\n    }\\n\\n    /// @notice Get count of pending owner additions\\n    /// @return Number of pending owner addition actions\\n    function pendingOwnerAdditionCount() internal view returns (uint256) {\\n        return authStorage().pendingOwnerIds.length;\\n    }\\n\\n    /// @notice Get all pending owner addition action IDs\\n    /// @return Array of pending action IDs\\n    function getPendingOwnerIds() internal view returns (bytes32[] memory) {\\n        return authStorage().pendingOwnerIds;\\n    }\\n\\n    /// @notice Check if a pending owner addition is ready to execute\\n    /// @param actionId The action ID to check\\n    /// @return True if the cooldown has elapsed and the entry exists\\n    function isPendingOwnerReady(bytes32 actionId) internal view returns (bool) {\\n        PendingOwner storage pending = authStorage().pendingOwners[actionId];\\n        return pending.exists && block.timestamp >= pending.activatesAt;\\n    }\\n\\n    /// @notice Get pending owner removal info\\n    /// @param actionId The action ID to query\\n    /// @return owner The owner address pending removal\\n    /// @return executesAt Timestamp when the removal can be executed\\n    /// @return exists Whether the pending entry exists\\n    function getPendingOwnerRemoval(bytes32 actionId)\\n        internal\\n        view\\n        returns (address owner, uint64 executesAt, bool exists)\\n    {\\n        PendingOwnerRemoval storage pending = authStorage().pendingOwnerRemovals[actionId];\\n        return (pending.owner, pending.executesAt, pending.exists);\\n    }\\n\\n    /// @notice Get count of pending owner removals\\n    /// @return Number of pending owner removal actions\\n    function pendingOwnerRemovalCount() internal view returns (uint256) {\\n        return authStorage().pendingOwnerRemovalIds.length;\\n    }\\n\\n    /// @notice Get all pending owner removal action IDs\\n    /// @return Array of pending removal action IDs\\n    function getPendingOwnerRemovalIds() internal view returns (bytes32[] memory) {\\n        return authStorage().pendingOwnerRemovalIds;\\n    }\\n\\n    /// @notice Check if a pending owner removal is ready to execute\\n    /// @param actionId The action ID to check\\n    /// @return True if the cooldown has elapsed and the entry exists\\n    function isPendingOwnerRemovalReady(bytes32 actionId) internal view returns (bool) {\\n        PendingOwnerRemoval storage pending = authStorage().pendingOwnerRemovals[actionId];\\n        return pending.exists && block.timestamp >= pending.executesAt;\\n    }\\n\\n    // ============ Pending Owner Internal Helpers ============\\n\\n    /// @dev Remove a pending owner addition from storage (mapping + array)\\n    function _removePendingOwner(bytes32 actionId) private {\\n        AuthStorage storage aus = authStorage();\\n\\n        delete aus.pendingOwners[actionId];\\n\\n        uint256 len = aus.pendingOwnerIds.length;\\n        for (uint256 i = 0; i < len;) {\\n            if (aus.pendingOwnerIds[i] == actionId) {\\n                aus.pendingOwnerIds[i] = aus.pendingOwnerIds[len - 1];\\n                aus.pendingOwnerIds.pop();\\n                break;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n    }\\n\\n    /// @dev Remove a pending owner removal from storage (mapping + array)\\n    function _removePendingOwnerRemoval(bytes32 actionId) private {\\n        AuthStorage storage aus = authStorage();\\n\\n        delete aus.pendingOwnerRemovals[actionId];\\n\\n        uint256 len = aus.pendingOwnerRemovalIds.length;\\n        for (uint256 i = 0; i < len;) {\\n            if (aus.pendingOwnerRemovalIds[i] == actionId) {\\n                aus.pendingOwnerRemovalIds[i] = aus.pendingOwnerRemovalIds[len - 1];\\n                aus.pendingOwnerRemovalIds.pop();\\n                break;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n    }\\n\\n    // ============ Passkey Management (Timelocked) ============\\n\\n    /**\\n     * @notice Initiate a timelocked passkey addition\\n     * @param _qx P256 public key X coordinate\\n     * @param _qy P256 public key Y coordinate\\n     * @return actionId Unique identifier for this pending action\\n     *\\n     * @custom:reverts InvalidPublicKey if coordinates are zero\\n     * @custom:reverts PasskeyAlreadyExists if passkey is already registered\\n     * @custom:reverts PasskeyAlreadyPending if passkey already has a pending addition\\n     */\\n    function initiateAddPasskey(bytes32 _qx, bytes32 _qy) internal returns (bytes32 actionId) {\\n        // Prune expired pending actions first to avoid MaxPendingActionsReached false positives\\n        _pruneExpiredPasskeyActions();\\n\\n        if (_qx == bytes32(0) || _qy == bytes32(0)) revert InvalidPublicKey();\\n        if (!P256.isValidPublicKey(_qx, _qy)) revert PublicKeyNotOnCurve();\\n\\n        AuthStorage storage aus = authStorage();\\n\\n        if (hasPasskey(_qx, _qy)) revert PasskeyAlreadyExists();\\n        // Cap check deferred to executeAddPasskey() to allow concurrent add+remove at max capacity\\n\\n        actionId = keccak256(abi.encodePacked(\\\"addPasskey\\\", _qx, _qy, block.timestamp));\\n        if (aus.pendingPasskeys[actionId].exists) revert PasskeyAlreadyPending();\\n\\n        // Also check if these coordinates are already pending with a different action ID\\n        uint256 pendingLen = aus.pendingPasskeyIds.length;\\n        for (uint256 i = 0; i < pendingLen;) {\\n            PendingPasskey storage pending = aus.pendingPasskeys[aus.pendingPasskeyIds[i]];\\n            if (pending.exists && pending.qx == _qx && pending.qy == _qy) {\\n                revert PasskeyAlreadyPending();\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n\\n        uint256 cooldown = aus.signerAdditionCooldown; // guaranteed non-zero by _setDefaultCooldowns() during initialization\\n        uint64 activatesAt = uint64(block.timestamp + cooldown);\\n\\n        aus.pendingPasskeys[actionId] = PendingPasskey({\\n            qx: _qx,\\n            qy: _qy,\\n            activatesAt: activatesAt,\\n            expiresAt: uint64(block.timestamp + PENDING_ACTION_TTL),\\n            exists: true\\n        });\\n        if (aus.pendingPasskeyIds.length >= MAX_PENDING_ACTIONS) revert MaxPendingActionsReached();\\n        aus.pendingPasskeyIds.push(actionId);\\n\\n        return actionId;\\n    }\\n\\n    /**\\n     * @notice Execute a pending passkey addition after cooldown has elapsed\\n     * @param actionId The action ID from initiateAddPasskey\\n     *\\n     * @custom:reverts PendingPasskeyNotFound if actionId doesn't exist\\n     * @custom:reverts PendingPasskeyNotReady if cooldown hasn't elapsed\\n     * @custom:reverts PasskeyAlreadyExists if passkey was added by other means\\n     * @custom:reverts MaxPasskeysReached if at the passkey limit\\n     */\\n    function executeAddPasskey(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        PendingPasskey storage pending = aus.pendingPasskeys[actionId];\\n\\n        if (!pending.exists) revert PendingPasskeyNotFound();\\n        if (block.timestamp > pending.expiresAt) revert PendingActionExpired();\\n        if (block.timestamp < pending.activatesAt) revert PendingPasskeyNotReady();\\n\\n        if (hasPasskey(pending.qx, pending.qy)) revert PasskeyAlreadyExists();\\n\\n        // Check max passkeys limit (passkeys may have been added between initiation and execution)\\n        if (aus.passkeys.length >= MAX_PASSKEYS) revert MaxPasskeysReached();\\n\\n        aus.passkeys.push(Passkey({qx: pending.qx, qy: pending.qy}));\\n        _removePendingPasskey(actionId);\\n    }\\n\\n    /**\\n     * @notice Cancel a pending passkey addition\\n     * @param actionId The action ID to cancel\\n     *\\n     * @custom:reverts PendingPasskeyNotFound if actionId doesn't exist\\n     */\\n    function cancelAddPasskey(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        if (!aus.pendingPasskeys[actionId].exists) revert PendingPasskeyNotFound();\\n\\n        _removePendingPasskey(actionId);\\n    }\\n\\n    /**\\n     * @notice Initiate a timelocked passkey removal\\n     * @dev Uses totalSignerCount() > 1 for last-signer protection (cross-type)\\n     * @param _qx P256 public key X coordinate of passkey to remove\\n     * @param _qy P256 public key Y coordinate of passkey to remove\\n     * @return actionId Unique identifier for this pending action\\n     *\\n     * @custom:reverts PasskeyNotFound if passkey doesn't exist\\n     * @custom:reverts CannotRemoveLastSigner if this is the only signer\\n     * @custom:reverts PasskeyRemovalAlreadyPending if passkey already has a pending removal\\n     */\\n    function initiateRemovePasskey(bytes32 _qx, bytes32 _qy) internal returns (bytes32 actionId) {\\n        // Prune expired pending actions first to avoid MaxPendingActionsReached false positives\\n        _pruneExpiredPasskeyActions();\\n\\n        AuthStorage storage aus = authStorage();\\n\\n        // Find the passkey by coordinates (stable identity, not index)\\n        uint256 passkeyLen = aus.passkeys.length;\\n        uint256 index = type(uint256).max;\\n        for (uint256 i = 0; i < passkeyLen;) {\\n            if (aus.passkeys[i].qx == _qx && aus.passkeys[i].qy == _qy) {\\n                index = i;\\n                break;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n        if (index == type(uint256).max) revert PasskeyNotFound();\\n\\n        // Cross-type last-signer protection (owners + passkeys)\\n        enforceNotLastSigner();\\n\\n        // Generate unique action ID\\n        actionId = keccak256(abi.encodePacked(\\\"removePasskey\\\", _qx, _qy, block.timestamp));\\n        if (aus.pendingPasskeyRemovals[actionId].exists) revert PasskeyRemovalAlreadyPending();\\n\\n        // Check if this passkey already has a pending removal with a different action ID\\n        uint256 pendingLen = aus.pendingPasskeyRemovalIds.length;\\n        for (uint256 i = 0; i < pendingLen;) {\\n            PendingPasskeyRemoval storage pending = aus.pendingPasskeyRemovals[aus.pendingPasskeyRemovalIds[i]];\\n            if (pending.exists && pending.qx == _qx && pending.qy == _qy) {\\n                revert PasskeyRemovalAlreadyPending();\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n\\n        uint256 cooldown = aus.signerRemovalCooldown; // guaranteed non-zero by _setDefaultCooldowns() during initialization\\n        uint64 executesAt = uint64(block.timestamp + cooldown);\\n\\n        aus.pendingPasskeyRemovals[actionId] = PendingPasskeyRemoval({\\n            passkeyIndex: index,\\n            qx: _qx,\\n            qy: _qy,\\n            executesAt: executesAt,\\n            expiresAt: uint64(block.timestamp + PENDING_ACTION_TTL),\\n            exists: true\\n        });\\n        if (aus.pendingPasskeyRemovalIds.length >= MAX_PENDING_ACTIONS) revert MaxPendingActionsReached();\\n        aus.pendingPasskeyRemovalIds.push(actionId);\\n\\n        return actionId;\\n    }\\n\\n    /**\\n     * @notice Execute a pending passkey removal after cooldown has elapsed\\n     * @param actionId The action ID from initiateRemovePasskey\\n     *\\n     * @custom:reverts PendingPasskeyRemovalNotFound if actionId doesn't exist\\n     * @custom:reverts PendingPasskeyRemovalNotReady if cooldown hasn't elapsed\\n     * @custom:reverts CannotRemoveLastSigner if this would remove the last signer\\n     */\\n    function executeRemovePasskey(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        PendingPasskeyRemoval storage pending = aus.pendingPasskeyRemovals[actionId];\\n\\n        if (!pending.exists) revert PendingPasskeyRemovalNotFound();\\n        if (block.timestamp > pending.expiresAt) revert PendingActionExpired();\\n        if (block.timestamp < pending.executesAt) revert PendingPasskeyRemovalNotReady();\\n\\n        // Re-check last-signer protection (state may have changed since initiation)\\n        enforceNotLastSigner();\\n\\n        // Find the passkey by coordinates (index might have shifted due to other removals)\\n        uint256 passkeyLen = aus.passkeys.length;\\n        uint256 indexToRemove = type(uint256).max;\\n        for (uint256 i = 0; i < passkeyLen;) {\\n            if (aus.passkeys[i].qx == pending.qx && aus.passkeys[i].qy == pending.qy) {\\n                indexToRemove = i;\\n                break;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n\\n        // Passkey must still exist (may have been removed by other means)\\n        if (indexToRemove == type(uint256).max) revert PasskeyNotFound();\\n\\n        // Swap-and-pop remove\\n        aus.passkeys[indexToRemove] = aus.passkeys[passkeyLen - 1];\\n        aus.passkeys.pop();\\n\\n        _removePendingPasskeyRemoval(actionId);\\n    }\\n\\n    /**\\n     * @notice Cancel a pending passkey removal\\n     * @param actionId The action ID to cancel\\n     *\\n     * @custom:reverts PendingPasskeyRemovalNotFound if actionId doesn't exist\\n     */\\n    function cancelRemovePasskey(bytes32 actionId) internal {\\n        AuthStorage storage aus = authStorage();\\n        if (!aus.pendingPasskeyRemovals[actionId].exists) revert PendingPasskeyRemovalNotFound();\\n\\n        _removePendingPasskeyRemoval(actionId);\\n    }\\n\\n    // ============ Pending Passkey Query Functions ============\\n\\n    /// @notice Get pending passkey addition info\\n    /// @param actionId The action ID to query\\n    /// @return qx P256 X coordinate\\n    /// @return qy P256 Y coordinate\\n    /// @return activatesAt Timestamp when the passkey can be activated\\n    /// @return exists Whether the pending entry exists\\n    function getPendingPasskey(bytes32 actionId)\\n        internal\\n        view\\n        returns (bytes32 qx, bytes32 qy, uint64 activatesAt, bool exists)\\n    {\\n        PendingPasskey storage pending = authStorage().pendingPasskeys[actionId];\\n        return (pending.qx, pending.qy, pending.activatesAt, pending.exists);\\n    }\\n\\n    /// @notice Get count of pending passkey additions\\n    /// @return Number of pending passkey addition actions\\n    function pendingPasskeyAdditionCount() internal view returns (uint256) {\\n        return authStorage().pendingPasskeyIds.length;\\n    }\\n\\n    /// @notice Get all pending passkey addition action IDs\\n    /// @return Array of pending action IDs\\n    function getPendingPasskeyIds() internal view returns (bytes32[] memory) {\\n        return authStorage().pendingPasskeyIds;\\n    }\\n\\n    /// @notice Check if a pending passkey addition is ready to execute\\n    /// @param actionId The action ID to check\\n    /// @return True if the cooldown has elapsed and the entry exists\\n    function isPendingPasskeyReady(bytes32 actionId) internal view returns (bool) {\\n        PendingPasskey storage pending = authStorage().pendingPasskeys[actionId];\\n        return pending.exists && block.timestamp >= pending.activatesAt;\\n    }\\n\\n    /// @notice Get pending passkey removal info\\n    /// @param actionId The action ID to query\\n    /// @return passkeyIndex Original index of the passkey\\n    /// @return qx P256 X coordinate\\n    /// @return qy P256 Y coordinate\\n    /// @return executesAt Timestamp when the removal can be executed\\n    /// @return exists Whether the pending entry exists\\n    function getPendingPasskeyRemoval(bytes32 actionId)\\n        internal\\n        view\\n        returns (uint256 passkeyIndex, bytes32 qx, bytes32 qy, uint64 executesAt, bool exists)\\n    {\\n        PendingPasskeyRemoval storage pending = authStorage().pendingPasskeyRemovals[actionId];\\n        return (pending.passkeyIndex, pending.qx, pending.qy, pending.executesAt, pending.exists);\\n    }\\n\\n    /// @notice Get count of pending passkey removals\\n    /// @return Number of pending passkey removal actions\\n    function pendingPasskeyRemovalCount() internal view returns (uint256) {\\n        return authStorage().pendingPasskeyRemovalIds.length;\\n    }\\n\\n    /// @notice Get all pending passkey removal action IDs\\n    /// @return Array of pending removal action IDs\\n    function getPendingPasskeyRemovalIds() internal view returns (bytes32[] memory) {\\n        return authStorage().pendingPasskeyRemovalIds;\\n    }\\n\\n    /// @notice Check if a pending passkey removal is ready to execute\\n    /// @param actionId The action ID to check\\n    /// @return True if the cooldown has elapsed and the entry exists\\n    function isPendingPasskeyRemovalReady(bytes32 actionId) internal view returns (bool) {\\n        PendingPasskeyRemoval storage pending = authStorage().pendingPasskeyRemovals[actionId];\\n        return pending.exists && block.timestamp >= pending.executesAt;\\n    }\\n\\n    // ============ Pending Passkey Internal Helpers ============\\n\\n    /// @dev Remove a pending passkey addition from storage (mapping + array)\\n    function _removePendingPasskey(bytes32 actionId) private {\\n        AuthStorage storage aus = authStorage();\\n\\n        delete aus.pendingPasskeys[actionId];\\n\\n        uint256 len = aus.pendingPasskeyIds.length;\\n        for (uint256 i = 0; i < len;) {\\n            if (aus.pendingPasskeyIds[i] == actionId) {\\n                aus.pendingPasskeyIds[i] = aus.pendingPasskeyIds[len - 1];\\n                aus.pendingPasskeyIds.pop();\\n                break;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n    }\\n\\n    /// @dev Remove a pending passkey removal from storage (mapping + array)\\n    function _removePendingPasskeyRemoval(bytes32 actionId) private {\\n        AuthStorage storage aus = authStorage();\\n\\n        delete aus.pendingPasskeyRemovals[actionId];\\n\\n        uint256 len = aus.pendingPasskeyRemovalIds.length;\\n        for (uint256 i = 0; i < len;) {\\n            if (aus.pendingPasskeyRemovalIds[i] == actionId) {\\n                aus.pendingPasskeyRemovalIds[i] = aus.pendingPasskeyRemovalIds[len - 1];\\n                aus.pendingPasskeyRemovalIds.pop();\\n                break;\\n            }\\n            unchecked {\\n                ++i;\\n            }\\n        }\\n    }\\n\\n    // ============ Expired Action Pruning (Lazy Cleanup) ============\\n\\n    /**\\n     * @dev Prune expired pending owner actions (both additions and removals)\\n     *      This prevents unbounded array growth when users abandon pending actions.\\n     *      Called at the start of owner-modifying functions before MAX_PENDING_ACTIONS checks.\\n     */\\n    /// @notice Prune expired pending owner-management actions (both add and remove arrays).\\n    /// @dev Called opportunistically at the start of each initiate function that\\n    ///      operates on the owner pending arrays. Does NOT prune passkey pending\\n    ///      arrays — those are handled by `_pruneExpiredPasskeyActions`. This\\n    ///      path-local scoping keeps gas costs bounded to the storage the calling\\n    ///      function will touch anyway.\\n    function _pruneExpiredOwnerActions() private {\\n        AuthStorage storage aus = authStorage();\\n\\n        // Prune expired owner additions\\n        bytes32[] storage ownerIds = aus.pendingOwnerIds;\\n        uint256 i = 0;\\n        while (i < ownerIds.length) {\\n            PendingOwner storage pending = aus.pendingOwners[ownerIds[i]];\\n            if (pending.exists && block.timestamp > pending.expiresAt) {\\n                // Expired — remove from index array and delete the entry\\n                bytes32 expiredId = ownerIds[i];\\n                ownerIds[i] = ownerIds[ownerIds.length - 1];\\n                ownerIds.pop();\\n                delete aus.pendingOwners[expiredId];\\n                // Don't increment i — the swapped-in element still needs checking\\n            } else {\\n                unchecked {\\n                    ++i;\\n                }\\n            }\\n        }\\n\\n        // Prune expired owner removals\\n        bytes32[] storage removalIds = aus.pendingOwnerRemovalIds;\\n        i = 0;\\n        while (i < removalIds.length) {\\n            PendingOwnerRemoval storage pending = aus.pendingOwnerRemovals[removalIds[i]];\\n            if (pending.exists && block.timestamp > pending.expiresAt) {\\n                // Expired — remove from index array and delete the entry\\n                bytes32 expiredId = removalIds[i];\\n                removalIds[i] = removalIds[removalIds.length - 1];\\n                removalIds.pop();\\n                delete aus.pendingOwnerRemovals[expiredId];\\n                // Don't increment i — the swapped-in element still needs checking\\n            } else {\\n                unchecked {\\n                    ++i;\\n                }\\n            }\\n        }\\n    }\\n\\n    /// @notice Prune expired pending passkey-management actions (both add and remove arrays).\\n    /// @dev Path-local scoping — called opportunistically at the start of each initiate\\n    ///      function that operates on the passkey pending arrays. Does NOT prune owner\\n    ///      pending arrays — those are handled by `_pruneExpiredOwnerActions`. This\\n    ///      path-local scoping keeps gas costs bounded to the storage the calling\\n    ///      function will touch anyway. Prevents unbounded array growth when users\\n    ///      abandon pending actions.\\n    function _pruneExpiredPasskeyActions() private {\\n        AuthStorage storage aus = authStorage();\\n\\n        // Prune expired passkey additions\\n        bytes32[] storage passkeyIds = aus.pendingPasskeyIds;\\n        uint256 i = 0;\\n        while (i < passkeyIds.length) {\\n            PendingPasskey storage pending = aus.pendingPasskeys[passkeyIds[i]];\\n            if (pending.exists && block.timestamp > pending.expiresAt) {\\n                // Expired — remove from index array and delete the entry\\n                bytes32 expiredId = passkeyIds[i];\\n                passkeyIds[i] = passkeyIds[passkeyIds.length - 1];\\n                passkeyIds.pop();\\n                delete aus.pendingPasskeys[expiredId];\\n                // Don't increment i — the swapped-in element still needs checking\\n            } else {\\n                unchecked {\\n                    ++i;\\n                }\\n            }\\n        }\\n\\n        // Prune expired passkey removals\\n        bytes32[] storage removalIds = aus.pendingPasskeyRemovalIds;\\n        i = 0;\\n        while (i < removalIds.length) {\\n            PendingPasskeyRemoval storage pending = aus.pendingPasskeyRemovals[removalIds[i]];\\n            if (pending.exists && block.timestamp > pending.expiresAt) {\\n                // Expired — remove from index array and delete the entry\\n                bytes32 expiredId = removalIds[i];\\n                removalIds[i] = removalIds[removalIds.length - 1];\\n                removalIds.pop();\\n                delete aus.pendingPasskeyRemovals[expiredId];\\n                // Don't increment i — the swapped-in element still needs checking\\n            } else {\\n                unchecked {\\n                    ++i;\\n                }\\n            }\\n        }\\n    }\\n\\n    // ============ Recovery Direct Add (Bypass Timelocks) ============\\n\\n    /**\\n     * @notice Add a passkey directly, bypassing the timelock\\n     * @dev ONLY to be called by the RecoveryFacet during executeRecovery().\\n     *      This is an emergency mechanism — use with extreme caution.\\n     *      No MAX_PASSKEYS check — recovery is an emergency mechanism that must always\\n     *      succeed regardless of current passkey count. The passkey array is unbounded\\n     *      via this path, but practical growth is limited by the recovery delay (minimum 1 day).\\n     *      Normal passkey addition (initiateAddPasskey) still enforces the limit.\\n     *\\n     * @param _qx P256 public key X coordinate\\n     * @param _qy P256 public key Y coordinate\\n     *\\n     * @custom:reverts InvalidPublicKey if coordinates are zero\\n     * @custom:reverts PublicKeyNotOnCurve if point is not on the P256 curve\\n     * @custom:reverts PasskeyAlreadyExists if passkey is already registered\\n     */\\n    function addPasskeyDirect(bytes32 _qx, bytes32 _qy) internal {\\n        if (_qx == bytes32(0) || _qy == bytes32(0)) revert InvalidPublicKey();\\n        if (!P256.isValidPublicKey(_qx, _qy)) revert PublicKeyNotOnCurve();\\n\\n        if (hasPasskey(_qx, _qy)) revert PasskeyAlreadyExists();\\n\\n        AuthStorage storage aus = authStorage();\\n        aus.passkeys.push(Passkey({qx: _qx, qy: _qy}));\\n    }\\n\\n    /**\\n     * @notice Add an address owner directly, bypassing the timelock\\n     * @dev ONLY to be called by the RecoveryFacet during executeRecovery().\\n     *      This is an emergency mechanism — use with extreme caution.\\n     *      No MAX_OWNERS check — recovery must always succeed.\\n     *\\n     * @param _owner EOA or smart contract address to add\\n     *\\n     * @custom:reverts InvalidOwnerAddress if address is zero\\n     * @custom:reverts InvalidOwnerAddress if address is address(this)\\n     * @custom:reverts OwnerAlreadyExists if address is already an owner\\n     * @custom:reverts ExecutorCannotBeOwner if address is the factory executor\\n     */\\n    function addOwnerDirect(address _owner) internal {\\n        if (_owner == address(0)) revert InvalidOwnerAddress();\\n        if (_owner == address(this)) revert InvalidOwnerAddress();\\n        if (isOwner(_owner)) revert OwnerAlreadyExists();\\n\\n        // Re-check executor at execution time (executor may have changed since recovery initiation)\\n        address currentExecutor = IUserProxyFactory(LibFactory.getFactory()).executor();\\n        if (_owner == currentExecutor) revert ExecutorCannotBeOwner();\\n\\n        AuthStorage storage aus = authStorage();\\n        aus.owners.push(_owner);\\n    }\\n\\n    // ============ EIP-712 Type Hashes (Passkey Management) ============\\n\\n    bytes32 constant INITIATE_ADD_PASSKEY_TYPEHASH =\\n        keccak256(\\\"InitiateAddPasskey(bytes32 signer,bytes32 newQx,bytes32 newQy,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant CANCEL_ADD_PASSKEY_TYPEHASH =\\n        keccak256(\\\"CancelAddPasskey(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant INITIATE_REMOVE_PASSKEY_TYPEHASH =\\n        keccak256(\\\"InitiateRemovePasskey(bytes32 signer,bytes32 qx,bytes32 qy,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant CANCEL_REMOVE_PASSKEY_TYPEHASH =\\n        keccak256(\\\"CancelRemovePasskey(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant APPROVE_ADD_PASSKEY_TYPEHASH =\\n        keccak256(\\\"ApproveAddPasskey(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant APPROVE_REMOVE_PASSKEY_TYPEHASH =\\n        keccak256(\\\"ApproveRemovePasskey(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    // ============ EIP-712 Type Hashes (Owner Management) ============\\n\\n    bytes32 constant INITIATE_ADD_OWNER_TYPEHASH =\\n        keccak256(\\\"InitiateAddOwner(bytes32 signer,address newOwner,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant APPROVE_ADD_OWNER_TYPEHASH =\\n        keccak256(\\\"ApproveAddOwner(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant CANCEL_ADD_OWNER_TYPEHASH =\\n        keccak256(\\\"CancelAddOwner(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant INITIATE_REMOVE_OWNER_TYPEHASH =\\n        keccak256(\\\"InitiateRemoveOwner(bytes32 signer,address owner,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant APPROVE_REMOVE_OWNER_TYPEHASH =\\n        keccak256(\\\"ApproveRemoveOwner(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant CANCEL_REMOVE_OWNER_TYPEHASH =\\n        keccak256(\\\"CancelRemoveOwner(bytes32 signer,bytes32 actionId,uint256 nonce,uint256 deadline)\\\");\\n\\n    // ============ EIP-712 Hash Functions (Passkey Management) ============\\n\\n    function hashInitiateAddPasskey(bytes32 signer, bytes32 newQx, bytes32 newQy, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(INITIATE_ADD_PASSKEY_TYPEHASH, signer, newQx, newQy, nonce, deadline));\\n    }\\n\\n    function hashCancelAddPasskey(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(CANCEL_ADD_PASSKEY_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n\\n    function hashInitiateRemovePasskey(bytes32 signer, bytes32 qx, bytes32 qy, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(INITIATE_REMOVE_PASSKEY_TYPEHASH, signer, qx, qy, nonce, deadline));\\n    }\\n\\n    function hashCancelRemovePasskey(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(CANCEL_REMOVE_PASSKEY_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n\\n    function hashApproveAddPasskey(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(APPROVE_ADD_PASSKEY_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n\\n    function hashApproveRemovePasskey(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(APPROVE_REMOVE_PASSKEY_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n\\n    // ============ EIP-712 Hash Functions (Owner Management) ============\\n\\n    function hashInitiateAddOwner(bytes32 signer, address newOwner, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(INITIATE_ADD_OWNER_TYPEHASH, signer, newOwner, nonce, deadline));\\n    }\\n\\n    function hashApproveAddOwner(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(APPROVE_ADD_OWNER_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n\\n    function hashCancelAddOwner(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(CANCEL_ADD_OWNER_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n\\n    function hashInitiateRemoveOwner(bytes32 signer, address owner, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(INITIATE_REMOVE_OWNER_TYPEHASH, signer, owner, nonce, deadline));\\n    }\\n\\n    function hashApproveRemoveOwner(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(APPROVE_REMOVE_OWNER_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n\\n    function hashCancelRemoveOwner(bytes32 signer, bytes32 actionId, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(CANCEL_REMOVE_OWNER_TYPEHASH, signer, actionId, nonce, deadline));\\n    }\\n}\\n\"},\"src/libraries/LibEIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.24;\\n\\n/**\\n * @title LibEIP712\\n * @notice EIP-712 domain separator and typed data digest for EthenaPay wallet operations\\n * @dev Provides the domain separator and final digest computation.\\n *      Individual type hashes and struct hashing are defined in their respective\\n *      companion libraries (LibAuth, LibAllowance, LibDirectMode, LibRecovery)\\n *      or inline in facets (WithdrawalFacet), so new facets can introduce new\\n *      EIP-712 message types without modifying this library.\\n */\\nlibrary LibEIP712 {\\n    // EIP-712 domain type hash\\n    bytes32 constant DOMAIN_TYPEHASH =\\n        keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n    // Cached domain separator components\\n    bytes32 constant NAME_HASH = keccak256(\\\"EthenaPay Wallet\\\");\\n    bytes32 constant VERSION_HASH = keccak256(\\\"2\\\");\\n\\n    /// @notice Compute the EIP-712 domain separator for this contract\\n    /// @return The domain separator hash\\n    function domainSeparator() internal view returns (bytes32) {\\n        return keccak256(abi.encode(DOMAIN_TYPEHASH, NAME_HASH, VERSION_HASH, block.chainid, address(this)));\\n    }\\n\\n    /// @notice Compute the EIP-712 digest for signing\\n    /// @param structHash The EIP-712 struct hash\\n    /// @return The fully encoded EIP-712 hash for signing\\n    function toTypedDataHash(bytes32 structHash) internal view returns (bytes32) {\\n        return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator(), structHash));\\n    }\\n}\\n\"},\"src/libraries/LibDirectMode.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.24;\\n\\nimport {LibFactory} from \\\"./LibFactory.sol\\\";\\n\\n/**\\n * @title LibDirectMode\\n * @notice Direct mode and global pause checking logic for wallet operations\\n * @dev Implements two-level control mechanism:\\n *      1. Global Pause  - Centralized emergency freeze across all wallets\\n *      2. Direct Mode   - User takes direct control of their wallet\\n *\\n * Global Pause Architecture:\\n * - Each wallet stores a reference to its factory (via LibFactory)\\n * - Factory has a global `globalPaused` flag\\n * - Wallets check factory's global pause state before sensitive operations\\n * - This enables emergency freeze across ALL wallets with a single tx\\n *\\n * Direct Mode Architecture:\\n * - Each wallet stores direct-mode enter/exit timestamps\\n * - Enter/exit have 1h cooldown to prevent griefing attacks\\n * - After 1h, isDirectMode() automatically checks timestamps (no execute needed)\\n * - User can cancel pending enter/exit within the 1h window\\n * - When in direct mode, the user has full sovereignty over their wallet\\n *\\n * Blocked by global pause OR direct mode (enforceExecutorNotBlocked):\\n * - Executor withdrawals (ETH and token)\\n * - Allowance spending (spendDailyAllowance)\\n *\\n * Blocked by global pause, direct mode overrides (enforceUserNotBlocked):\\n * - Signer management (initiate, approve, cancel add/remove owner/passkey)\\n * - Set allowance (instantSetAllowance, dual-sign)\\n * When user is in direct mode, these operations remain available even during\\n * a global emergency — the user has taken control of their wallet.\\n *\\n * NOT blocked (always available):\\n * - Direct withdrawals (requires direct mode active)\\n * - Direct mode management (enter, exit, cancel)\\n * - Recovery (initiate, execute, cancel, config, opt-out)\\n * - View functions\\n */\\nlibrary LibDirectMode {\\n    // ============ Storage ============\\n\\n    bytes32 constant DIRECT_MODE_STORAGE_POSITION = keccak256(\\\"wallet.directmode.storage.v1\\\");\\n\\n    struct DirectModeStorage {\\n        uint64 directModeAt; // When direct mode activates (0 = not active/pending)\\n        uint64 exitDirectModeAt; // When exit activates (0 = ignore)\\n    }\\n\\n    function directModeStorage() internal pure returns (DirectModeStorage storage ds) {\\n        bytes32 position = DIRECT_MODE_STORAGE_POSITION;\\n        assembly {\\n            ds.slot := position\\n        }\\n    }\\n\\n    // ============ Errors ============\\n\\n    /// @dev Thrown when operations are blocked because the factory has globally paused all wallets.\\n    ///      Applies to both enforcement paths: user operations (when not in direct mode)\\n    ///      and executor operations (always).\\n    error GlobalPauseActive();\\n\\n    /// @dev Thrown when executor operations are blocked because the user has entered direct mode.\\n    ///      Only applies to the executor enforcement path (enforceExecutorNotBlocked).\\n    error DirectModeActive();\\n\\n    /// @dev Thrown when trying to enter direct mode while already active\\n    error DirectModeAlreadyActive();\\n\\n    /// @dev Thrown when trying to initiate direct mode while one is pending\\n    error DirectModeAlreadyPending();\\n\\n    /// @dev Thrown when trying to initiate exit while one is pending\\n    error ExitDirectModeAlreadyPending();\\n\\n    /// @dev Thrown when trying to cancel non-existent pending direct mode\\n    error NoPendingDirectMode();\\n\\n    /// @dev Thrown when trying to cancel non-existent pending exit\\n    error NoPendingExitDirectMode();\\n\\n    /// @dev Thrown when trying to exit direct mode while not in it\\n    error NotInDirectMode();\\n\\n    /// @dev Thrown when trying to use direct withdrawal without direct mode\\n    error DirectAccessNotAvailable();\\n\\n    // ============ Constants ============\\n\\n    uint256 constant DEFAULT_DIRECT_MODE_COOLDOWN = 1 hours;\\n\\n    // ============ State Checks ============\\n\\n    /// @notice Check if the factory has globally paused all wallets\\n    /// @dev Fail-closed: reverts with GlobalPauseActive() if the factory reference is\\n    ///      unset OR the staticcall fails. This ensures the emergency brake cannot\\n    ///      be silently disabled by a misconfigured factory upgrade.\\n    /// @return True if the factory reports a global pause; reverts on failure (treated as paused)\\n    function isGlobalPaused() internal view returns (bool) {\\n        address factory = LibFactory.getFactory();\\n        // Fail-closed: if factory reference is unset, treat as paused (defense against\\n        // misconfigured initialization)\\n        if (factory == address(0)) revert GlobalPauseActive();\\n\\n        (bool success, bytes memory data) = factory.staticcall(abi.encodeWithSignature(\\\"globalPaused()\\\"));\\n\\n        // Fail-closed: if factory call fails (e.g., during a misconfigured proxy\\n        // upgrade rendering the factory transiently unreachable), treat as paused.\\n        // This closes the emergency-stop bypass identified in audit v3 H-01.\\n        if (!success || data.length < 32) revert GlobalPauseActive();\\n\\n        return abi.decode(data, (bool));\\n    }\\n\\n    /// @notice Check if user has entered direct mode\\n    /// @dev Automatically checks timestamps - no execute needed!\\n    ///      Returns true if direct mode timestamp has passed and exit hasn't\\n    function isDirectMode() internal view returns (bool) {\\n        DirectModeStorage storage ds = directModeStorage();\\n\\n        // If exit activated, we're not in direct mode\\n        if (ds.exitDirectModeAt > 0 && block.timestamp >= ds.exitDirectModeAt) {\\n            return false;\\n        }\\n\\n        // If direct mode activated, we're in direct mode\\n        if (ds.directModeAt > 0 && block.timestamp >= ds.directModeAt) {\\n            return true;\\n        }\\n\\n        return false;\\n    }\\n\\n    /// @notice Revert if executor should be blocked\\n    /// @dev Blocks executor operations when: global pause OR direct mode active.\\n    ///      Two distinct blocking reasons are signalled via separate errors so\\n    ///      integrators can distinguish the cause.\\n    function enforceExecutorNotBlocked() internal view {\\n        if (isGlobalPaused()) revert GlobalPauseActive();\\n        if (isDirectMode()) revert DirectModeActive();\\n    }\\n\\n    /// @notice Revert if user operations should be blocked\\n    /// @dev Blocks when global pause is active AND user is NOT in direct mode.\\n    ///      If the user has taken control by entering direct mode, they retain\\n    ///      sovereignty over signer management even during global emergencies.\\n    function enforceUserNotBlocked() internal view {\\n        if (isGlobalPaused() && !isDirectMode()) {\\n            revert GlobalPauseActive();\\n        }\\n    }\\n\\n    // ============ Direct Mode Management ============\\n\\n    /// @notice Initiate direct mode (activates after 1h automatically)\\n    /// @dev Prevents griefing: attacker with stolen device has 1h window where\\n    ///      legitimate user can cancel from another signer\\n    /// @return activatesAt Timestamp when direct mode will activate\\n    function initiateDirectMode() internal returns (uint64 activatesAt) {\\n        DirectModeStorage storage ds = directModeStorage();\\n\\n        // Check if already in direct mode\\n        if (ds.directModeAt > 0 && block.timestamp >= ds.directModeAt) {\\n            // Check if there's a pending exit that would override\\n            if (ds.exitDirectModeAt == 0 || block.timestamp < ds.exitDirectModeAt) {\\n                revert DirectModeAlreadyActive();\\n            }\\n        }\\n\\n        // Check if direct mode already pending\\n        if (ds.directModeAt > 0 && block.timestamp < ds.directModeAt) {\\n            revert DirectModeAlreadyPending();\\n        }\\n\\n        uint256 cooldown = DEFAULT_DIRECT_MODE_COOLDOWN;\\n\\n        activatesAt = uint64(block.timestamp + cooldown);\\n        ds.directModeAt = activatesAt;\\n        ds.exitDirectModeAt = 0; // Clear any pending exit\\n\\n        return activatesAt;\\n    }\\n\\n    /// @notice Cancel pending direct mode (before it activates)\\n    /// @dev Allows legitimate user to cancel attacker's direct mode attempt\\n    function cancelDirectMode() internal {\\n        DirectModeStorage storage ds = directModeStorage();\\n\\n        // Must have pending direct mode (not yet activated)\\n        if (ds.directModeAt == 0 || block.timestamp >= ds.directModeAt) {\\n            revert NoPendingDirectMode();\\n        }\\n\\n        ds.directModeAt = 0;\\n    }\\n\\n    /// @notice Initiate exit from direct mode (activates after 1h automatically)\\n    /// @dev Same cooldown as entering for consistency\\n    /// @return activatesAt Timestamp when exit will activate\\n    function initiateExitDirectMode() internal returns (uint64 activatesAt) {\\n        DirectModeStorage storage ds = directModeStorage();\\n\\n        // Must be in direct mode\\n        bool isCurrentlyDirect = ds.directModeAt > 0 && block.timestamp >= ds.directModeAt;\\n        bool hasActiveExit = ds.exitDirectModeAt > 0 && block.timestamp >= ds.exitDirectModeAt;\\n\\n        if (!isCurrentlyDirect || hasActiveExit) {\\n            revert NotInDirectMode();\\n        }\\n\\n        // Check if exit already pending\\n        if (ds.exitDirectModeAt > 0 && block.timestamp < ds.exitDirectModeAt) {\\n            revert ExitDirectModeAlreadyPending();\\n        }\\n\\n        uint256 cooldown = DEFAULT_DIRECT_MODE_COOLDOWN;\\n\\n        activatesAt = uint64(block.timestamp + cooldown);\\n        ds.exitDirectModeAt = activatesAt;\\n\\n        return activatesAt;\\n    }\\n\\n    /// @notice Cancel pending exit from direct mode (before it activates)\\n    function cancelExitDirectMode() internal {\\n        DirectModeStorage storage ds = directModeStorage();\\n\\n        // Must have pending exit (not yet activated)\\n        if (ds.exitDirectModeAt == 0 || block.timestamp >= ds.exitDirectModeAt) {\\n            revert NoPendingExitDirectMode();\\n        }\\n\\n        ds.exitDirectModeAt = 0;\\n    }\\n\\n    // ============ View Functions ============\\n\\n    /// @notice Get pending direct mode timestamp\\n    /// @return activatesAt When direct mode will activate (0 if none pending)\\n    /// @return isPending True if direct mode is pending (not yet activated)\\n    function getPendingDirectMode() internal view returns (uint64 activatesAt, bool isPending) {\\n        uint64 timestamp = directModeStorage().directModeAt;\\n        isPending = timestamp > 0 && block.timestamp < timestamp;\\n        return (isPending ? timestamp : 0, isPending);\\n    }\\n\\n    /// @notice Get pending exit timestamp\\n    /// @return activatesAt When exit will activate (0 if none pending)\\n    /// @return isPending True if exit is pending (not yet activated)\\n    function getPendingExitDirectMode() internal view returns (uint64 activatesAt, bool isPending) {\\n        uint64 timestamp = directModeStorage().exitDirectModeAt;\\n        isPending = timestamp > 0 && block.timestamp < timestamp;\\n        return (isPending ? timestamp : 0, isPending);\\n    }\\n\\n    /// @notice Get direct mode cooldown duration\\n    function getDirectModeCooldown() internal pure returns (uint256) {\\n        return DEFAULT_DIRECT_MODE_COOLDOWN;\\n    }\\n\\n    // ============ EIP-712 Type Hashes ============\\n\\n    bytes32 constant INITIATE_DIRECT_MODE_TYPEHASH =\\n        keccak256(\\\"InitiateDirectMode(bytes32 signer,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant CANCEL_DIRECT_MODE_TYPEHASH =\\n        keccak256(\\\"CancelDirectMode(bytes32 signer,uint64 directModeAt,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant INITIATE_EXIT_DIRECT_MODE_TYPEHASH =\\n        keccak256(\\\"InitiateExitDirectMode(bytes32 signer,uint256 nonce,uint256 deadline)\\\");\\n\\n    bytes32 constant CANCEL_EXIT_DIRECT_MODE_TYPEHASH =\\n        keccak256(\\\"CancelExitDirectMode(bytes32 signer,uint64 exitDirectModeAt,uint256 nonce,uint256 deadline)\\\");\\n\\n    // ============ EIP-712 Hash Functions ============\\n\\n    /// @notice Hash an InitiateDirectMode struct\\n    function hashInitiateDirectMode(bytes32 signer, uint256 nonce, uint256 deadline) internal pure returns (bytes32) {\\n        return keccak256(abi.encode(INITIATE_DIRECT_MODE_TYPEHASH, signer, nonce, deadline));\\n    }\\n\\n    /// @notice Hash a CancelDirectMode struct\\n    function hashCancelDirectMode(bytes32 signer, uint256 nonce, uint256 deadline) internal view returns (bytes32) {\\n        uint64 pendingAt = directModeStorage().directModeAt;\\n        return keccak256(abi.encode(CANCEL_DIRECT_MODE_TYPEHASH, signer, pendingAt, nonce, deadline));\\n    }\\n\\n    /// @notice Hash an InitiateExitDirectMode struct\\n    function hashInitiateExitDirectMode(bytes32 signer, uint256 nonce, uint256 deadline)\\n        internal\\n        pure\\n        returns (bytes32)\\n    {\\n        return keccak256(abi.encode(INITIATE_EXIT_DIRECT_MODE_TYPEHASH, signer, nonce, deadline));\\n    }\\n\\n    /// @notice Hash a CancelExitDirectMode struct\\n    function hashCancelExitDirectMode(bytes32 signer, uint256 nonce, uint256 deadline) internal view returns (bytes32) {\\n        uint64 pendingAt = directModeStorage().exitDirectModeAt;\\n        return keccak256(abi.encode(CANCEL_EXIT_DIRECT_MODE_TYPEHASH, signer, pendingAt, nonce, deadline));\\n    }\\n}\\n\"},\"src/libraries/LibReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.24;\\n\\n/**\\n * @title LibReentrancyGuard\\n * @notice Transient-storage reentrancy guard for wallet facets (EIP-1153)\\n * @dev Protects functions that perform external calls (ETH transfers via\\n *      low-level call{value} and ERC20 token transfers via safeTransfer),\\n *      preventing reentrant calls through malicious recipients or hook-enabled\\n *      tokens (e.g., ERC-777). Guards against both same-function and\\n *      cross-function reentrancy across diamond facets.\\n *\\n *      Uses TSTORE/TLOAD (EIP-1153, Cancun) instead of SSTORE/SLOAD,\\n *      saving ~2,900 gas per guarded call. Transient storage is automatically\\n *      cleared at the end of each transaction — ideal for reentrancy flags.\\n *\\n *      The slot is derived using the ERC-7201 namespaced pattern:\\n *      keccak256(abi.encode(uint256(keccak256(\\\"ethenapay.storage.ReentrancyGuard\\\")) - 1)) & ~bytes32(uint256(0xff))\\n */\\nlibrary LibReentrancyGuard {\\n    /// @dev Transient storage slot (EIP-1153) — namespaced to avoid collisions\\n    bytes32 private constant REENTRANCY_SLOT =\\n        keccak256(abi.encode(uint256(keccak256(\\\"ethenapay.storage.ReentrancyGuard\\\")) - 1)) & ~bytes32(uint256(0xff));\\n\\n    uint256 private constant ENTERED = 1;\\n    uint256 private constant NOT_ENTERED = 0;\\n\\n    error ReentrantCall();\\n\\n    /// @notice Revert if already inside a guarded function\\n    function enforceNonReentrant() internal {\\n        uint256 status;\\n        bytes32 slot = REENTRANCY_SLOT;\\n        assembly {\\n            status := tload(slot)\\n        }\\n        if (status == ENTERED) revert ReentrantCall();\\n        assembly {\\n            tstore(slot, 1)\\n        }\\n    }\\n\\n    /// @notice Release the reentrancy lock\\n    function clearReentrantFlag() internal {\\n        bytes32 slot = REENTRANCY_SLOT;\\n        assembly {\\n            tstore(slot, 0)\\n        }\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)\\n\\npragma solidity >=0.6.2;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @title IERC1363\\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\\n *\\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\\n */\\ninterface IERC1363 is IERC20, IERC165 {\\n    /*\\n     * Note: the ERC-165 identifier for this interface is 0xb0202a11.\\n     * 0xb0202a11 ===\\n     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^\\n     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\\n     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^\\n     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\\n     */\\n\\n    /**\\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n     * @param to The address which you want to transfer to.\\n     * @param value The amount of tokens to be transferred.\\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\\n     */\\n    function transferAndCall(address to, uint256 value) external returns (bool);\\n\\n    /**\\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n     * @param to The address which you want to transfer to.\\n     * @param value The amount of tokens to be transferred.\\n     * @param data Additional data with no specified format, sent in call to `to`.\\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\\n     */\\n    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n    /**\\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n     * @param from The address which you want to send tokens from.\\n     * @param to The address which you want to transfer to.\\n     * @param value The amount of tokens to be transferred.\\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\\n     */\\n    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\\n\\n    /**\\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n     * @param from The address which you want to send tokens from.\\n     * @param to The address which you want to transfer to.\\n     * @param value The amount of tokens to be transferred.\\n     * @param data Additional data with no specified format, sent in call to `to`.\\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\\n     */\\n    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n    /**\\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n     * @param spender The address which will spend the funds.\\n     * @param value The amount of tokens to be spent.\\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\\n     */\\n    function approveAndCall(address spender, uint256 value) external returns (bool);\\n\\n    /**\\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n     * @param spender The address which will spend the funds.\\n     * @param value The amount of tokens to be spent.\\n     * @param data Additional data with no specified format, sent in call to `spender`.\\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\\n     */\\n    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n    enum RecoverError {\\n        NoError,\\n        InvalidSignature,\\n        InvalidSignatureLength,\\n        InvalidSignatureS\\n    }\\n\\n    /**\\n     * @dev The signature derives the `address(0)`.\\n     */\\n    error ECDSAInvalidSignature();\\n\\n    /**\\n     * @dev The signature has an invalid length.\\n     */\\n    error ECDSAInvalidSignatureLength(uint256 length);\\n\\n    /**\\n     * @dev The signature has an S value that is in the upper half order.\\n     */\\n    error ECDSAInvalidSignatureS(bytes32 s);\\n\\n    /**\\n     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n     * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n     * and a bytes32 providing additional information about the error.\\n     *\\n     * If no error is returned, then the address can be used for verification purposes.\\n     *\\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n     * this function rejects them by requiring the `s` value to be in the lower\\n     * half order, and the `v` value to be either 27 or 28.\\n     *\\n     * NOTE: This function only supports 65-byte signatures. ERC-2098 short signatures are rejected. This restriction\\n     * is DEPRECATED and will be removed in v6.0. Developers SHOULD NOT use signatures as unique identifiers; use hash\\n     * invalidation or nonces for replay protection.\\n     *\\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n     * verification to be secure: it is possible to craft signatures that\\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n     * this is by receiving a hash of the original message (which may otherwise\\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n     *\\n     * Documentation for signature generation:\\n     *\\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n     */\\n    function tryRecover(\\n        bytes32 hash,\\n        bytes memory signature\\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n        if (signature.length == 65) {\\n            bytes32 r;\\n            bytes32 s;\\n            uint8 v;\\n            // ecrecover takes the signature parameters, and the only way to get them\\n            // currently is to use assembly.\\n            assembly (\\\"memory-safe\\\") {\\n                r := mload(add(signature, 0x20))\\n                s := mload(add(signature, 0x40))\\n                v := byte(0, mload(add(signature, 0x60)))\\n            }\\n            return tryRecover(hash, v, r, s);\\n        } else {\\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\\n        }\\n    }\\n\\n    /**\\n     * @dev Variant of {tryRecover} that takes a signature in calldata\\n     */\\n    function tryRecoverCalldata(\\n        bytes32 hash,\\n        bytes calldata signature\\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n        if (signature.length == 65) {\\n            bytes32 r;\\n            bytes32 s;\\n            uint8 v;\\n            // ecrecover takes the signature parameters, calldata slices would work here, but are\\n            // significantly more expensive (length check) than using calldataload in assembly.\\n            assembly (\\\"memory-safe\\\") {\\n                r := calldataload(signature.offset)\\n                s := calldataload(add(signature.offset, 0x20))\\n                v := byte(0, calldataload(add(signature.offset, 0x40)))\\n            }\\n            return tryRecover(hash, v, r, s);\\n        } else {\\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the address that signed a hashed message (`hash`) with\\n     * `signature`. This address can then be used for verification purposes.\\n     *\\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n     * this function rejects them by requiring the `s` value to be in the lower\\n     * half order, and the `v` value to be either 27 or 28.\\n     *\\n     * NOTE: This function only supports 65-byte signatures. ERC-2098 short signatures are rejected. This restriction\\n     * is DEPRECATED and will be removed in v6.0. Developers SHOULD NOT use signatures as unique identifiers; use hash\\n     * invalidation or nonces for replay protection.\\n     *\\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n     * verification to be secure: it is possible to craft signatures that\\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n     * this is by receiving a hash of the original message (which may otherwise\\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n     */\\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n        _throwError(error, errorArg);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Variant of {recover} that takes a signature in calldata\\n     */\\n    function recoverCalldata(bytes32 hash, bytes calldata signature) internal pure returns (address) {\\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecoverCalldata(hash, signature);\\n        _throwError(error, errorArg);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n     *\\n     * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\\n     */\\n    function tryRecover(\\n        bytes32 hash,\\n        bytes32 r,\\n        bytes32 vs\\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n        unchecked {\\n            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n            // We do not check for an overflow here since the shift operation results in 0 or 1.\\n            uint8 v = uint8((uint256(vs) >> 255) + 27);\\n            return tryRecover(hash, v, r, s);\\n        }\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n     */\\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n        _throwError(error, errorArg);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n     * `r` and `s` signature fields separately.\\n     */\\n    function tryRecover(\\n        bytes32 hash,\\n        uint8 v,\\n        bytes32 r,\\n        bytes32 s\\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n        //\\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n        // these malleable signatures as well.\\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n            return (address(0), RecoverError.InvalidSignatureS, s);\\n        }\\n\\n        // If the signature is valid (and not malleable), return the signer address\\n        address signer = ecrecover(hash, v, r, s);\\n        if (signer == address(0)) {\\n            return (address(0), RecoverError.InvalidSignature, bytes32(0));\\n        }\\n\\n        return (signer, RecoverError.NoError, bytes32(0));\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\\n     * `r` and `s` signature fields separately.\\n     */\\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n        _throwError(error, errorArg);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Parse a signature into its `v`, `r` and `s` components. Supports 65-byte and 64-byte (ERC-2098)\\n     * formats. Returns (0,0,0) for invalid signatures.\\n     *\\n     * For 64-byte signatures, `v` is automatically normalized to 27 or 28.\\n     * For 65-byte signatures, `v` is returned as-is and MUST already be 27 or 28 for use with ecrecover.\\n     *\\n     * Consider validating the result before use, or use {tryRecover}/{recover} which perform full validation.\\n     */\\n    function parse(bytes memory signature) internal pure returns (uint8 v, bytes32 r, bytes32 s) {\\n        assembly (\\\"memory-safe\\\") {\\n            // Check the signature length\\n            switch mload(signature)\\n            // - case 65: r,s,v signature (standard)\\n            case 65 {\\n                r := mload(add(signature, 0x20))\\n                s := mload(add(signature, 0x40))\\n                v := byte(0, mload(add(signature, 0x60)))\\n            }\\n            // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098)\\n            case 64 {\\n                let vs := mload(add(signature, 0x40))\\n                r := mload(add(signature, 0x20))\\n                s := and(vs, shr(1, not(0)))\\n                v := add(shr(255, vs), 27)\\n            }\\n            default {\\n                r := 0\\n                s := 0\\n                v := 0\\n            }\\n        }\\n    }\\n\\n    /**\\n     * @dev Variant of {parse} that takes a signature in calldata\\n     */\\n    function parseCalldata(bytes calldata signature) internal pure returns (uint8 v, bytes32 r, bytes32 s) {\\n        assembly (\\\"memory-safe\\\") {\\n            // Check the signature length\\n            switch signature.length\\n            // - case 65: r,s,v signature (standard)\\n            case 65 {\\n                r := calldataload(signature.offset)\\n                s := calldataload(add(signature.offset, 0x20))\\n                v := byte(0, calldataload(add(signature.offset, 0x40)))\\n            }\\n            // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098)\\n            case 64 {\\n                let vs := calldataload(add(signature.offset, 0x20))\\n                r := calldataload(signature.offset)\\n                s := and(vs, shr(1, not(0)))\\n                v := add(shr(255, vs), 27)\\n            }\\n            default {\\n                r := 0\\n                s := 0\\n                v := 0\\n            }\\n        }\\n    }\\n\\n    /**\\n     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n     */\\n    function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n        if (error == RecoverError.NoError) {\\n            return; // no error: do nothing\\n        } else if (error == RecoverError.InvalidSignature) {\\n            revert ECDSAInvalidSignature();\\n        } else if (error == RecoverError.InvalidSignatureLength) {\\n            revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n        } else if (error == RecoverError.InvalidSignatureS) {\\n            revert ECDSAInvalidSignatureS(errorArg);\\n        }\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/cryptography/SignatureChecker.sol)\\n\\npragma solidity ^0.8.24;\\n\\nimport {ECDSA} from \\\"./ECDSA.sol\\\";\\nimport {IERC1271} from \\\"../../interfaces/IERC1271.sol\\\";\\nimport {IERC7913SignatureVerifier} from \\\"../../interfaces/IERC7913.sol\\\";\\nimport {Bytes} from \\\"../Bytes.sol\\\";\\n\\n/**\\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support:\\n *\\n * * ECDSA signatures from externally owned accounts (EOAs)\\n * * ERC-1271 signatures from smart contract wallets like Argent and Safe Wallet (previously Gnosis Safe)\\n * * ERC-7913 signatures from keys that do not have an Ethereum address of their own\\n *\\n * See https://eips.ethereum.org/EIPS/eip-1271[ERC-1271] and https://eips.ethereum.org/EIPS/eip-7913[ERC-7913].\\n */\\nlibrary SignatureChecker {\\n    using Bytes for bytes;\\n\\n    /**\\n     * @dev Checks if a signature is valid for a given signer and data hash. If the signer has code, the\\n     * signature is validated against it using ERC-1271, otherwise it's validated using `ECDSA.recover`.\\n     *\\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n     *\\n     * NOTE: For an extended version of this function that supports ERC-7913 signatures, see {isValidSignatureNow-bytes-bytes32-bytes-}.\\n     */\\n    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\\n        if (signer.code.length == 0) {\\n            (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\\n            return err == ECDSA.RecoverError.NoError && recovered == signer;\\n        } else {\\n            return isValidERC1271SignatureNow(signer, hash, signature);\\n        }\\n    }\\n\\n    /**\\n     * @dev Variant of {isValidSignatureNow} that takes a signature in calldata\\n     */\\n    function isValidSignatureNowCalldata(\\n        address signer,\\n        bytes32 hash,\\n        bytes calldata signature\\n    ) internal view returns (bool) {\\n        if (signer.code.length == 0) {\\n            (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecoverCalldata(hash, signature);\\n            return err == ECDSA.RecoverError.NoError && recovered == signer;\\n        } else {\\n            return isValidERC1271SignatureNow(signer, hash, signature);\\n        }\\n    }\\n\\n    /**\\n     * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\\n     * against the signer smart contract using ERC-1271.\\n     *\\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n     */\\n    function isValidERC1271SignatureNow(\\n        address signer,\\n        bytes32 hash,\\n        bytes memory signature\\n    ) internal view returns (bool result) {\\n        bytes4 selector = IERC1271.isValidSignature.selector;\\n        uint256 length = signature.length;\\n\\n        assembly (\\\"memory-safe\\\") {\\n            // Encoded calldata is :\\n            // [ 0x00 - 0x03 ] <selector>\\n            // [ 0x04 - 0x23 ] <hash>\\n            // [ 0x24 - 0x44 ] <signature offset> (0x40)\\n            // [ 0x44 - 0x64 ] <signature length>\\n            // [ 0x64 - ...  ] <signature data>\\n            let ptr := mload(0x40)\\n            mstore(ptr, selector)\\n            mstore(add(ptr, 0x04), hash)\\n            mstore(add(ptr, 0x24), 0x40)\\n            mcopy(add(ptr, 0x44), signature, add(length, 0x20))\\n\\n            let success := staticcall(gas(), signer, ptr, add(length, 0x64), 0x00, 0x20)\\n            result := and(success, and(gt(returndatasize(), 0x1f), eq(mload(0x00), selector)))\\n        }\\n    }\\n\\n    /**\\n     * @dev Verifies a signature for a given ERC-7913 signer and hash.\\n     *\\n     * The signer is a `bytes` object that is the concatenation of an address and optionally a key:\\n     * `verifier || key`. A signer must be at least 20 bytes long.\\n     *\\n     * Verification is done as follows:\\n     *\\n     * * If `signer.length < 20`: verification fails\\n     * * If `signer.length == 20`: verification is done using {isValidSignatureNow}\\n     * * Otherwise: verification is done using {IERC7913SignatureVerifier}\\n     *\\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n     */\\n    function isValidSignatureNow(\\n        bytes memory signer,\\n        bytes32 hash,\\n        bytes memory signature\\n    ) internal view returns (bool) {\\n        if (signer.length < 20) {\\n            return false;\\n        } else if (signer.length == 20) {\\n            return isValidSignatureNow(address(bytes20(signer)), hash, signature);\\n        } else {\\n            (bool success, bytes memory result) = address(bytes20(signer)).staticcall(\\n                abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature))\\n            );\\n            return (success &&\\n                result.length >= 32 &&\\n                abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector));\\n        }\\n    }\\n\\n    /**\\n     * @dev Verifies multiple ERC-7913 `signatures` for a given `hash` using a set of `signers`.\\n     * Returns `false` if the number of signers and signatures is not the same.\\n     *\\n     * The signers should be ordered by their `keccak256` hash to ensure efficient duplication check. Unordered\\n     * signers are supported, but the uniqueness check will be more expensive.\\n     *\\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n     */\\n    function areValidSignaturesNow(\\n        bytes32 hash,\\n        bytes[] memory signers,\\n        bytes[] memory signatures\\n    ) internal view returns (bool) {\\n        if (signers.length != signatures.length) return false;\\n\\n        bytes32 lastId = bytes32(0);\\n\\n        for (uint256 i = 0; i < signers.length; ++i) {\\n            bytes memory signer = signers[i];\\n\\n            // If one of the signatures is invalid, reject the batch\\n            if (!isValidSignatureNow(signer, hash, signatures[i])) return false;\\n\\n            bytes32 id = keccak256(signer);\\n            // If the current signer ID is greater than all previous IDs, then this is a new signer.\\n            if (lastId < id) {\\n                lastId = id;\\n            } else {\\n                // If this signer id is not greater than all the previous ones, verify that it is not a duplicate of a previous one\\n                // This loop is never executed if the signers are ordered by id.\\n                for (uint256 j = 0; j < i; ++j) {\\n                    if (id == keccak256(signers[j])) return false;\\n                }\\n            }\\n        }\\n\\n        return true;\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/WebAuthn.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/cryptography/WebAuthn.sol)\\n\\npragma solidity ^0.8.24;\\n\\nimport {P256} from \\\"./P256.sol\\\";\\nimport {Base64} from \\\"../Base64.sol\\\";\\nimport {Bytes} from \\\"../Bytes.sol\\\";\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Library for verifying WebAuthn Authentication Assertions.\\n *\\n * WebAuthn enables strong authentication for smart contracts using\\n * https://docs.openzeppelin.com/contracts/5.x/api/utils#P256[P256]\\n * as an alternative to traditional secp256k1 ECDSA signatures. This library verifies\\n * signatures generated during WebAuthn authentication ceremonies as specified in the\\n * https://www.w3.org/TR/webauthn-2/[WebAuthn Level 2 standard].\\n *\\n * For blockchain use cases, the following WebAuthn validations are intentionally omitted:\\n *\\n * * Origin validation: Origin verification in `clientDataJSON` is omitted as blockchain\\n *   contexts rely on authenticator and dapp frontend enforcement. Standard authenticators\\n *   implement proper origin validation.\\n * * RP ID hash validation: Verification of `rpIdHash` in authenticatorData against expected\\n *   RP ID hash is omitted. This is typically handled by platform-level security measures.\\n *   Including an expiry timestamp in signed data is recommended for enhanced security.\\n * * Signature counter: Verification of signature counter increments is omitted. While\\n *   useful for detecting credential cloning, on-chain operations typically include nonce\\n *   protection, making this check redundant.\\n * * Extension outputs: Extension output value verification is omitted as these are not\\n *   essential for core authentication security in blockchain applications.\\n * * Attestation: Attestation object verification is omitted as this implementation\\n *   focuses on authentication (`webauthn.get`) rather than registration ceremonies.\\n *\\n * Inspired by:\\n *\\n * * https://github.com/daimo-eth/p256-verifier/blob/master/src/WebAuthn.sol[daimo-eth implementation]\\n * * https://github.com/base/webauthn-sol/blob/main/src/WebAuthn.sol[base implementation]\\n */\\nlibrary WebAuthn {\\n    struct WebAuthnAuth {\\n        bytes32 r; /// The r value of secp256r1 signature\\n        bytes32 s; /// The s value of secp256r1 signature\\n        uint256 challengeIndex; /// The index at which \\\"challenge\\\":\\\"...\\\" occurs in `clientDataJSON`.\\n        uint256 typeIndex; /// The index at which \\\"type\\\":\\\"...\\\" occurs in `clientDataJSON`.\\n        /// The WebAuthn authenticator data.\\n        /// https://www.w3.org/TR/webauthn-2/#dom-authenticatorassertionresponse-authenticatordata\\n        bytes authenticatorData;\\n        /// The WebAuthn client data JSON.\\n        /// https://www.w3.org/TR/webauthn-2/#dom-authenticatorresponse-clientdatajson\\n        string clientDataJSON;\\n    }\\n\\n    /// @dev Bit 0 of the authenticator data flags: \\\"User Present\\\" bit.\\n    bytes1 internal constant AUTH_DATA_FLAGS_UP = 0x01;\\n    /// @dev Bit 2 of the authenticator data flags: \\\"User Verified\\\" bit.\\n    bytes1 internal constant AUTH_DATA_FLAGS_UV = 0x04;\\n    /// @dev Bit 3 of the authenticator data flags: \\\"Backup Eligibility\\\" bit.\\n    bytes1 internal constant AUTH_DATA_FLAGS_BE = 0x08;\\n    /// @dev Bit 4 of the authenticator data flags: \\\"Backup State\\\" bit.\\n    bytes1 internal constant AUTH_DATA_FLAGS_BS = 0x10;\\n\\n    /**\\n     * @dev Performs standard verification of a WebAuthn Authentication Assertion.\\n     */\\n    function verify(\\n        bytes memory challenge,\\n        WebAuthnAuth memory auth,\\n        bytes32 qx,\\n        bytes32 qy\\n    ) internal view returns (bool) {\\n        return verify(challenge, auth, qx, qy, true);\\n    }\\n\\n    /**\\n     * @dev Performs verification of a WebAuthn Authentication Assertion. This variants allow the caller to select\\n     * whether of not to require the UV flag (step 17).\\n     *\\n     * Verifies:\\n     *\\n     * 1. Type is \\\"webauthn.get\\\" (see {_validateExpectedTypeHash})\\n     * 2. Challenge matches the expected value (see {_validateChallenge})\\n     * 3. Cryptographic signature is valid for the given public key\\n     * 4. confirming physical user presence during authentication\\n     * 5. (if `requireUV` is true) confirming stronger user authentication (biometrics/PIN)\\n     * 6. Backup Eligibility (`BE`) and Backup State (BS) bits relationship is valid\\n     */\\n    function verify(\\n        bytes memory challenge,\\n        WebAuthnAuth memory auth,\\n        bytes32 qx,\\n        bytes32 qy,\\n        bool requireUV\\n    ) internal view returns (bool) {\\n        // Verify authenticator data has sufficient length (37 bytes minimum):\\n        // - 32 bytes for rpIdHash\\n        // - 1 byte for flags\\n        // - 4 bytes for signature counter\\n        return\\n            auth.authenticatorData.length > 36 &&\\n            _validateExpectedTypeHash(auth.clientDataJSON, auth.typeIndex) && // 11\\n            _validateChallenge(auth.clientDataJSON, auth.challengeIndex, challenge) && // 12\\n            _validateUserPresentBitSet(auth.authenticatorData[32]) && // 16\\n            (!requireUV || _validateUserVerifiedBitSet(auth.authenticatorData[32])) && // 17\\n            _validateBackupEligibilityAndState(auth.authenticatorData[32]) && // Consistency check\\n            // P256.verify handles signature malleability internally\\n            P256.verify(\\n                sha256(\\n                    abi.encodePacked(\\n                        auth.authenticatorData,\\n                        sha256(bytes(auth.clientDataJSON)) // 19\\n                    )\\n                ),\\n                auth.r,\\n                auth.s,\\n                qx,\\n                qy\\n            ); // 20\\n    }\\n\\n    /**\\n     * @dev Validates that the https://www.w3.org/TR/webauthn-2/#type[Type] field in the client data JSON is set to\\n     * \\\"webauthn.get\\\".\\n     *\\n     * Step 11 in https://www.w3.org/TR/webauthn-2/#sctn-verifying-assertion[verifying an assertion].\\n     */\\n    function _validateExpectedTypeHash(\\n        string memory clientDataJSON,\\n        uint256 typeIndex\\n    ) private pure returns (bool success) {\\n        assembly (\\\"memory-safe\\\") {\\n            success := and(\\n                // clientDataJson.length >= typeIndex + 21\\n                gt(mload(clientDataJSON), add(typeIndex, 20)),\\n                eq(\\n                    // get 32 bytes starting at index typexIndex in clientDataJSON, and keep the leftmost 21 bytes\\n                    and(mload(add(add(clientDataJSON, 0x20), typeIndex)), shl(88, not(0))),\\n                    // solhint-disable-next-line quotes\\n                    '\\\"type\\\":\\\"webauthn.get\\\"'\\n                )\\n            )\\n        }\\n    }\\n\\n    /**\\n     * @dev Validates that the challenge in the client data JSON matches the `expectedChallenge`.\\n     *\\n     * Step 12 in https://www.w3.org/TR/webauthn-2/#sctn-verifying-assertion[verifying an assertion].\\n     */\\n    function _validateChallenge(\\n        string memory clientDataJSON,\\n        uint256 challengeIndex,\\n        bytes memory challenge\\n    ) private pure returns (bool) {\\n        // solhint-disable-next-line quotes\\n        string memory expectedChallenge = string.concat('\\\"challenge\\\":\\\"', Base64.encodeURL(challenge), '\\\"');\\n        string memory actualChallenge = string(\\n            Bytes.slice(bytes(clientDataJSON), challengeIndex, challengeIndex + bytes(expectedChallenge).length)\\n        );\\n\\n        return Strings.equal(actualChallenge, expectedChallenge);\\n    }\\n\\n    /**\\n     * @dev Validates that the https://www.w3.org/TR/webauthn-2/#up[User Present (UP)] bit is set.\\n     *\\n     * Step 16 in https://www.w3.org/TR/webauthn-2/#sctn-verifying-assertion[verifying an assertion].\\n     *\\n     * NOTE: Required by WebAuthn spec but may be skipped for platform authenticators\\n     * (Touch ID, Windows Hello) in controlled environments. Enforce for public-facing apps.\\n     */\\n    function _validateUserPresentBitSet(bytes1 flags) private pure returns (bool) {\\n        return (flags & AUTH_DATA_FLAGS_UP) == AUTH_DATA_FLAGS_UP;\\n    }\\n\\n    /**\\n     * @dev Validates that the https://www.w3.org/TR/webauthn-2/#uv[User Verified (UV)] bit is set.\\n     *\\n     * Step 17 in https://www.w3.org/TR/webauthn-2/#sctn-verifying-assertion[verifying an assertion].\\n     *\\n     * The UV bit indicates whether the user was verified using a stronger identification method\\n     * (biometrics, PIN, password). While optional, requiring UV=1 is recommended for:\\n     *\\n     * * High-value transactions and sensitive operations\\n     * * Account recovery and critical settings changes\\n     * * Privileged operations\\n     *\\n     * NOTE: For routine operations or when using hardware authenticators without verification capabilities,\\n     * `UV=0` may be acceptable. The choice of whether to require UV represents a security vs. usability\\n     * tradeoff - for blockchain applications handling valuable assets, requiring UV is generally safer.\\n     */\\n    function _validateUserVerifiedBitSet(bytes1 flags) private pure returns (bool) {\\n        return (flags & AUTH_DATA_FLAGS_UV) == AUTH_DATA_FLAGS_UV;\\n    }\\n\\n    /**\\n     * @dev Validates the relationship between Backup Eligibility (`BE`) and Backup State (`BS`) bits\\n     * according to the WebAuthn specification.\\n     *\\n     * The function enforces that if a credential is backed up (`BS=1`), it must also be eligible\\n     * for backup (`BE=1`). This prevents unauthorized credential backup and ensures compliance\\n     * with the WebAuthn spec.\\n     *\\n     * Returns true in these valid states:\\n     *\\n     * * `BE=1`, `BS=0`: Credential is eligible but not backed up\\n     * * `BE=1`, `BS=1`: Credential is eligible and backed up\\n     * * `BE=0`, `BS=0`: Credential is not eligible and not backed up\\n     *\\n     * Returns false only when `BE=0` and `BS=1`, which is an invalid state indicating\\n     * a credential that's backed up but not eligible for backup.\\n     *\\n     * NOTE: While the WebAuthn spec defines this relationship between `BE` and `BS` bits,\\n     * validating it is not explicitly required as part of the core verification procedure.\\n     * Some implementations may choose to skip this check for broader authenticator\\n     * compatibility or when the application's threat model doesn't consider credential\\n     * syncing a major risk.\\n     */\\n    function _validateBackupEligibilityAndState(bytes1 flags) private pure returns (bool) {\\n        return (flags & AUTH_DATA_FLAGS_BE) == AUTH_DATA_FLAGS_BE || (flags & AUTH_DATA_FLAGS_BS) == 0;\\n    }\\n\\n    /**\\n     * @dev Verifies that calldata bytes (`input`) represents a valid `WebAuthnAuth` object. If encoding is valid,\\n     * returns true and the calldata view at the object. Otherwise, returns false and an invalid calldata object.\\n     *\\n     * NOTE: The returned `auth` object should not be accessed if `success` is false. Trying to access the data may\\n     * cause revert/panic.\\n     */\\n    function tryDecodeAuth(bytes calldata input) internal pure returns (bool success, WebAuthnAuth calldata auth) {\\n        assembly (\\\"memory-safe\\\") {\\n            auth := input.offset\\n        }\\n\\n        // Minimum length to hold 6 objects (32 bytes each)\\n        if (input.length < 0xC0) return (false, auth);\\n\\n        // Get offset of non-value-type elements relative to the input buffer\\n        uint256 authenticatorDataOffset = uint256(bytes32(input[0x80:]));\\n        uint256 clientDataJSONOffset = uint256(bytes32(input[0xa0:]));\\n\\n        // The elements length (at the offset) should be 32 bytes long. We check that this is within the\\n        // buffer bounds. Since we know input.length is at least 32, we can subtract with no overflow risk.\\n        if (input.length - 0x20 < authenticatorDataOffset || input.length - 0x20 < clientDataJSONOffset)\\n            return (false, auth);\\n\\n        // Get the lengths. offset + 32 is bounded by input.length so it does not overflow.\\n        uint256 authenticatorDataLength = uint256(bytes32(input[authenticatorDataOffset:]));\\n        uint256 clientDataJSONLength = uint256(bytes32(input[clientDataJSONOffset:]));\\n\\n        // Check that the input buffer is long enough to store the non-value-type elements\\n        // Since we know input.length is at least xxxOffset + 32, we can subtract with no overflow risk.\\n        if (\\n            input.length - authenticatorDataOffset - 0x20 < authenticatorDataLength ||\\n            input.length - clientDataJSONOffset - 0x20 < clientDataJSONLength\\n        ) return (false, auth);\\n\\n        return (true, auth);\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/P256.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/P256.sol)\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {Errors} from \\\"../Errors.sol\\\";\\n\\n/**\\n * @dev Implementation of secp256r1 verification and recovery functions.\\n *\\n * The secp256r1 curve (also known as P256) is a NIST standard curve with wide support in modern devices\\n * and cryptographic standards. Some notable examples include Apple's Secure Enclave and Android's Keystore\\n * as well as authentication protocols like FIDO2.\\n *\\n * Based on the original https://github.com/itsobvioustech/aa-passkeys-wallet/blob/d3d423f28a4d8dfcb203c7fa0c47f42592a7378e/src/Secp256r1.sol[implementation of itsobvioustech] (GNU General Public License v3.0).\\n * Heavily inspired in https://github.com/maxrobot/elliptic-solidity/blob/c4bb1b6e8ae89534d8db3a6b3a6b52219100520f/contracts/Secp256r1.sol[maxrobot] and\\n * https://github.com/tdrerup/elliptic-curve-solidity/blob/59a9c25957d4d190eff53b6610731d81a077a15e/contracts/curves/EllipticCurve.sol[tdrerup] implementations.\\n *\\n * _Available since v5.1._\\n */\\nlibrary P256 {\\n    struct JPoint {\\n        uint256 x;\\n        uint256 y;\\n        uint256 z;\\n    }\\n\\n    /// @dev Generator (x component)\\n    uint256 internal constant GX = 0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296;\\n    /// @dev Generator (y component)\\n    uint256 internal constant GY = 0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5;\\n    /// @dev P (size of the field)\\n    uint256 internal constant P = 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF;\\n    /// @dev N (order of G)\\n    uint256 internal constant N = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551;\\n    /// @dev A parameter of the weierstrass equation\\n    uint256 internal constant A = 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC;\\n    /// @dev B parameter of the weierstrass equation\\n    uint256 internal constant B = 0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B;\\n\\n    /// @dev (P + 1) / 4. Useful to compute sqrt\\n    uint256 private constant P1DIV4 = 0x3fffffffc0000000400000000000000000000000400000000000000000000000;\\n\\n    /// @dev N/2 for excluding higher order `s` values\\n    uint256 private constant HALF_N = 0x7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8;\\n\\n    /**\\n     * @dev Verifies a secp256r1 signature using the RIP-7212 precompile and falls back to the Solidity implementation\\n     * if the precompile is not available. This version should work on all chains, but requires the deployment of more\\n     * bytecode.\\n     *\\n     * @param h - hashed message\\n     * @param r - signature half R\\n     * @param s - signature half S\\n     * @param qx - public key coordinate X\\n     * @param qy - public key coordinate Y\\n     *\\n     * IMPORTANT: This function disallows signatures where the `s` value is above `N/2` to prevent malleability.\\n     * To flip the `s` value, compute `s = N - s`.\\n     */\\n    function verify(bytes32 h, bytes32 r, bytes32 s, bytes32 qx, bytes32 qy) internal view returns (bool) {\\n        (bool valid, bool supported) = _tryVerifyNative(h, r, s, qx, qy);\\n        return supported ? valid : verifySolidity(h, r, s, qx, qy);\\n    }\\n\\n    /**\\n     * @dev Same as {verify}, but it will revert if the required precompile is not available.\\n     *\\n     * Make sure any logic (code or precompile) deployed at that address is the expected one,\\n     * otherwise the returned value may be misinterpreted as a positive boolean.\\n     */\\n    function verifyNative(bytes32 h, bytes32 r, bytes32 s, bytes32 qx, bytes32 qy) internal view returns (bool) {\\n        (bool valid, bool supported) = _tryVerifyNative(h, r, s, qx, qy);\\n        if (supported) {\\n            return valid;\\n        } else {\\n            revert Errors.MissingPrecompile(address(0x100));\\n        }\\n    }\\n\\n    /**\\n     * @dev Same as {verify}, but it will return false if the required precompile is not available.\\n     */\\n    function _tryVerifyNative(\\n        bytes32 h,\\n        bytes32 r,\\n        bytes32 s,\\n        bytes32 qx,\\n        bytes32 qy\\n    ) private view returns (bool valid, bool supported) {\\n        if (!_isProperSignature(r, s) || !isValidPublicKey(qx, qy)) {\\n            return (false, true); // signature is invalid, and its not because the precompile is missing\\n        } else if (_rip7212(h, r, s, qx, qy)) {\\n            return (true, true); // precompile is present, signature is valid\\n        } else if (\\n            // Given precompiles have no bytecode (i.e. `address(0x100).code.length == 0`), we use\\n            // a valid signature with small `r` and `s` values to check if the precompile is present. Taken from\\n            // https://github.com/C2SP/wycheproof/blob/4672ff74d68766e7785c2cac4c597effccef2c5c/testvectors/ecdsa_secp256r1_sha256_p1363_test.json#L1173-L1204\\n            _rip7212(\\n                0xbb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023, // sha256(\\\"123400\\\")\\n                0x0000000000000000000000000000000000000000000000000000000000000005,\\n                0x0000000000000000000000000000000000000000000000000000000000000001,\\n                0xa71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac957,\\n                0x5d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b\\n            )\\n        ) {\\n            return (false, true); // precompile is present, signature is invalid\\n        } else {\\n            return (false, false); // precompile is absent\\n        }\\n    }\\n\\n    /**\\n     * @dev Low level helper for {_tryVerifyNative}. Calls the precompile and checks if there is a return value.\\n     */\\n    function _rip7212(bytes32 h, bytes32 r, bytes32 s, bytes32 qx, bytes32 qy) private view returns (bool isValid) {\\n        assembly (\\\"memory-safe\\\") {\\n            // Use the free memory pointer without updating it at the end of the function\\n            let ptr := mload(0x40)\\n            mstore(ptr, h)\\n            mstore(add(ptr, 0x20), r)\\n            mstore(add(ptr, 0x40), s)\\n            mstore(add(ptr, 0x60), qx)\\n            mstore(add(ptr, 0x80), qy)\\n            // RIP-7212 precompiles return empty bytes when an invalid signature is passed, making it impossible\\n            // to distinguish the presence of the precompile. Custom precompile implementations may decide to\\n            // return `bytes32(0)` (i.e. false) without developers noticing, so we decide to evaluate the return value\\n            // without expanding memory using scratch space.\\n            mstore(0x00, 0) // zero out scratch space in case the precompile doesn't return anything\\n            if iszero(staticcall(gas(), 0x100, ptr, 0xa0, 0x00, 0x20)) {\\n                invalid()\\n            }\\n            isValid := mload(0x00)\\n        }\\n    }\\n\\n    /**\\n     * @dev Same as {verify}, but only the Solidity implementation is used.\\n     */\\n    function verifySolidity(bytes32 h, bytes32 r, bytes32 s, bytes32 qx, bytes32 qy) internal view returns (bool) {\\n        if (!_isProperSignature(r, s) || !isValidPublicKey(qx, qy)) {\\n            return false;\\n        }\\n\\n        JPoint[16] memory points = _preComputeJacobianPoints(uint256(qx), uint256(qy));\\n        uint256 w = Math.invModPrime(uint256(s), N);\\n        uint256 u1 = mulmod(uint256(h), w, N);\\n        uint256 u2 = mulmod(uint256(r), w, N);\\n        (uint256 x, ) = _jMultShamir(points, u1, u2);\\n        return ((x % N) == uint256(r));\\n    }\\n\\n    /**\\n     * @dev Public key recovery\\n     *\\n     * @param h - hashed message\\n     * @param v - signature recovery param\\n     * @param r - signature half R\\n     * @param s - signature half S\\n     *\\n     * IMPORTANT: This function disallows signatures where the `s` value is above `N/2` to prevent malleability.\\n     * To flip the `s` value, compute `s = N - s` and `v = 1 - v` if (`v = 0 | 1`).\\n     */\\n    function recovery(bytes32 h, uint8 v, bytes32 r, bytes32 s) internal view returns (bytes32 x, bytes32 y) {\\n        if (!_isProperSignature(r, s) || v > 1) {\\n            return (0, 0);\\n        }\\n\\n        uint256 p = P; // cache P on the stack\\n        uint256 rx = uint256(r);\\n        uint256 ry2 = addmod(mulmod(addmod(mulmod(rx, rx, p), A, p), rx, p), B, p); // weierstrass equation y² = x³ + a.x + b\\n        uint256 ry = Math.modExp(ry2, P1DIV4, p); // This formula for sqrt work because P ≡ 3 (mod 4)\\n        if (mulmod(ry, ry, p) != ry2) return (0, 0); // Sanity check\\n        if (ry % 2 != v) ry = p - ry;\\n\\n        JPoint[16] memory points = _preComputeJacobianPoints(rx, ry);\\n        uint256 w = Math.invModPrime(uint256(r), N);\\n        uint256 u1 = mulmod(N - (uint256(h) % N), w, N);\\n        uint256 u2 = mulmod(uint256(s), w, N);\\n        (uint256 xU, uint256 yU) = _jMultShamir(points, u1, u2);\\n        return (bytes32(xU), bytes32(yU));\\n    }\\n\\n    /**\\n     * @dev Checks if (x, y) are valid coordinates of a point on the curve.\\n     * In particular this function checks that x < P and y < P.\\n     */\\n    function isValidPublicKey(bytes32 x, bytes32 y) internal pure returns (bool result) {\\n        assembly (\\\"memory-safe\\\") {\\n            let p := P\\n            let lhs := mulmod(y, y, p) // y^2\\n            let rhs := addmod(mulmod(addmod(mulmod(x, x, p), A, p), x, p), B, p) // ((x^2 + a) * x) + b = x^3 + ax + b\\n            result := and(and(lt(x, p), lt(y, p)), eq(lhs, rhs)) // Should conform with the Weierstrass equation\\n        }\\n    }\\n\\n    /**\\n     * @dev Checks if (r, s) is a proper signature.\\n     * In particular, this checks that `s` is in the \\\"lower-range\\\", making the signature non-malleable.\\n     */\\n    function _isProperSignature(bytes32 r, bytes32 s) private pure returns (bool) {\\n        return uint256(r) > 0 && uint256(r) < N && uint256(s) > 0 && uint256(s) <= HALF_N;\\n    }\\n\\n    /**\\n     * @dev Reduce from jacobian to affine coordinates\\n     * @param jx - jacobian coordinate x\\n     * @param jy - jacobian coordinate y\\n     * @param jz - jacobian coordinate z\\n     * @return ax - affine coordinate x\\n     * @return ay - affine coordinate y\\n     */\\n    function _affineFromJacobian(uint256 jx, uint256 jy, uint256 jz) private view returns (uint256 ax, uint256 ay) {\\n        if (jz == 0) return (0, 0);\\n        uint256 p = P; // cache P on the stack\\n        uint256 zinv = Math.invModPrime(jz, p);\\n        assembly (\\\"memory-safe\\\") {\\n            let zzinv := mulmod(zinv, zinv, p)\\n            ax := mulmod(jx, zzinv, p)\\n            ay := mulmod(jy, mulmod(zzinv, zinv, p), p)\\n        }\\n    }\\n\\n    /**\\n     * @dev Point addition on the jacobian coordinates\\n     * Reference: https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2\\n     *\\n     * Note that:\\n     *\\n     * - `addition-add-1998-cmo-2` doesn't support identical input points. This version is modified to use\\n     * the `h` and `r` values computed by `addition-add-1998-cmo-2` to detect identical inputs, and fallback to\\n     * `doubling-dbl-1998-cmo-2` if needed.\\n     * - if one of the points is at infinity (i.e. `z=0`), the result is undefined.\\n     */\\n    function _jAdd(\\n        JPoint memory p1,\\n        uint256 x2,\\n        uint256 y2,\\n        uint256 z2\\n    ) private pure returns (uint256 rx, uint256 ry, uint256 rz) {\\n        assembly (\\\"memory-safe\\\") {\\n            let p := P\\n            let z1 := mload(add(p1, 0x40))\\n            let zz1 := mulmod(z1, z1, p) // zz1 = z1²\\n            let s1 := mulmod(mload(add(p1, 0x20)), mulmod(mulmod(z2, z2, p), z2, p), p) // s1 = y1*z2³\\n            let r := addmod(mulmod(y2, mulmod(zz1, z1, p), p), sub(p, s1), p) // r = s2-s1 = y2*z1³-s1 = y2*z1³-y1*z2³\\n            let u1 := mulmod(mload(p1), mulmod(z2, z2, p), p) // u1 = x1*z2²\\n            let h := addmod(mulmod(x2, zz1, p), sub(p, u1), p) // h = u2-u1 = x2*z1²-u1 = x2*z1²-x1*z2²\\n\\n            // detect edge cases where inputs are identical\\n            switch and(iszero(r), iszero(h))\\n            // case 0: points are different\\n            case 0 {\\n                let hh := mulmod(h, h, p) // h²\\n\\n                // x' = r²-h³-2*u1*h²\\n                rx := addmod(\\n                    addmod(mulmod(r, r, p), sub(p, mulmod(h, hh, p)), p),\\n                    sub(p, mulmod(2, mulmod(u1, hh, p), p)),\\n                    p\\n                )\\n                // y' = r*(u1*h²-x')-s1*h³\\n                ry := addmod(\\n                    mulmod(r, addmod(mulmod(u1, hh, p), sub(p, rx), p), p),\\n                    sub(p, mulmod(s1, mulmod(h, hh, p), p)),\\n                    p\\n                )\\n                // z' = h*z1*z2\\n                rz := mulmod(h, mulmod(z1, z2, p), p)\\n            }\\n            // case 1: points are equal\\n            case 1 {\\n                let x := x2\\n                let y := y2\\n                let z := z2\\n                let yy := mulmod(y, y, p)\\n                let zz := mulmod(z, z, p)\\n                let m := addmod(mulmod(3, mulmod(x, x, p), p), mulmod(A, mulmod(zz, zz, p), p), p) // m = 3*x²+a*z⁴\\n                let s := mulmod(4, mulmod(x, yy, p), p) // s = 4*x*y²\\n\\n                // x' = t = m²-2*s\\n                rx := addmod(mulmod(m, m, p), sub(p, mulmod(2, s, p)), p)\\n\\n                // y' = m*(s-t)-8*y⁴ = m*(s-x')-8*y⁴\\n                // cut the computation to avoid stack too deep\\n                let rytmp1 := sub(p, mulmod(8, mulmod(yy, yy, p), p)) // -8*y⁴\\n                let rytmp2 := addmod(s, sub(p, rx), p) // s-x'\\n                ry := addmod(mulmod(m, rytmp2, p), rytmp1, p) // m*(s-x')-8*y⁴\\n\\n                // z' = 2*y*z\\n                rz := mulmod(2, mulmod(y, z, p), p)\\n            }\\n        }\\n    }\\n\\n    /**\\n     * @dev Point doubling on the jacobian coordinates\\n     * Reference: https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2\\n     */\\n    function _jDouble(uint256 x, uint256 y, uint256 z) private pure returns (uint256 rx, uint256 ry, uint256 rz) {\\n        assembly (\\\"memory-safe\\\") {\\n            let p := P\\n            let yy := mulmod(y, y, p)\\n            let zz := mulmod(z, z, p)\\n            let m := addmod(mulmod(3, mulmod(x, x, p), p), mulmod(A, mulmod(zz, zz, p), p), p) // m = 3*x²+a*z⁴\\n            let s := mulmod(4, mulmod(x, yy, p), p) // s = 4*x*y²\\n\\n            // x' = t = m²-2*s\\n            rx := addmod(mulmod(m, m, p), sub(p, mulmod(2, s, p)), p)\\n            // y' = m*(s-t)-8*y⁴ = m*(s-x')-8*y⁴\\n            ry := addmod(mulmod(m, addmod(s, sub(p, rx), p), p), sub(p, mulmod(8, mulmod(yy, yy, p), p)), p)\\n            // z' = 2*y*z\\n            rz := mulmod(2, mulmod(y, z, p), p)\\n        }\\n    }\\n\\n    /**\\n     * @dev Compute G·u1 + P·u2 using the precomputed points for G and P (see {_preComputeJacobianPoints}).\\n     *\\n     * Uses Strauss Shamir trick for EC multiplication\\n     * https://stackoverflow.com/questions/50993471/ec-scalar-multiplication-with-strauss-shamir-method\\n     *\\n     * We optimize this for 2 bits at a time rather than a single bit. The individual points for a single pass are\\n     * precomputed. Overall this reduces the number of additions while keeping the same number of\\n     * doublings\\n     */\\n    function _jMultShamir(\\n        JPoint[16] memory points,\\n        uint256 u1,\\n        uint256 u2\\n    ) private view returns (uint256 rx, uint256 ry) {\\n        uint256 x = 0;\\n        uint256 y = 0;\\n        uint256 z = 0;\\n        unchecked {\\n            for (uint256 i = 0; i < 128; ++i) {\\n                if (z > 0) {\\n                    (x, y, z) = _jDouble(x, y, z);\\n                    (x, y, z) = _jDouble(x, y, z);\\n                }\\n                // Read 2 bits of u1, and 2 bits of u2. Combining the two gives the lookup index in the table.\\n                uint256 pos = ((u1 >> 252) & 0xc) | ((u2 >> 254) & 0x3);\\n                // Points that have z = 0 are points at infinity. They are the additive 0 of the group\\n                // - if the lookup point is a 0, we can skip it\\n                // - otherwise:\\n                //   - if the current point (x, y, z) is 0, we use the lookup point as our new value (0+P=P)\\n                //   - if the current point (x, y, z) is not 0, both points are valid and we can use `_jAdd`\\n                if (points[pos].z != 0) {\\n                    if (z == 0) {\\n                        (x, y, z) = (points[pos].x, points[pos].y, points[pos].z);\\n                    } else {\\n                        (x, y, z) = _jAdd(points[pos], x, y, z);\\n                    }\\n                }\\n                u1 <<= 2;\\n                u2 <<= 2;\\n            }\\n        }\\n        return _affineFromJacobian(x, y, z);\\n    }\\n\\n    /**\\n     * @dev Precompute a matrice of useful jacobian points associated with a given P. This can be seen as a 4x4 matrix\\n     * that contains combination of P and G (generator) up to 3 times each. See the table below:\\n     *\\n     * ┌────┬─────────────────────┐\\n     * │  i │  0    1     2     3 │\\n     * ├────┼─────────────────────┤\\n     * │  0 │  0    p    2p    3p │\\n     * │  4 │  g  g+p  g+2p  g+3p │\\n     * │  8 │ 2g 2g+p 2g+2p 2g+3p │\\n     * │ 12 │ 3g 3g+p 3g+2p 3g+3p │\\n     * └────┴─────────────────────┘\\n     *\\n     * Note that `_jAdd` (and thus `_jAddPoint`) does not handle the case where one of the inputs is a point at\\n     * infinity (z = 0). However, we know that since `N ≡ 1 mod 2` and `N ≡ 1 mod 3`, there is no point P such that\\n     * 2P = 0 or 3P = 0. This guarantees that g, 2g, 3g, p, 2p, 3p are all non-zero, and that all `_jAddPoint` calls\\n     * have valid inputs.\\n     */\\n    function _preComputeJacobianPoints(uint256 px, uint256 py) private pure returns (JPoint[16] memory points) {\\n        points[0x00] = JPoint(0, 0, 0); // 0,0\\n        points[0x01] = JPoint(px, py, 1); // 1,0 (p)\\n        points[0x04] = JPoint(GX, GY, 1); // 0,1 (g)\\n        points[0x02] = _jDoublePoint(points[0x01]); // 2,0 (2p)\\n        points[0x08] = _jDoublePoint(points[0x04]); // 0,2 (2g)\\n        points[0x03] = _jAddPoint(points[0x01], points[0x02]); // 3,0 (p+2p = 3p)\\n        points[0x05] = _jAddPoint(points[0x01], points[0x04]); // 1,1 (p+g)\\n        points[0x06] = _jAddPoint(points[0x02], points[0x04]); // 2,1 (2p+g)\\n        points[0x07] = _jAddPoint(points[0x03], points[0x04]); // 3,1 (3p+g)\\n        points[0x09] = _jAddPoint(points[0x01], points[0x08]); // 1,2 (p+2g)\\n        points[0x0a] = _jAddPoint(points[0x02], points[0x08]); // 2,2 (2p+2g)\\n        points[0x0b] = _jAddPoint(points[0x03], points[0x08]); // 3,2 (3p+2g)\\n        points[0x0c] = _jAddPoint(points[0x04], points[0x08]); // 0,3 (g+2g = 3g)\\n        points[0x0d] = _jAddPoint(points[0x01], points[0x0c]); // 1,3 (p+3g)\\n        points[0x0e] = _jAddPoint(points[0x02], points[0x0c]); // 2,3 (2p+3g)\\n        points[0x0f] = _jAddPoint(points[0x03], points[0x0c]); // 3,3 (3p+3g)\\n    }\\n\\n    function _jAddPoint(JPoint memory p1, JPoint memory p2) private pure returns (JPoint memory) {\\n        (uint256 x, uint256 y, uint256 z) = _jAdd(p1, p2.x, p2.y, p2.z);\\n        return JPoint(x, y, z);\\n    }\\n\\n    function _jDoublePoint(JPoint memory p) private pure returns (JPoint memory) {\\n        (uint256 x, uint256 y, uint256 z) = _jDouble(p.x, p.y, p.z);\\n        return JPoint(x, y, z);\\n    }\\n}\\n\"},\"src/libraries/LibFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.24;\\n\\n/**\\n * @title LibFactory\\n * @notice Diamond storage for factory reference\\n * @dev Stores the factory address that deployed this wallet.\\n *      Used for:\\n *      - Facet lookups (factory.getFacet(selector))\\n *      - Executor lookups (factory.executor())\\n *      - Global pause checks (factory.globalPaused())\\n */\\nlibrary LibFactory {\\n    bytes32 constant FACTORY_STORAGE_POSITION = keccak256(\\\"wallet.factory.storage.v1\\\");\\n\\n    error FactoryAlreadySet();\\n\\n    struct FactoryStorage {\\n        address factory;\\n    }\\n\\n    /// @notice Access the FactoryStorage struct at its diamond storage slot\\n    /// @return fs Storage pointer to FactoryStorage\\n    function factoryStorage() internal pure returns (FactoryStorage storage fs) {\\n        bytes32 position = FACTORY_STORAGE_POSITION;\\n        assembly {\\n            fs.slot := position\\n        }\\n    }\\n\\n    /// @notice Store the deploying factory address (one-time, during initialization)\\n    /// @param _factory The factory contract address\\n    function setFactory(address _factory) internal {\\n        FactoryStorage storage fs = factoryStorage();\\n        if (fs.factory != address(0)) revert FactoryAlreadySet();\\n        fs.factory = _factory;\\n    }\\n\\n    /// @notice Get the stored factory address\\n    /// @return The factory contract address\\n    function getFactory() internal view returns (address) {\\n        return factoryStorage().factory;\\n    }\\n}\\n\"},\"src/interfaces/IUserProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.24;\\n\\n/**\\n * @title IUserProxyFactory\\n * @notice Interface for facets to read global settings from the factory\\n * @dev Proxies store factory address and call back to get executor and facets\\n *\\n * Factory-Controlled Facets Architecture:\\n * - Factory stores selector → facet mappings (shared by all wallets)\\n * - Wallets read facet addresses from factory in fallback()\\n * - Timelocked facet updates atomically apply to ALL wallets\\n */\\ninterface IUserProxyFactory {\\n    /// @notice Get the authorized executor address that can spend allowances\\n    /// @return The executor address\\n    function executor() external view returns (address);\\n\\n    /// @notice Get the diamond implementation address\\n    /// @return The WalletDiamond implementation address\\n    function implementation() external view returns (address);\\n\\n    /// @notice Get the facet address for a given function selector\\n    /// @param selector The 4-byte function selector\\n    /// @return facet The facet contract address (address(0) if not found)\\n    function getFacet(bytes4 selector) external view returns (address facet);\\n\\n    /// @notice Check if the factory has globally paused all wallet operations\\n    /// @return True if the global pause is active\\n    function globalPaused() external view returns (bool);\\n\\n    /// @notice Check if an address is a registered pauser\\n    /// @param account The address to check\\n    /// @return True if the address is a pauser\\n    function isPauser(address account) external view returns (bool);\\n\\n    // ============ Recovery Defaults ============\\n\\n    /// @notice Get the default recovery admin addresses\\n    /// @return Array of default recovery admin addresses\\n    function getDefaultRecoveryAdmins() external view returns (address[] memory);\\n\\n    /// @notice Get the fixed recovery timelock delay (10 days)\\n    /// @return The fixed timelock delay in seconds\\n    function getDefaultRecoveryDelay() external view returns (uint256);\\n\\n    // ============ Default Daily Limits ============\\n\\n    /// @notice Get the default daily spending limits for newly deployed wallets\\n    /// @return tokens Token addresses\\n    /// @return amounts Daily limit amounts\\n    function getDefaultDailyLimits() external view returns (address[] memory tokens, uint256[] memory amounts);\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)\\n\\npragma solidity >=0.4.16;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\"},\"lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)\\n\\npragma solidity >=0.4.16;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\"},\"lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1271.sol)\\n\\npragma solidity >=0.5.0;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n    /**\\n     * @dev Should return whether the signature provided is valid for the provided data\\n     * @param hash      Hash of the data to be signed\\n     * @param signature Signature byte array associated with `hash`\\n     */\\n    function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue);\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC7913.sol)\\n\\npragma solidity >=0.5.0;\\n\\n/**\\n * @dev Signature verifier interface.\\n */\\ninterface IERC7913SignatureVerifier {\\n    /**\\n     * @dev Verifies `signature` as a valid signature of `hash` by `key`.\\n     *\\n     * MUST return the bytes4 magic value IERC7913SignatureVerifier.verify.selector if the signature is valid.\\n     * SHOULD return 0xffffffff or revert if the signature is not valid.\\n     * SHOULD return 0xffffffff or revert if the key is empty\\n     */\\n    function verify(bytes calldata key, bytes32 hash, bytes calldata signature) external view returns (bytes4);\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/Bytes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Bytes.sol)\\n\\npragma solidity ^0.8.24;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev Bytes operations.\\n */\\nlibrary Bytes {\\n    /**\\n     * @dev Forward search for `s` in `buffer`\\n     * * If `s` is present in the buffer, returns the index of the first instance\\n     * * If `s` is not present in the buffer, returns type(uint256).max\\n     *\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf[Javascript's `Array.indexOf`]\\n     */\\n    function indexOf(bytes memory buffer, bytes1 s) internal pure returns (uint256) {\\n        return indexOf(buffer, s, 0);\\n    }\\n\\n    /**\\n     * @dev Forward search for `s` in `buffer` starting at position `pos`\\n     * * If `s` is present in the buffer (at or after `pos`), returns the index of the next instance\\n     * * If `s` is not present in the buffer (at or after `pos`), returns type(uint256).max\\n     *\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf[Javascript's `Array.indexOf`]\\n     */\\n    function indexOf(bytes memory buffer, bytes1 s, uint256 pos) internal pure returns (uint256) {\\n        uint256 length = buffer.length;\\n        for (uint256 i = pos; i < length; ++i) {\\n            if (bytes1(_unsafeReadBytesOffset(buffer, i)) == s) {\\n                return i;\\n            }\\n        }\\n        return type(uint256).max;\\n    }\\n\\n    /**\\n     * @dev Backward search for `s` in `buffer`\\n     * * If `s` is present in the buffer, returns the index of the last instance\\n     * * If `s` is not present in the buffer, returns type(uint256).max\\n     *\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf[Javascript's `Array.lastIndexOf`]\\n     */\\n    function lastIndexOf(bytes memory buffer, bytes1 s) internal pure returns (uint256) {\\n        return lastIndexOf(buffer, s, type(uint256).max);\\n    }\\n\\n    /**\\n     * @dev Backward search for `s` in `buffer` starting at position `pos`\\n     * * If `s` is present in the buffer (at or before `pos`), returns the index of the previous instance\\n     * * If `s` is not present in the buffer (at or before `pos`), returns type(uint256).max\\n     *\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf[Javascript's `Array.lastIndexOf`]\\n     */\\n    function lastIndexOf(bytes memory buffer, bytes1 s, uint256 pos) internal pure returns (uint256) {\\n        unchecked {\\n            uint256 length = buffer.length;\\n            for (uint256 i = Math.min(Math.saturatingAdd(pos, 1), length); i > 0; --i) {\\n                if (bytes1(_unsafeReadBytesOffset(buffer, i - 1)) == s) {\\n                    return i - 1;\\n                }\\n            }\\n            return type(uint256).max;\\n        }\\n    }\\n\\n    /**\\n     * @dev Copies the content of `buffer`, from `start` (included) to the end of `buffer` into a new bytes object in\\n     * memory.\\n     *\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\\n     */\\n    function slice(bytes memory buffer, uint256 start) internal pure returns (bytes memory) {\\n        return slice(buffer, start, buffer.length);\\n    }\\n\\n    /**\\n     * @dev Copies the content of `buffer`, from `start` (included) to `end` (excluded) into a new bytes object in\\n     * memory. The `end` argument is truncated to the length of the `buffer`.\\n     *\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\\n     */\\n    function slice(bytes memory buffer, uint256 start, uint256 end) internal pure returns (bytes memory) {\\n        // sanitize\\n        end = Math.min(end, buffer.length);\\n        start = Math.min(start, end);\\n\\n        // allocate and copy\\n        bytes memory result = new bytes(end - start);\\n        assembly (\\\"memory-safe\\\") {\\n            mcopy(add(result, 0x20), add(add(buffer, 0x20), start), sub(end, start))\\n        }\\n\\n        return result;\\n    }\\n\\n    /**\\n     * @dev Moves the content of `buffer`, from `start` (included) to the end of `buffer` to the start of that buffer.\\n     *\\n     * NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]\\n     */\\n    function splice(bytes memory buffer, uint256 start) internal pure returns (bytes memory) {\\n        return splice(buffer, start, buffer.length);\\n    }\\n\\n    /**\\n     * @dev Moves the content of `buffer`, from `start` (included) to end (excluded) to the start of that buffer. The\\n     * `end` argument is truncated to the length of the `buffer`.\\n     *\\n     * NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead\\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]\\n     */\\n    function splice(bytes memory buffer, uint256 start, uint256 end) internal pure returns (bytes memory) {\\n        // sanitize\\n        end = Math.min(end, buffer.length);\\n        start = Math.min(start, end);\\n\\n        // allocate and copy\\n        assembly (\\\"memory-safe\\\") {\\n            mcopy(add(buffer, 0x20), add(add(buffer, 0x20), start), sub(end, start))\\n            mstore(buffer, sub(end, start))\\n        }\\n\\n        return buffer;\\n    }\\n\\n    /**\\n     * @dev Concatenate an array of bytes into a single bytes object.\\n     *\\n     * For fixed bytes types, we recommend using the solidity built-in `bytes.concat` or (equivalent)\\n     * `abi.encodePacked`.\\n     *\\n     * NOTE: this could be done in assembly with a single loop that expands starting at the FMP, but that would be\\n     * significantly less readable. It might be worth benchmarking the savings of the full-assembly approach.\\n     */\\n    function concat(bytes[] memory buffers) internal pure returns (bytes memory) {\\n        uint256 length = 0;\\n        for (uint256 i = 0; i < buffers.length; ++i) {\\n            length += buffers[i].length;\\n        }\\n\\n        bytes memory result = new bytes(length);\\n\\n        uint256 offset = 0x20;\\n        for (uint256 i = 0; i < buffers.length; ++i) {\\n            bytes memory input = buffers[i];\\n            assembly (\\\"memory-safe\\\") {\\n                mcopy(add(result, offset), add(input, 0x20), mload(input))\\n            }\\n            unchecked {\\n                offset += input.length;\\n            }\\n        }\\n\\n        return result;\\n    }\\n\\n    /**\\n     * @dev Returns true if the two byte buffers are equal.\\n     */\\n    function equal(bytes memory a, bytes memory b) internal pure returns (bool) {\\n        return a.length == b.length && keccak256(a) == keccak256(b);\\n    }\\n\\n    /**\\n     * @dev Reverses the byte order of a bytes32 value, converting between little-endian and big-endian.\\n     * Inspired by https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel[Reverse Parallel]\\n     */\\n    function reverseBytes32(bytes32 value) internal pure returns (bytes32) {\\n        value = // swap bytes\\n            ((value >> 8) & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) |\\n            ((value & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\\n        value = // swap 2-byte long pairs\\n            ((value >> 16) & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) |\\n            ((value & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\\n        value = // swap 4-byte long pairs\\n            ((value >> 32) & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) |\\n            ((value & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) << 32);\\n        value = // swap 8-byte long pairs\\n            ((value >> 64) & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) |\\n            ((value & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) << 64);\\n        return (value >> 128) | (value << 128); // swap 16-byte long pairs\\n    }\\n\\n    /// @dev Same as {reverseBytes32} but optimized for 128-bit values.\\n    function reverseBytes16(bytes16 value) internal pure returns (bytes16) {\\n        value = // swap bytes\\n            ((value & 0xFF00FF00FF00FF00FF00FF00FF00FF00) >> 8) |\\n            ((value & 0x00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\\n        value = // swap 2-byte long pairs\\n            ((value & 0xFFFF0000FFFF0000FFFF0000FFFF0000) >> 16) |\\n            ((value & 0x0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\\n        value = // swap 4-byte long pairs\\n            ((value & 0xFFFFFFFF00000000FFFFFFFF00000000) >> 32) |\\n            ((value & 0x00000000FFFFFFFF00000000FFFFFFFF) << 32);\\n        return (value >> 64) | (value << 64); // swap 8-byte long pairs\\n    }\\n\\n    /// @dev Same as {reverseBytes32} but optimized for 64-bit values.\\n    function reverseBytes8(bytes8 value) internal pure returns (bytes8) {\\n        value = ((value & 0xFF00FF00FF00FF00) >> 8) | ((value & 0x00FF00FF00FF00FF) << 8); // swap bytes\\n        value = ((value & 0xFFFF0000FFFF0000) >> 16) | ((value & 0x0000FFFF0000FFFF) << 16); // swap 2-byte long pairs\\n        return (value >> 32) | (value << 32); // swap 4-byte long pairs\\n    }\\n\\n    /// @dev Same as {reverseBytes32} but optimized for 32-bit values.\\n    function reverseBytes4(bytes4 value) internal pure returns (bytes4) {\\n        value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); // swap bytes\\n        return (value >> 16) | (value << 16); // swap 2-byte long pairs\\n    }\\n\\n    /// @dev Same as {reverseBytes32} but optimized for 16-bit values.\\n    function reverseBytes2(bytes2 value) internal pure returns (bytes2) {\\n        return (value >> 8) | (value << 8);\\n    }\\n\\n    /**\\n     * @dev Counts the number of leading zero bits a bytes array. Returns `8 * buffer.length`\\n     * if the buffer is all zeros.\\n     */\\n    function clz(bytes memory buffer) internal pure returns (uint256) {\\n        for (uint256 i = 0; i < buffer.length; i += 0x20) {\\n            bytes32 chunk = _unsafeReadBytesOffset(buffer, i);\\n            if (chunk != bytes32(0)) {\\n                return Math.min(8 * i + Math.clz(uint256(chunk)), 8 * buffer.length);\\n            }\\n        }\\n        return 8 * buffer.length;\\n    }\\n\\n    /**\\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\\n     *\\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\\n     * assembly block as such would prevent some optimizations.\\n     */\\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\\n        assembly (\\\"memory-safe\\\") {\\n            value := mload(add(add(buffer, 0x20), offset))\\n        }\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/Base64.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Base64.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./math/SafeCast.sol\\\";\\n\\n/**\\n * @dev Provides a set of functions to operate with Base64 strings.\\n */\\nlibrary Base64 {\\n    using SafeCast for bool;\\n\\n    error InvalidBase64Char(bytes1);\\n\\n    /**\\n     * @dev Converts a `bytes` to its Base64 `string` representation.\\n     */\\n    function encode(bytes memory data) internal pure returns (string memory) {\\n        return string(_encode(data, false));\\n    }\\n\\n    /**\\n     * @dev Converts a `bytes` to its Base64Url `string` representation.\\n     * Output is not padded with `=` as specified in https://www.rfc-editor.org/rfc/rfc4648[rfc4648].\\n     */\\n    function encodeURL(bytes memory data) internal pure returns (string memory) {\\n        return string(_encode(data, true));\\n    }\\n\\n    /**\\n     * @dev Converts a Base64 `string` to the `bytes` it represents.\\n     *\\n     * * Supports padded and unpadded inputs.\\n     * * Supports both encoding ({encode} and {encodeURL}) seamlessly.\\n     * * Does NOT revert if the input is not a valid Base64 string.\\n     */\\n    function decode(string memory data) internal pure returns (bytes memory) {\\n        return _decode(bytes(data));\\n    }\\n\\n    /**\\n     * @dev Internal table-agnostic encoding\\n     *\\n     * Padding is enabled when using the Base64 table, and disabled when using the Base64Url table.\\n     * See sections 4 and 5 of https://datatracker.ietf.org/doc/html/rfc4648\\n     */\\n    function _encode(bytes memory data, bool urlAndFilenameSafe) private pure returns (bytes memory result) {\\n        /**\\n         * Inspired by Brecht Devos (Brechtpd) implementation - MIT license\\n         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol\\n         */\\n        if (data.length == 0) return \\\"\\\";\\n\\n        // Padding is enabled by default, but disabled when the \\\"urlAndFilenameSafe\\\" alphabet is used\\n        //\\n        // If padding is enabled, the final length should be `bytes` data length divided by 3 rounded up and then\\n        // multiplied by 4 so that it leaves room for padding the last chunk\\n        // - `data.length + 2`  -> Prepare for division rounding up\\n        // - `/ 3`              -> Number of 3-bytes chunks (rounded up)\\n        // - `4 *`              -> 4 characters for each chunk\\n        // This is equivalent to: 4 * Math.ceil(data.length / 3)\\n        //\\n        // If padding is disabled, the final length should be `bytes` data length multiplied by 4/3 rounded up as\\n        // opposed to when padding is required to fill the last chunk.\\n        // - `4 * data.length`  -> 4 characters for each chunk\\n        // - ` + 2`             -> Prepare for division rounding up\\n        // - `/ 3`              -> Number of 3-bytes chunks (rounded up)\\n        // This is equivalent to: Math.ceil((4 * data.length) / 3)\\n        uint256 resultLength = urlAndFilenameSafe ? (4 * data.length + 2) / 3 : 4 * ((data.length + 2) / 3);\\n\\n        assembly (\\\"memory-safe\\\") {\\n            result := mload(0x40)\\n\\n            // Store the encoding table in the scratch space (and fmp ptr) to avoid memory allocation\\n            //\\n            // Base64    (ascii)  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + /\\n            // Base64    (hex)   4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f\\n            // Base64Url (ascii)  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 - _\\n            // Base64Url (hex)   4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f\\n            // xor       (hex)   00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000670\\n            mstore(0x1f, \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef\\\")\\n            mstore(0x3f, xor(\\\"ghijklmnopqrstuvwxyz0123456789+/\\\", mul(urlAndFilenameSafe, 0x670)))\\n\\n            // Prepare result pointer, jump over length\\n            let resultPtr := add(result, 0x20)\\n            let resultEnd := add(resultPtr, resultLength)\\n            let dataPtr := data\\n            let endPtr := add(data, mload(data))\\n\\n            // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and\\n            // set it to zero to make sure no dirty bytes are read in that section.\\n            let afterPtr := add(endPtr, 0x20)\\n            let afterCache := mload(afterPtr)\\n            mstore(afterPtr, 0x00)\\n\\n            // Run over the input, 3 bytes at a time\\n            for {} lt(dataPtr, endPtr) {} {\\n                // Advance 3 bytes\\n                dataPtr := add(dataPtr, 3)\\n                let input := mload(dataPtr)\\n\\n                // To write each character, shift the 3 byte (24 bits) chunk\\n                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)\\n                // and apply logical AND with 0x3F to bitmask the least significant 6 bits.\\n                // Use this as an index into the lookup table, mload an entire word\\n                // so the desired character is in the least significant byte, and\\n                // mstore8 this least significant byte into the result and continue.\\n                mstore8(resultPtr, mload(and(shr(18, input), 0x3F)))\\n                resultPtr := add(resultPtr, 1) // Advance\\n                mstore8(resultPtr, mload(and(shr(12, input), 0x3F)))\\n                resultPtr := add(resultPtr, 1) // Advance\\n                mstore8(resultPtr, mload(and(shr(6, input), 0x3F)))\\n                resultPtr := add(resultPtr, 1) // Advance\\n                mstore8(resultPtr, mload(and(input, 0x3F)))\\n                resultPtr := add(resultPtr, 1) // Advance\\n            }\\n\\n            // Reset the value that was cached\\n            mstore(afterPtr, afterCache)\\n\\n            if iszero(urlAndFilenameSafe) {\\n                // When data `bytes` is not exactly 3 bytes long\\n                // it is padded with `=` characters at the end\\n                switch mod(mload(data), 3)\\n                case 1 {\\n                    mstore8(sub(resultPtr, 1), 0x3d)\\n                    mstore8(sub(resultPtr, 2), 0x3d)\\n                }\\n                case 2 {\\n                    mstore8(sub(resultPtr, 1), 0x3d)\\n                }\\n            }\\n\\n            // Store result length and update FMP to reserve allocated space\\n            mstore(result, resultLength)\\n            mstore(0x40, resultEnd)\\n        }\\n    }\\n\\n    /**\\n     * @dev Internal decoding\\n     */\\n    function _decode(bytes memory data) private pure returns (bytes memory result) {\\n        bytes4 errorSelector = InvalidBase64Char.selector;\\n\\n        uint256 dataLength = data.length;\\n        if (dataLength == 0) return \\\"\\\";\\n\\n        uint256 resultLength = (dataLength / 4) * 3;\\n        if (dataLength % 4 == 0) {\\n            resultLength -= (data[dataLength - 1] == \\\"=\\\").toUint() + (data[dataLength - 2] == \\\"=\\\").toUint();\\n        } else {\\n            resultLength += (dataLength % 4) - 1;\\n        }\\n\\n        assembly (\\\"memory-safe\\\") {\\n            result := mload(0x40)\\n\\n            // Temporarily store the reverse lookup table between in memory. This spans from 0x00 to 0x50, Using:\\n            // - all 64bytes of scratch space\\n            // - part of the FMP (at location 0x40)\\n            mstore(0x30, 0x2425262728292a2b2c2d2e2f30313233)\\n            mstore(0x20, 0x0a0b0c0d0e0f10111213141516171819ffffffff3fff1a1b1c1d1e1f20212223)\\n            mstore(0x00, 0x3eff3eff3f3435363738393a3b3c3dffffff00ffffff00010203040506070809)\\n\\n            // Prepare result pointer, jump over length\\n            let dataPtr := data\\n            let resultPtr := add(result, 0x20)\\n            let endPtr := add(resultPtr, resultLength)\\n\\n            // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and\\n            // set it to \\\"==\\\" (fake padding) to make sure no dirty bytes are read in that section.\\n            let afterPtr := add(add(data, 0x20), dataLength)\\n            let afterCache := mload(afterPtr)\\n            mstore(afterPtr, shl(240, 0x3d3d))\\n\\n            // loop while not everything is decoded\\n            for {} lt(resultPtr, endPtr) {} {\\n                dataPtr := add(dataPtr, 4)\\n\\n                // Read a 4 bytes chunk of data\\n                let input := mload(dataPtr)\\n\\n                // Decode each byte in the chunk as a 6 bit block, and align them to form a block of 3 bytes\\n                let a := sub(byte(28, input), 43)\\n                // slither-disable-next-line incorrect-shift\\n                if iszero(and(shl(a, 1), 0xffffffd0ffffffc47ff5)) {\\n                    mstore(0, errorSelector)\\n                    mstore(4, shl(248, add(a, 43)))\\n                    revert(0, 0x24)\\n                }\\n                let b := sub(byte(29, input), 43)\\n                // slither-disable-next-line incorrect-shift\\n                if iszero(and(shl(b, 1), 0xffffffd0ffffffc47ff5)) {\\n                    mstore(0, errorSelector)\\n                    mstore(4, shl(248, add(b, 43)))\\n                    revert(0, 0x24)\\n                }\\n                let c := sub(byte(30, input), 43)\\n                // slither-disable-next-line incorrect-shift\\n                if iszero(and(shl(c, 1), 0xffffffd0ffffffc47ff5)) {\\n                    mstore(0, errorSelector)\\n                    mstore(4, shl(248, add(c, 43)))\\n                    revert(0, 0x24)\\n                }\\n                let d := sub(byte(31, input), 43)\\n                // slither-disable-next-line incorrect-shift\\n                if iszero(and(shl(d, 1), 0xffffffd0ffffffc47ff5)) {\\n                    mstore(0, errorSelector)\\n                    mstore(4, add(d, 43))\\n                    revert(0, 0x24)\\n                }\\n\\n                mstore(\\n                    resultPtr,\\n                    or(\\n                        or(shl(250, byte(0, mload(a))), shl(244, byte(0, mload(b)))),\\n                        or(shl(238, byte(0, mload(c))), shl(232, byte(0, mload(d))))\\n                    )\\n                )\\n\\n                resultPtr := add(resultPtr, 3)\\n            }\\n\\n            // Reset the value that was cached\\n            mstore(afterPtr, afterCache)\\n\\n            // Store result length and update FMP to reserve allocated space\\n            mstore(result, resultLength)\\n            mstore(0x40, endPtr)\\n        }\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.24;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SafeCast} from \\\"./math/SafeCast.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\nimport {Bytes} from \\\"./Bytes.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n    using SafeCast for *;\\n\\n    bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n    uint8 private constant ADDRESS_LENGTH = 20;\\n    uint256 private constant SPECIAL_CHARS_LOOKUP =\\n        (1 << 0x08) | // backspace\\n            (1 << 0x09) | // tab\\n            (1 << 0x0a) | // newline\\n            (1 << 0x0c) | // form feed\\n            (1 << 0x0d) | // carriage return\\n            (1 << 0x22) | // double quote\\n            (1 << 0x5c); // backslash\\n\\n    /**\\n     * @dev The `value` string doesn't fit in the specified `length`.\\n     */\\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\\n\\n    /**\\n     * @dev The string being parsed contains characters that are not in scope of the given base.\\n     */\\n    error StringsInvalidChar();\\n\\n    /**\\n     * @dev The string being parsed is not a properly formatted address.\\n     */\\n    error StringsInvalidAddressFormat();\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n     */\\n    function toString(uint256 value) internal pure returns (string memory) {\\n        unchecked {\\n            uint256 length = Math.log10(value) + 1;\\n            string memory buffer = new string(length);\\n            uint256 ptr;\\n            assembly (\\\"memory-safe\\\") {\\n                ptr := add(add(buffer, 0x20), length)\\n            }\\n            while (true) {\\n                ptr--;\\n                assembly (\\\"memory-safe\\\") {\\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\n                }\\n                value /= 10;\\n                if (value == 0) break;\\n            }\\n            return buffer;\\n        }\\n    }\\n\\n    /**\\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n     */\\n    function toStringSigned(int256 value) internal pure returns (string memory) {\\n        return string.concat(value < 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value)));\\n    }\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n     */\\n    function toHexString(uint256 value) internal pure returns (string memory) {\\n        unchecked {\\n            return toHexString(value, Math.log256(value) + 1);\\n        }\\n    }\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n     */\\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n        uint256 localValue = value;\\n        bytes memory buffer = new bytes(2 * length + 2);\\n        buffer[0] = \\\"0\\\";\\n        buffer[1] = \\\"x\\\";\\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\\n            buffer[i] = HEX_DIGITS[localValue & 0xf];\\n            localValue >>= 4;\\n        }\\n        if (localValue != 0) {\\n            revert StringsInsufficientHexLength(value, length);\\n        }\\n        return string(buffer);\\n    }\\n\\n    /**\\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\\n     * representation.\\n     */\\n    function toHexString(address addr) internal pure returns (string memory) {\\n        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\\n    }\\n\\n    /**\\n     * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n     * representation, according to EIP-55.\\n     */\\n    function toChecksumHexString(address addr) internal pure returns (string memory) {\\n        bytes memory buffer = bytes(toHexString(addr));\\n\\n        // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n        uint256 hashValue;\\n        assembly (\\\"memory-safe\\\") {\\n            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n        }\\n\\n        for (uint256 i = 41; i > 1; --i) {\\n            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n                // case shift by xoring with 0x20\\n                buffer[i] ^= 0x20;\\n            }\\n            hashValue >>= 4;\\n        }\\n        return string(buffer);\\n    }\\n\\n    /**\\n     * @dev Converts a `bytes` buffer to its ASCII `string` hexadecimal representation.\\n     */\\n    function toHexString(bytes memory input) internal pure returns (string memory) {\\n        unchecked {\\n            bytes memory buffer = new bytes(2 * input.length + 2);\\n            buffer[0] = \\\"0\\\";\\n            buffer[1] = \\\"x\\\";\\n            for (uint256 i = 0; i < input.length; ++i) {\\n                uint8 v = uint8(input[i]);\\n                buffer[2 * i + 2] = HEX_DIGITS[v >> 4];\\n                buffer[2 * i + 3] = HEX_DIGITS[v & 0xf];\\n            }\\n            return string(buffer);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns true if the two strings are equal.\\n     */\\n    function equal(string memory a, string memory b) internal pure returns (bool) {\\n        return Bytes.equal(bytes(a), bytes(b));\\n    }\\n\\n    /**\\n     * @dev Parse a decimal string and returns the value as a `uint256`.\\n     *\\n     * Requirements:\\n     * - The string must be formatted as `[0-9]*`\\n     * - The result must fit into an `uint256` type\\n     */\\n    function parseUint(string memory input) internal pure returns (uint256) {\\n        return parseUint(input, 0, bytes(input).length);\\n    }\\n\\n    /**\\n     * @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and\\n     * `end` (excluded).\\n     *\\n     * Requirements:\\n     * - The substring must be formatted as `[0-9]*`\\n     * - The result must fit into an `uint256` type\\n     */\\n    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\\n        (bool success, uint256 value) = tryParseUint(input, begin, end);\\n        if (!success) revert StringsInvalidChar();\\n        return value;\\n    }\\n\\n    /**\\n     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\\n     *\\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\\n     */\\n    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {\\n        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);\\n    }\\n\\n    /**\\n     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\\n     * character.\\n     *\\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\\n     */\\n    function tryParseUint(\\n        string memory input,\\n        uint256 begin,\\n        uint256 end\\n    ) internal pure returns (bool success, uint256 value) {\\n        if (end > bytes(input).length || begin > end) return (false, 0);\\n        return _tryParseUintUncheckedBounds(input, begin, end);\\n    }\\n\\n    /**\\n     * @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\\n     */\\n    function _tryParseUintUncheckedBounds(\\n        string memory input,\\n        uint256 begin,\\n        uint256 end\\n    ) private pure returns (bool success, uint256 value) {\\n        bytes memory buffer = bytes(input);\\n\\n        uint256 result = 0;\\n        for (uint256 i = begin; i < end; ++i) {\\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\\n            if (chr > 9) return (false, 0);\\n            result *= 10;\\n            result += chr;\\n        }\\n        return (true, result);\\n    }\\n\\n    /**\\n     * @dev Parse a decimal string and returns the value as a `int256`.\\n     *\\n     * Requirements:\\n     * - The string must be formatted as `[-+]?[0-9]*`\\n     * - The result must fit in an `int256` type.\\n     */\\n    function parseInt(string memory input) internal pure returns (int256) {\\n        return parseInt(input, 0, bytes(input).length);\\n    }\\n\\n    /**\\n     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\\n     * `end` (excluded).\\n     *\\n     * Requirements:\\n     * - The substring must be formatted as `[-+]?[0-9]*`\\n     * - The result must fit in an `int256` type.\\n     */\\n    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {\\n        (bool success, int256 value) = tryParseInt(input, begin, end);\\n        if (!success) revert StringsInvalidChar();\\n        return value;\\n    }\\n\\n    /**\\n     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\\n     * the result does not fit in a `int256`.\\n     *\\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\\n     */\\n    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {\\n        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);\\n    }\\n\\n    uint256 private constant ABS_MIN_INT256 = 2 ** 255;\\n\\n    /**\\n     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\\n     * character or if the result does not fit in a `int256`.\\n     *\\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\\n     */\\n    function tryParseInt(\\n        string memory input,\\n        uint256 begin,\\n        uint256 end\\n    ) internal pure returns (bool success, int256 value) {\\n        if (end > bytes(input).length || begin > end) return (false, 0);\\n        return _tryParseIntUncheckedBounds(input, begin, end);\\n    }\\n\\n    /**\\n     * @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that\\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\\n     */\\n    function _tryParseIntUncheckedBounds(\\n        string memory input,\\n        uint256 begin,\\n        uint256 end\\n    ) private pure returns (bool success, int256 value) {\\n        bytes memory buffer = bytes(input);\\n\\n        // Check presence of a negative sign.\\n        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\\n        bool positiveSign = sign == bytes1(\\\"+\\\");\\n        bool negativeSign = sign == bytes1(\\\"-\\\");\\n        uint256 offset = (positiveSign || negativeSign).toUint();\\n\\n        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);\\n\\n        if (absSuccess && absValue < ABS_MIN_INT256) {\\n            return (true, negativeSign ? -int256(absValue) : int256(absValue));\\n        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {\\n            return (true, type(int256).min);\\n        } else return (false, 0);\\n    }\\n\\n    /**\\n     * @dev Parse a hexadecimal string (with or without \\\"0x\\\" prefix), and returns the value as a `uint256`.\\n     *\\n     * Requirements:\\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`\\n     * - The result must fit in an `uint256` type.\\n     */\\n    function parseHexUint(string memory input) internal pure returns (uint256) {\\n        return parseHexUint(input, 0, bytes(input).length);\\n    }\\n\\n    /**\\n     * @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and\\n     * `end` (excluded).\\n     *\\n     * Requirements:\\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\\n     * - The result must fit in an `uint256` type.\\n     */\\n    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\\n        (bool success, uint256 value) = tryParseHexUint(input, begin, end);\\n        if (!success) revert StringsInvalidChar();\\n        return value;\\n    }\\n\\n    /**\\n     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\\n     *\\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\\n     */\\n    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {\\n        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);\\n    }\\n\\n    /**\\n     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\\n     * invalid character.\\n     *\\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\\n     */\\n    function tryParseHexUint(\\n        string memory input,\\n        uint256 begin,\\n        uint256 end\\n    ) internal pure returns (bool success, uint256 value) {\\n        if (end > bytes(input).length || begin > end) return (false, 0);\\n        return _tryParseHexUintUncheckedBounds(input, begin, end);\\n    }\\n\\n    /**\\n     * @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\\n     */\\n    function _tryParseHexUintUncheckedBounds(\\n        string memory input,\\n        uint256 begin,\\n        uint256 end\\n    ) private pure returns (bool success, uint256 value) {\\n        bytes memory buffer = bytes(input);\\n\\n        // skip 0x prefix if present\\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2(\\\"0x\\\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\\n        uint256 offset = hasPrefix.toUint() * 2;\\n\\n        uint256 result = 0;\\n        for (uint256 i = begin + offset; i < end; ++i) {\\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\\n            if (chr > 15) return (false, 0);\\n            result *= 16;\\n            unchecked {\\n                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).\\n                // This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.\\n                result += chr;\\n            }\\n        }\\n        return (true, result);\\n    }\\n\\n    /**\\n     * @dev Parse a hexadecimal string (with or without \\\"0x\\\" prefix), and returns the value as an `address`.\\n     *\\n     * Requirements:\\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`\\n     */\\n    function parseAddress(string memory input) internal pure returns (address) {\\n        return parseAddress(input, 0, bytes(input).length);\\n    }\\n\\n    /**\\n     * @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and\\n     * `end` (excluded).\\n     *\\n     * Requirements:\\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`\\n     */\\n    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {\\n        (bool success, address value) = tryParseAddress(input, begin, end);\\n        if (!success) revert StringsInvalidAddressFormat();\\n        return value;\\n    }\\n\\n    /**\\n     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\\n     * formatted address. See {parseAddress-string} requirements.\\n     */\\n    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {\\n        return tryParseAddress(input, 0, bytes(input).length);\\n    }\\n\\n    /**\\n     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\\n     * formatted address. See {parseAddress-string-uint256-uint256} requirements.\\n     */\\n    function tryParseAddress(\\n        string memory input,\\n        uint256 begin,\\n        uint256 end\\n    ) internal pure returns (bool success, address value) {\\n        if (end > bytes(input).length || begin > end) return (false, address(0));\\n\\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2(\\\"0x\\\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\\n        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;\\n\\n        // check that input is the correct length\\n        if (end - begin == expectedLength) {\\n            // length guarantees that this does not overflow, and value is at most type(uint160).max\\n            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);\\n            return (s, address(uint160(v)));\\n        } else {\\n            return (false, address(0));\\n        }\\n    }\\n\\n    function _tryParseChr(bytes1 chr) private pure returns (uint8) {\\n        uint8 value = uint8(chr);\\n\\n        // Try to parse `chr`:\\n        // - Case 1: [0-9]\\n        // - Case 2: [a-f]\\n        // - Case 3: [A-F]\\n        // - otherwise not supported\\n        unchecked {\\n            if (value > 47 && value < 58) value -= 48;\\n            else if (value > 96 && value < 103) value -= 87;\\n            else if (value > 64 && value < 71) value -= 55;\\n            else return type(uint8).max;\\n        }\\n\\n        return value;\\n    }\\n\\n    /**\\n     * @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.\\n     *\\n     * WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.\\n     *\\n     * NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of\\n     * RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode\\n     * characters that are not in this range, but other tooling may provide different results.\\n     */\\n    function escapeJSON(string memory input) internal pure returns (string memory) {\\n        bytes memory buffer = bytes(input);\\n        bytes memory output = new bytes(2 * buffer.length); // worst case scenario\\n        uint256 outputLength = 0;\\n\\n        for (uint256 i = 0; i < buffer.length; ++i) {\\n            bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));\\n            if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {\\n                output[outputLength++] = \\\"\\\\\\\\\\\";\\n                if (char == 0x08) output[outputLength++] = \\\"b\\\";\\n                else if (char == 0x09) output[outputLength++] = \\\"t\\\";\\n                else if (char == 0x0a) output[outputLength++] = \\\"n\\\";\\n                else if (char == 0x0c) output[outputLength++] = \\\"f\\\";\\n                else if (char == 0x0d) output[outputLength++] = \\\"r\\\";\\n                else if (char == 0x5c) output[outputLength++] = \\\"\\\\\\\\\\\";\\n                else if (char == 0x22) {\\n                    // solhint-disable-next-line quotes\\n                    output[outputLength++] = '\\\"';\\n                }\\n            } else {\\n                output[outputLength++] = char;\\n            }\\n        }\\n        // write the actual length and deallocate unused memory\\n        assembly (\\\"memory-safe\\\") {\\n            mstore(output, outputLength)\\n            mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))\\n        }\\n\\n        return string(output);\\n    }\\n\\n    /**\\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\\n     *\\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\\n     * assembly block as such would prevent some optimizations.\\n     */\\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\\n        assembly (\\\"memory-safe\\\") {\\n            value := mload(add(add(buffer, 0x20), offset))\\n        }\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n    enum Rounding {\\n        Floor, // Toward negative infinity\\n        Ceil, // Toward positive infinity\\n        Trunc, // Toward zero\\n        Expand // Away from zero\\n    }\\n\\n    /**\\n     * @dev Return the 512-bit addition of two uint256.\\n     *\\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\\n     */\\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\\n        assembly (\\\"memory-safe\\\") {\\n            low := add(a, b)\\n            high := lt(low, a)\\n        }\\n    }\\n\\n    /**\\n     * @dev Return the 512-bit multiplication of two uint256.\\n     *\\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\\n     */\\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\\n        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\\n        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n        // variables such that product = high * 2²⁵⁶ + low.\\n        assembly (\\\"memory-safe\\\") {\\n            let mm := mulmod(a, b, not(0))\\n            low := mul(a, b)\\n            high := sub(sub(mm, low), lt(mm, low))\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\\n     */\\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n        unchecked {\\n            uint256 c = a + b;\\n            success = c >= a;\\n            result = c * SafeCast.toUint(success);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\\n     */\\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n        unchecked {\\n            uint256 c = a - b;\\n            success = c <= a;\\n            result = c * SafeCast.toUint(success);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\\n     */\\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n        unchecked {\\n            uint256 c = a * b;\\n            assembly (\\\"memory-safe\\\") {\\n                // Only true when the multiplication doesn't overflow\\n                // (c / a == b) || (a == 0)\\n                success := or(eq(div(c, a), b), iszero(a))\\n            }\\n            // equivalent to: success ? c : 0\\n            result = c * SafeCast.toUint(success);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n     */\\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n        unchecked {\\n            success = b > 0;\\n            assembly (\\\"memory-safe\\\") {\\n                // The `DIV` opcode returns zero when the denominator is 0.\\n                result := div(a, b)\\n            }\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n     */\\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n        unchecked {\\n            success = b > 0;\\n            assembly (\\\"memory-safe\\\") {\\n                // The `MOD` opcode returns zero when the denominator is 0.\\n                result := mod(a, b)\\n            }\\n        }\\n    }\\n\\n    /**\\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\\n     */\\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\\n        (bool success, uint256 result) = tryAdd(a, b);\\n        return ternary(success, result, type(uint256).max);\\n    }\\n\\n    /**\\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\\n     */\\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\\n        (, uint256 result) = trySub(a, b);\\n        return result;\\n    }\\n\\n    /**\\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\\n     */\\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\\n        (bool success, uint256 result) = tryMul(a, b);\\n        return ternary(success, result, type(uint256).max);\\n    }\\n\\n    /**\\n     * @dev Branchless ternary evaluation for `condition ? a : b`. Gas costs are constant.\\n     *\\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n     * However, the compiler may optimize Solidity ternary operations (i.e. `condition ? a : b`) to only compute\\n     * one branch when needed, making this function more expensive.\\n     */\\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n        unchecked {\\n            // branchless ternary works because:\\n            // b ^ (a ^ b) == a\\n            // b ^ 0 == b\\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the largest of two numbers.\\n     */\\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return ternary(a > b, a, b);\\n    }\\n\\n    /**\\n     * @dev Returns the smallest of two numbers.\\n     */\\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return ternary(a < b, a, b);\\n    }\\n\\n    /**\\n     * @dev Returns the average of two numbers. The result is rounded towards\\n     * zero.\\n     */\\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n        // (a + b) / 2 can overflow.\\n        return (a & b) + (a ^ b) / 2;\\n    }\\n\\n    /**\\n     * @dev Returns the ceiling of the division of two numbers.\\n     *\\n     * This differs from standard division with `/` in that it rounds towards infinity instead\\n     * of rounding towards zero.\\n     */\\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n        if (b == 0) {\\n            // Guarantee the same behavior as in a regular Solidity division.\\n            Panic.panic(Panic.DIVISION_BY_ZERO);\\n        }\\n\\n        // The following calculation ensures accurate ceiling division without overflow.\\n        // Since a is non-zero, (a - 1) / b will not overflow.\\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\\n        // when a = type(uint256).max and b = 1.\\n        unchecked {\\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n        }\\n    }\\n\\n    /**\\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n     * denominator == 0.\\n     *\\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n     * Uniswap Labs also under MIT license.\\n     */\\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n        unchecked {\\n            (uint256 high, uint256 low) = mul512(x, y);\\n\\n            // Handle non-overflow cases, 256 by 256 division.\\n            if (high == 0) {\\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n                // The surrounding unchecked block does not change this fact.\\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n                return low / denominator;\\n            }\\n\\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\\n            if (denominator <= high) {\\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n            }\\n\\n            ///////////////////////////////////////////////\\n            // 512 by 256 division.\\n            ///////////////////////////////////////////////\\n\\n            // Make division exact by subtracting the remainder from [high low].\\n            uint256 remainder;\\n            assembly (\\\"memory-safe\\\") {\\n                // Compute remainder using mulmod.\\n                remainder := mulmod(x, y, denominator)\\n\\n                // Subtract 256 bit number from 512 bit number.\\n                high := sub(high, gt(remainder, low))\\n                low := sub(low, remainder)\\n            }\\n\\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n            uint256 twos = denominator & (0 - denominator);\\n            assembly (\\\"memory-safe\\\") {\\n                // Divide denominator by twos.\\n                denominator := div(denominator, twos)\\n\\n                // Divide [high low] by twos.\\n                low := div(low, twos)\\n\\n                // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\\n                twos := add(div(sub(0, twos), twos), 1)\\n            }\\n\\n            // Shift in bits from high into low.\\n            low |= high * twos;\\n\\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\\n            uint256 inverse = (3 * denominator) ^ 2;\\n\\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n            // works in modular arithmetic, doubling the correct bits in each step.\\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\\n\\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n            // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\\n            // is no longer required.\\n            result = low * inverse;\\n            return result;\\n        }\\n    }\\n\\n    /**\\n     * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n     */\\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n    }\\n\\n    /**\\n     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\\n     */\\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\\n        unchecked {\\n            (uint256 high, uint256 low) = mul512(x, y);\\n            if (high >= 1 << n) {\\n                Panic.panic(Panic.UNDER_OVERFLOW);\\n            }\\n            return (high << (256 - n)) | (low >> n);\\n        }\\n    }\\n\\n    /**\\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\\n     */\\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\\n    }\\n\\n    /**\\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n     *\\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n     *\\n     * If the input value is not inversible, 0 is returned.\\n     *\\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n     */\\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n        unchecked {\\n            if (n == 0) return 0;\\n\\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n            // ax + ny = 1\\n            // ax = 1 + (-y)n\\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\\n\\n            // If the remainder is 0 the gcd is n right away.\\n            uint256 remainder = a % n;\\n            uint256 gcd = n;\\n\\n            // Therefore the initial coefficients are:\\n            // ax + ny = gcd(a, n) = n\\n            // 0a + 1n = n\\n            int256 x = 0;\\n            int256 y = 1;\\n\\n            while (remainder != 0) {\\n                uint256 quotient = gcd / remainder;\\n\\n                (gcd, remainder) = (\\n                    // The old remainder is the next gcd to try.\\n                    remainder,\\n                    // Compute the next remainder.\\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n                    // where gcd is at most n (capped to type(uint256).max)\\n                    gcd - remainder * quotient\\n                );\\n\\n                (x, y) = (\\n                    // Increment the coefficient of a.\\n                    y,\\n                    // Decrement the coefficient of n.\\n                    // Can overflow, but the result is casted to uint256 so that the\\n                    // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n                    x - y * int256(quotient)\\n                );\\n            }\\n\\n            if (gcd != 1) return 0; // No inverse exists.\\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n        }\\n    }\\n\\n    /**\\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n     *\\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n     *\\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n     */\\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n        unchecked {\\n            return Math.modExp(a, p - 2, p);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n     *\\n     * Requirements:\\n     * - modulus can't be zero\\n     * - underlying staticcall to precompile must succeed\\n     *\\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n     * interpreted as 0.\\n     */\\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n        (bool success, uint256 result) = tryModExp(b, e, m);\\n        if (!success) {\\n            Panic.panic(Panic.DIVISION_BY_ZERO);\\n        }\\n        return result;\\n    }\\n\\n    /**\\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n     * to operate modulo 0 or if the underlying precompile reverted.\\n     *\\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n     * of a revert, but the result may be incorrectly interpreted as 0.\\n     */\\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n        if (m == 0) return (false, 0);\\n        assembly (\\\"memory-safe\\\") {\\n            let ptr := mload(0x40)\\n            // | Offset    | Content    | Content (Hex)                                                      |\\n            // |-----------|------------|--------------------------------------------------------------------|\\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n            mstore(ptr, 0x20)\\n            mstore(add(ptr, 0x20), 0x20)\\n            mstore(add(ptr, 0x40), 0x20)\\n            mstore(add(ptr, 0x60), b)\\n            mstore(add(ptr, 0x80), e)\\n            mstore(add(ptr, 0xa0), m)\\n\\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\\n            // so we can use the memory scratch space located at offset 0.\\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n            result := mload(0x00)\\n        }\\n    }\\n\\n    /**\\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n     */\\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n        (bool success, bytes memory result) = tryModExp(b, e, m);\\n        if (!success) {\\n            Panic.panic(Panic.DIVISION_BY_ZERO);\\n        }\\n        return result;\\n    }\\n\\n    /**\\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n     */\\n    function tryModExp(\\n        bytes memory b,\\n        bytes memory e,\\n        bytes memory m\\n    ) internal view returns (bool success, bytes memory result) {\\n        if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n        uint256 mLen = m.length;\\n\\n        // Encode call args in result and move the free memory pointer\\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n        assembly (\\\"memory-safe\\\") {\\n            let dataPtr := add(result, 0x20)\\n            // Write result on top of args to avoid allocating extra memory.\\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n            // Overwrite the length.\\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n            mstore(result, mLen)\\n            // Set the memory pointer after the returned data.\\n            mstore(0x40, add(dataPtr, mLen))\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns whether the provided byte array is zero.\\n     */\\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n        for (uint256 i = 0; i < byteArray.length; ++i) {\\n            if (byteArray[i] != 0) {\\n                return false;\\n            }\\n        }\\n        return true;\\n    }\\n\\n    /**\\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n     * towards zero.\\n     *\\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n     * using integer operations.\\n     */\\n    function sqrt(uint256 a) internal pure returns (uint256) {\\n        unchecked {\\n            // Take care of easy edge cases when a == 0 or a == 1\\n            if (a <= 1) {\\n                return a;\\n            }\\n\\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\\n            //\\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\\n            // bigger than any uint256.\\n            //\\n            // By noticing that\\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n            // to the msb function.\\n            uint256 aa = a;\\n            uint256 xn = 1;\\n\\n            if (aa >= (1 << 128)) {\\n                aa >>= 128;\\n                xn <<= 64;\\n            }\\n            if (aa >= (1 << 64)) {\\n                aa >>= 64;\\n                xn <<= 32;\\n            }\\n            if (aa >= (1 << 32)) {\\n                aa >>= 32;\\n                xn <<= 16;\\n            }\\n            if (aa >= (1 << 16)) {\\n                aa >>= 16;\\n                xn <<= 8;\\n            }\\n            if (aa >= (1 << 8)) {\\n                aa >>= 8;\\n                xn <<= 4;\\n            }\\n            if (aa >= (1 << 4)) {\\n                aa >>= 4;\\n                xn <<= 2;\\n            }\\n            if (aa >= (1 << 2)) {\\n                xn <<= 1;\\n            }\\n\\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\\n            //\\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\\n            // This is going to be our x_0 (and ε_0)\\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\\n\\n            // From here, Newton's method give us:\\n            // x_{n+1} = (x_n + a / x_n) / 2\\n            //\\n            // One should note that:\\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\\n            //              = ((x_n² + a) / (2 * x_n))² - a\\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\\n            //              = (x_n² - a)² / (2 * x_n)²\\n            //              = ((x_n² - a) / (2 * x_n))²\\n            //              ≥ 0\\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\\n            //\\n            // This gives us the proof of quadratic convergence of the sequence:\\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\\n            //         = | ε_n² / (2 * x_n) |\\n            //         = ε_n² / | (2 * x_n) |\\n            //\\n            // For the first iteration, we have a special case where x_0 is known:\\n            // ε_1 = ε_0² / | (2 * x_0) |\\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\\n            //     ≤ 2**(e-3) / 3\\n            //     ≤ 2**(e-3-log2(3))\\n            //     ≤ 2**(e-4.5)\\n            //\\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\\n            //         ≤ 2**(2*e-2*k) / 2**e\\n            //         ≤ 2**(e-2*k)\\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\\n\\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n            // sqrt(a) or sqrt(a) + 1.\\n            return xn - SafeCast.toUint(xn > a / xn);\\n        }\\n    }\\n\\n    /**\\n     * @dev Calculates sqrt(a), following the selected rounding direction.\\n     */\\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n        unchecked {\\n            uint256 result = sqrt(a);\\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n        }\\n    }\\n\\n    /**\\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\\n     * Returns 0 if given 0.\\n     */\\n    function log2(uint256 x) internal pure returns (uint256 r) {\\n        // If value has upper 128 bits set, log2 result is at least 128\\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\\n        // If upper 64 bits of 128-bit half set, add 64 to result\\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\\n        // If upper 32 bits of 64-bit half set, add 32 to result\\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\\n        // If upper 16 bits of 32-bit half set, add 16 to result\\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\\n        // If upper 8 bits of 16-bit half set, add 8 to result\\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\\n        // If upper 4 bits of 8-bit half set, add 4 to result\\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\\n\\n        // Shifts value right by the current result and use it as an index into this lookup table:\\n        //\\n        // | x (4 bits) |  index  | table[index] = MSB position |\\n        // |------------|---------|-----------------------------|\\n        // |    0000    |    0    |        table[0] = 0         |\\n        // |    0001    |    1    |        table[1] = 0         |\\n        // |    0010    |    2    |        table[2] = 1         |\\n        // |    0011    |    3    |        table[3] = 1         |\\n        // |    0100    |    4    |        table[4] = 2         |\\n        // |    0101    |    5    |        table[5] = 2         |\\n        // |    0110    |    6    |        table[6] = 2         |\\n        // |    0111    |    7    |        table[7] = 2         |\\n        // |    1000    |    8    |        table[8] = 3         |\\n        // |    1001    |    9    |        table[9] = 3         |\\n        // |    1010    |   10    |        table[10] = 3        |\\n        // |    1011    |   11    |        table[11] = 3        |\\n        // |    1100    |   12    |        table[12] = 3        |\\n        // |    1101    |   13    |        table[13] = 3        |\\n        // |    1110    |   14    |        table[14] = 3        |\\n        // |    1111    |   15    |        table[15] = 3        |\\n        //\\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\\n        assembly (\\\"memory-safe\\\") {\\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\\n        }\\n    }\\n\\n    /**\\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n     * Returns 0 if given 0.\\n     */\\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n        unchecked {\\n            uint256 result = log2(value);\\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\\n     * Returns 0 if given 0.\\n     */\\n    function log10(uint256 value) internal pure returns (uint256) {\\n        uint256 result = 0;\\n        unchecked {\\n            if (value >= 10 ** 64) {\\n                value /= 10 ** 64;\\n                result += 64;\\n            }\\n            if (value >= 10 ** 32) {\\n                value /= 10 ** 32;\\n                result += 32;\\n            }\\n            if (value >= 10 ** 16) {\\n                value /= 10 ** 16;\\n                result += 16;\\n            }\\n            if (value >= 10 ** 8) {\\n                value /= 10 ** 8;\\n                result += 8;\\n            }\\n            if (value >= 10 ** 4) {\\n                value /= 10 ** 4;\\n                result += 4;\\n            }\\n            if (value >= 10 ** 2) {\\n                value /= 10 ** 2;\\n                result += 2;\\n            }\\n            if (value >= 10 ** 1) {\\n                result += 1;\\n            }\\n        }\\n        return result;\\n    }\\n\\n    /**\\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n     * Returns 0 if given 0.\\n     */\\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n        unchecked {\\n            uint256 result = log10(value);\\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\\n     * Returns 0 if given 0.\\n     *\\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n     */\\n    function log256(uint256 x) internal pure returns (uint256 r) {\\n        // If value has upper 128 bits set, log2 result is at least 128\\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\\n        // If upper 64 bits of 128-bit half set, add 64 to result\\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\\n        // If upper 32 bits of 64-bit half set, add 32 to result\\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\\n        // If upper 16 bits of 32-bit half set, add 16 to result\\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\\n    }\\n\\n    /**\\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n     * Returns 0 if given 0.\\n     */\\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n        unchecked {\\n            uint256 result = log256(value);\\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n     */\\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n        return uint8(rounding) % 2 == 1;\\n    }\\n\\n    /**\\n     * @dev Counts the number of leading zero bits in a uint256.\\n     */\\n    function clz(uint256 x) internal pure returns (uint256) {\\n        return ternary(x == 0, 256, 255 - log2(x));\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n    /**\\n     * @dev The ETH balance of the account is not enough to perform the operation.\\n     */\\n    error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n    /**\\n     * @dev A call to an address target failed. The target may have reverted.\\n     */\\n    error FailedCall();\\n\\n    /**\\n     * @dev The deployment failed.\\n     */\\n    error FailedDeployment();\\n\\n    /**\\n     * @dev A necessary precompile is missing.\\n     */\\n    error MissingPrecompile(address);\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity >=0.4.16;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n    /**\\n     * @dev Returns true if this contract implements the interface defined by\\n     * `interfaceId`. See the corresponding\\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n     * to learn more about how these ids are created.\\n     *\\n     * This function call must use less than 30 000 gas.\\n     */\\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n    /**\\n     * @dev Value doesn't fit in an uint of `bits` size.\\n     */\\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n    /**\\n     * @dev An int value doesn't fit in an uint of `bits` size.\\n     */\\n    error SafeCastOverflowedIntToUint(int256 value);\\n\\n    /**\\n     * @dev Value doesn't fit in an int of `bits` size.\\n     */\\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n    /**\\n     * @dev An uint value doesn't fit in an int of `bits` size.\\n     */\\n    error SafeCastOverflowedUintToInt(uint256 value);\\n\\n    /**\\n     * @dev Returns the downcasted uint248 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint248).\\n     *\\n     * Counterpart to Solidity's `uint248` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 248 bits\\n     */\\n    function toUint248(uint256 value) internal pure returns (uint248) {\\n        if (value > type(uint248).max) {\\n            revert SafeCastOverflowedUintDowncast(248, value);\\n        }\\n        return uint248(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint240 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint240).\\n     *\\n     * Counterpart to Solidity's `uint240` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 240 bits\\n     */\\n    function toUint240(uint256 value) internal pure returns (uint240) {\\n        if (value > type(uint240).max) {\\n            revert SafeCastOverflowedUintDowncast(240, value);\\n        }\\n        return uint240(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint232 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint232).\\n     *\\n     * Counterpart to Solidity's `uint232` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 232 bits\\n     */\\n    function toUint232(uint256 value) internal pure returns (uint232) {\\n        if (value > type(uint232).max) {\\n            revert SafeCastOverflowedUintDowncast(232, value);\\n        }\\n        return uint232(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint224 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint224).\\n     *\\n     * Counterpart to Solidity's `uint224` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 224 bits\\n     */\\n    function toUint224(uint256 value) internal pure returns (uint224) {\\n        if (value > type(uint224).max) {\\n            revert SafeCastOverflowedUintDowncast(224, value);\\n        }\\n        return uint224(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint216 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint216).\\n     *\\n     * Counterpart to Solidity's `uint216` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 216 bits\\n     */\\n    function toUint216(uint256 value) internal pure returns (uint216) {\\n        if (value > type(uint216).max) {\\n            revert SafeCastOverflowedUintDowncast(216, value);\\n        }\\n        return uint216(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint208 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint208).\\n     *\\n     * Counterpart to Solidity's `uint208` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 208 bits\\n     */\\n    function toUint208(uint256 value) internal pure returns (uint208) {\\n        if (value > type(uint208).max) {\\n            revert SafeCastOverflowedUintDowncast(208, value);\\n        }\\n        return uint208(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint200 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint200).\\n     *\\n     * Counterpart to Solidity's `uint200` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 200 bits\\n     */\\n    function toUint200(uint256 value) internal pure returns (uint200) {\\n        if (value > type(uint200).max) {\\n            revert SafeCastOverflowedUintDowncast(200, value);\\n        }\\n        return uint200(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint192 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint192).\\n     *\\n     * Counterpart to Solidity's `uint192` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 192 bits\\n     */\\n    function toUint192(uint256 value) internal pure returns (uint192) {\\n        if (value > type(uint192).max) {\\n            revert SafeCastOverflowedUintDowncast(192, value);\\n        }\\n        return uint192(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint184 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint184).\\n     *\\n     * Counterpart to Solidity's `uint184` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 184 bits\\n     */\\n    function toUint184(uint256 value) internal pure returns (uint184) {\\n        if (value > type(uint184).max) {\\n            revert SafeCastOverflowedUintDowncast(184, value);\\n        }\\n        return uint184(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint176 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint176).\\n     *\\n     * Counterpart to Solidity's `uint176` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 176 bits\\n     */\\n    function toUint176(uint256 value) internal pure returns (uint176) {\\n        if (value > type(uint176).max) {\\n            revert SafeCastOverflowedUintDowncast(176, value);\\n        }\\n        return uint176(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint168 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint168).\\n     *\\n     * Counterpart to Solidity's `uint168` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 168 bits\\n     */\\n    function toUint168(uint256 value) internal pure returns (uint168) {\\n        if (value > type(uint168).max) {\\n            revert SafeCastOverflowedUintDowncast(168, value);\\n        }\\n        return uint168(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint160 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint160).\\n     *\\n     * Counterpart to Solidity's `uint160` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 160 bits\\n     */\\n    function toUint160(uint256 value) internal pure returns (uint160) {\\n        if (value > type(uint160).max) {\\n            revert SafeCastOverflowedUintDowncast(160, value);\\n        }\\n        return uint160(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint152 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint152).\\n     *\\n     * Counterpart to Solidity's `uint152` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 152 bits\\n     */\\n    function toUint152(uint256 value) internal pure returns (uint152) {\\n        if (value > type(uint152).max) {\\n            revert SafeCastOverflowedUintDowncast(152, value);\\n        }\\n        return uint152(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint144 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint144).\\n     *\\n     * Counterpart to Solidity's `uint144` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 144 bits\\n     */\\n    function toUint144(uint256 value) internal pure returns (uint144) {\\n        if (value > type(uint144).max) {\\n            revert SafeCastOverflowedUintDowncast(144, value);\\n        }\\n        return uint144(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint136 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint136).\\n     *\\n     * Counterpart to Solidity's `uint136` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 136 bits\\n     */\\n    function toUint136(uint256 value) internal pure returns (uint136) {\\n        if (value > type(uint136).max) {\\n            revert SafeCastOverflowedUintDowncast(136, value);\\n        }\\n        return uint136(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint128 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint128).\\n     *\\n     * Counterpart to Solidity's `uint128` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 128 bits\\n     */\\n    function toUint128(uint256 value) internal pure returns (uint128) {\\n        if (value > type(uint128).max) {\\n            revert SafeCastOverflowedUintDowncast(128, value);\\n        }\\n        return uint128(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint120 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint120).\\n     *\\n     * Counterpart to Solidity's `uint120` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 120 bits\\n     */\\n    function toUint120(uint256 value) internal pure returns (uint120) {\\n        if (value > type(uint120).max) {\\n            revert SafeCastOverflowedUintDowncast(120, value);\\n        }\\n        return uint120(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint112 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint112).\\n     *\\n     * Counterpart to Solidity's `uint112` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 112 bits\\n     */\\n    function toUint112(uint256 value) internal pure returns (uint112) {\\n        if (value > type(uint112).max) {\\n            revert SafeCastOverflowedUintDowncast(112, value);\\n        }\\n        return uint112(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint104 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint104).\\n     *\\n     * Counterpart to Solidity's `uint104` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 104 bits\\n     */\\n    function toUint104(uint256 value) internal pure returns (uint104) {\\n        if (value > type(uint104).max) {\\n            revert SafeCastOverflowedUintDowncast(104, value);\\n        }\\n        return uint104(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint96 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint96).\\n     *\\n     * Counterpart to Solidity's `uint96` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 96 bits\\n     */\\n    function toUint96(uint256 value) internal pure returns (uint96) {\\n        if (value > type(uint96).max) {\\n            revert SafeCastOverflowedUintDowncast(96, value);\\n        }\\n        return uint96(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint88 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint88).\\n     *\\n     * Counterpart to Solidity's `uint88` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 88 bits\\n     */\\n    function toUint88(uint256 value) internal pure returns (uint88) {\\n        if (value > type(uint88).max) {\\n            revert SafeCastOverflowedUintDowncast(88, value);\\n        }\\n        return uint88(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint80 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint80).\\n     *\\n     * Counterpart to Solidity's `uint80` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 80 bits\\n     */\\n    function toUint80(uint256 value) internal pure returns (uint80) {\\n        if (value > type(uint80).max) {\\n            revert SafeCastOverflowedUintDowncast(80, value);\\n        }\\n        return uint80(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint72 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint72).\\n     *\\n     * Counterpart to Solidity's `uint72` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 72 bits\\n     */\\n    function toUint72(uint256 value) internal pure returns (uint72) {\\n        if (value > type(uint72).max) {\\n            revert SafeCastOverflowedUintDowncast(72, value);\\n        }\\n        return uint72(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint64 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint64).\\n     *\\n     * Counterpart to Solidity's `uint64` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 64 bits\\n     */\\n    function toUint64(uint256 value) internal pure returns (uint64) {\\n        if (value > type(uint64).max) {\\n            revert SafeCastOverflowedUintDowncast(64, value);\\n        }\\n        return uint64(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint56 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint56).\\n     *\\n     * Counterpart to Solidity's `uint56` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 56 bits\\n     */\\n    function toUint56(uint256 value) internal pure returns (uint56) {\\n        if (value > type(uint56).max) {\\n            revert SafeCastOverflowedUintDowncast(56, value);\\n        }\\n        return uint56(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint48 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint48).\\n     *\\n     * Counterpart to Solidity's `uint48` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 48 bits\\n     */\\n    function toUint48(uint256 value) internal pure returns (uint48) {\\n        if (value > type(uint48).max) {\\n            revert SafeCastOverflowedUintDowncast(48, value);\\n        }\\n        return uint48(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint40 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint40).\\n     *\\n     * Counterpart to Solidity's `uint40` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 40 bits\\n     */\\n    function toUint40(uint256 value) internal pure returns (uint40) {\\n        if (value > type(uint40).max) {\\n            revert SafeCastOverflowedUintDowncast(40, value);\\n        }\\n        return uint40(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint32 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint32).\\n     *\\n     * Counterpart to Solidity's `uint32` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 32 bits\\n     */\\n    function toUint32(uint256 value) internal pure returns (uint32) {\\n        if (value > type(uint32).max) {\\n            revert SafeCastOverflowedUintDowncast(32, value);\\n        }\\n        return uint32(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint24 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint24).\\n     *\\n     * Counterpart to Solidity's `uint24` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 24 bits\\n     */\\n    function toUint24(uint256 value) internal pure returns (uint24) {\\n        if (value > type(uint24).max) {\\n            revert SafeCastOverflowedUintDowncast(24, value);\\n        }\\n        return uint24(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint16 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint16).\\n     *\\n     * Counterpart to Solidity's `uint16` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 16 bits\\n     */\\n    function toUint16(uint256 value) internal pure returns (uint16) {\\n        if (value > type(uint16).max) {\\n            revert SafeCastOverflowedUintDowncast(16, value);\\n        }\\n        return uint16(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint8 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint8).\\n     *\\n     * Counterpart to Solidity's `uint8` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 8 bits\\n     */\\n    function toUint8(uint256 value) internal pure returns (uint8) {\\n        if (value > type(uint8).max) {\\n            revert SafeCastOverflowedUintDowncast(8, value);\\n        }\\n        return uint8(value);\\n    }\\n\\n    /**\\n     * @dev Converts a signed int256 into an unsigned uint256.\\n     *\\n     * Requirements:\\n     *\\n     * - input must be greater than or equal to 0.\\n     */\\n    function toUint256(int256 value) internal pure returns (uint256) {\\n        if (value < 0) {\\n            revert SafeCastOverflowedIntToUint(value);\\n        }\\n        return uint256(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int248 from int256, reverting on\\n     * overflow (when the input is less than smallest int248 or\\n     * greater than largest int248).\\n     *\\n     * Counterpart to Solidity's `int248` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 248 bits\\n     */\\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n        downcasted = int248(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(248, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int240 from int256, reverting on\\n     * overflow (when the input is less than smallest int240 or\\n     * greater than largest int240).\\n     *\\n     * Counterpart to Solidity's `int240` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 240 bits\\n     */\\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n        downcasted = int240(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(240, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int232 from int256, reverting on\\n     * overflow (when the input is less than smallest int232 or\\n     * greater than largest int232).\\n     *\\n     * Counterpart to Solidity's `int232` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 232 bits\\n     */\\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n        downcasted = int232(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(232, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int224 from int256, reverting on\\n     * overflow (when the input is less than smallest int224 or\\n     * greater than largest int224).\\n     *\\n     * Counterpart to Solidity's `int224` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 224 bits\\n     */\\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n        downcasted = int224(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(224, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int216 from int256, reverting on\\n     * overflow (when the input is less than smallest int216 or\\n     * greater than largest int216).\\n     *\\n     * Counterpart to Solidity's `int216` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 216 bits\\n     */\\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n        downcasted = int216(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(216, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int208 from int256, reverting on\\n     * overflow (when the input is less than smallest int208 or\\n     * greater than largest int208).\\n     *\\n     * Counterpart to Solidity's `int208` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 208 bits\\n     */\\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n        downcasted = int208(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(208, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int200 from int256, reverting on\\n     * overflow (when the input is less than smallest int200 or\\n     * greater than largest int200).\\n     *\\n     * Counterpart to Solidity's `int200` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 200 bits\\n     */\\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n        downcasted = int200(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(200, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int192 from int256, reverting on\\n     * overflow (when the input is less than smallest int192 or\\n     * greater than largest int192).\\n     *\\n     * Counterpart to Solidity's `int192` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 192 bits\\n     */\\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n        downcasted = int192(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(192, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int184 from int256, reverting on\\n     * overflow (when the input is less than smallest int184 or\\n     * greater than largest int184).\\n     *\\n     * Counterpart to Solidity's `int184` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 184 bits\\n     */\\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n        downcasted = int184(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(184, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int176 from int256, reverting on\\n     * overflow (when the input is less than smallest int176 or\\n     * greater than largest int176).\\n     *\\n     * Counterpart to Solidity's `int176` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 176 bits\\n     */\\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n        downcasted = int176(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(176, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int168 from int256, reverting on\\n     * overflow (when the input is less than smallest int168 or\\n     * greater than largest int168).\\n     *\\n     * Counterpart to Solidity's `int168` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 168 bits\\n     */\\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n        downcasted = int168(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(168, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int160 from int256, reverting on\\n     * overflow (when the input is less than smallest int160 or\\n     * greater than largest int160).\\n     *\\n     * Counterpart to Solidity's `int160` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 160 bits\\n     */\\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n        downcasted = int160(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(160, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int152 from int256, reverting on\\n     * overflow (when the input is less than smallest int152 or\\n     * greater than largest int152).\\n     *\\n     * Counterpart to Solidity's `int152` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 152 bits\\n     */\\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n        downcasted = int152(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(152, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int144 from int256, reverting on\\n     * overflow (when the input is less than smallest int144 or\\n     * greater than largest int144).\\n     *\\n     * Counterpart to Solidity's `int144` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 144 bits\\n     */\\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n        downcasted = int144(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(144, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int136 from int256, reverting on\\n     * overflow (when the input is less than smallest int136 or\\n     * greater than largest int136).\\n     *\\n     * Counterpart to Solidity's `int136` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 136 bits\\n     */\\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n        downcasted = int136(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(136, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int128 from int256, reverting on\\n     * overflow (when the input is less than smallest int128 or\\n     * greater than largest int128).\\n     *\\n     * Counterpart to Solidity's `int128` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 128 bits\\n     */\\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n        downcasted = int128(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(128, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int120 from int256, reverting on\\n     * overflow (when the input is less than smallest int120 or\\n     * greater than largest int120).\\n     *\\n     * Counterpart to Solidity's `int120` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 120 bits\\n     */\\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n        downcasted = int120(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(120, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int112 from int256, reverting on\\n     * overflow (when the input is less than smallest int112 or\\n     * greater than largest int112).\\n     *\\n     * Counterpart to Solidity's `int112` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 112 bits\\n     */\\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n        downcasted = int112(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(112, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int104 from int256, reverting on\\n     * overflow (when the input is less than smallest int104 or\\n     * greater than largest int104).\\n     *\\n     * Counterpart to Solidity's `int104` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 104 bits\\n     */\\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n        downcasted = int104(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(104, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int96 from int256, reverting on\\n     * overflow (when the input is less than smallest int96 or\\n     * greater than largest int96).\\n     *\\n     * Counterpart to Solidity's `int96` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 96 bits\\n     */\\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n        downcasted = int96(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(96, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int88 from int256, reverting on\\n     * overflow (when the input is less than smallest int88 or\\n     * greater than largest int88).\\n     *\\n     * Counterpart to Solidity's `int88` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 88 bits\\n     */\\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n        downcasted = int88(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(88, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int80 from int256, reverting on\\n     * overflow (when the input is less than smallest int80 or\\n     * greater than largest int80).\\n     *\\n     * Counterpart to Solidity's `int80` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 80 bits\\n     */\\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n        downcasted = int80(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(80, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int72 from int256, reverting on\\n     * overflow (when the input is less than smallest int72 or\\n     * greater than largest int72).\\n     *\\n     * Counterpart to Solidity's `int72` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 72 bits\\n     */\\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n        downcasted = int72(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(72, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int64 from int256, reverting on\\n     * overflow (when the input is less than smallest int64 or\\n     * greater than largest int64).\\n     *\\n     * Counterpart to Solidity's `int64` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 64 bits\\n     */\\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n        downcasted = int64(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(64, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int56 from int256, reverting on\\n     * overflow (when the input is less than smallest int56 or\\n     * greater than largest int56).\\n     *\\n     * Counterpart to Solidity's `int56` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 56 bits\\n     */\\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n        downcasted = int56(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(56, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int48 from int256, reverting on\\n     * overflow (when the input is less than smallest int48 or\\n     * greater than largest int48).\\n     *\\n     * Counterpart to Solidity's `int48` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 48 bits\\n     */\\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n        downcasted = int48(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(48, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int40 from int256, reverting on\\n     * overflow (when the input is less than smallest int40 or\\n     * greater than largest int40).\\n     *\\n     * Counterpart to Solidity's `int40` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 40 bits\\n     */\\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n        downcasted = int40(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(40, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int32 from int256, reverting on\\n     * overflow (when the input is less than smallest int32 or\\n     * greater than largest int32).\\n     *\\n     * Counterpart to Solidity's `int32` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 32 bits\\n     */\\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n        downcasted = int32(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(32, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int24 from int256, reverting on\\n     * overflow (when the input is less than smallest int24 or\\n     * greater than largest int24).\\n     *\\n     * Counterpart to Solidity's `int24` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 24 bits\\n     */\\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n        downcasted = int24(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(24, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int16 from int256, reverting on\\n     * overflow (when the input is less than smallest int16 or\\n     * greater than largest int16).\\n     *\\n     * Counterpart to Solidity's `int16` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 16 bits\\n     */\\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n        downcasted = int16(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(16, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int8 from int256, reverting on\\n     * overflow (when the input is less than smallest int8 or\\n     * greater than largest int8).\\n     *\\n     * Counterpart to Solidity's `int8` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 8 bits\\n     */\\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n        downcasted = int8(value);\\n        if (downcasted != value) {\\n            revert SafeCastOverflowedIntDowncast(8, value);\\n        }\\n    }\\n\\n    /**\\n     * @dev Converts an unsigned uint256 into a signed int256.\\n     *\\n     * Requirements:\\n     *\\n     * - input must be less than or equal to maxInt256.\\n     */\\n    function toInt256(uint256 value) internal pure returns (int256) {\\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n        if (value > uint256(type(int256).max)) {\\n            revert SafeCastOverflowedUintToInt(value);\\n        }\\n        return int256(value);\\n    }\\n\\n    /**\\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n     */\\n    function toUint(bool b) internal pure returns (uint256 u) {\\n        assembly (\\\"memory-safe\\\") {\\n            u := iszero(iszero(b))\\n        }\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n    /**\\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n     *\\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n     * one branch when needed, making this function more expensive.\\n     */\\n    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n        unchecked {\\n            // branchless ternary works because:\\n            // b ^ (a ^ b) == a\\n            // b ^ 0 == b\\n            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the largest of two signed numbers.\\n     */\\n    function max(int256 a, int256 b) internal pure returns (int256) {\\n        return ternary(a > b, a, b);\\n    }\\n\\n    /**\\n     * @dev Returns the smallest of two signed numbers.\\n     */\\n    function min(int256 a, int256 b) internal pure returns (int256) {\\n        return ternary(a < b, a, b);\\n    }\\n\\n    /**\\n     * @dev Returns the average of two signed numbers without overflow.\\n     * The result is rounded towards zero.\\n     */\\n    function average(int256 a, int256 b) internal pure returns (int256) {\\n        // Formula from the book \\\"Hacker's Delight\\\"\\n        int256 x = (a & b) + ((a ^ b) >> 1);\\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\\n    }\\n\\n    /**\\n     * @dev Returns the absolute unsigned value of a signed value.\\n     */\\n    function abs(int256 n) internal pure returns (uint256) {\\n        unchecked {\\n            // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n            // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n            int256 mask = n >> 255;\\n\\n            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n            return uint256((n + mask) ^ mask);\\n        }\\n    }\\n}\\n\"},\"lib/openzeppelin-contracts/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n *      using Panic for uint256;\\n *\\n *      // Use any of the declared internal constants\\n *      function foo() { Panic.GENERIC.panic(); }\\n *\\n *      // Alternatively\\n *      function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n    /// @dev generic / unspecified error\\n    uint256 internal constant GENERIC = 0x00;\\n    /// @dev used by the assert() builtin\\n    uint256 internal constant ASSERT = 0x01;\\n    /// @dev arithmetic underflow or overflow\\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\\n    /// @dev division or modulo by zero\\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n    /// @dev enum conversion error\\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n    /// @dev invalid encoding in storage\\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n    /// @dev empty array pop\\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n    /// @dev array out of bounds access\\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n    /// @dev resource error (too large allocation or too large array)\\n    uint256 internal constant RESOURCE_ERROR = 0x41;\\n    /// @dev calling invalid internal function\\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n    /// @dev Reverts with a panic code. Recommended to use with\\n    /// the internal constants with predefined codes.\\n    function panic(uint256 code) internal pure {\\n        assembly (\\\"memory-safe\\\") {\\n            mstore(0x00, 0x4e487b71)\\n            mstore(0x20, code)\\n            revert(0x1c, 0x24)\\n        }\\n    }\\n}\\n\"}},\"settings\":{\"remappings\":[\"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\"diamond-3-hardhat/=lib/diamond-3-hardhat/contracts/\",\"forge-std/=lib/forge-std/src/\",\"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\"openzeppelin-contracts/=lib/openzeppelin-contracts/\"],\"optimizer\":{\"enabled\":true,\"runs\":200},\"metadata\":{\"useLiteralContent\":false,\"bytecodeHash\":\"ipfs\",\"appendCBOR\":true},\"outputSelection\":{\"src/facets/WithdrawalFacet.sol\":{\"WithdrawalFacet\":[\"*\"]}},\"evmVersion\":\"cancun\",\"viaIR\":true,\"libraries\":{}}}}","ABI":"[{\"inputs\":[],\"name\":\"DirectAccessNotAvailable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DirectModeActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptySignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EthTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExecutorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GlobalPauseActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidContractSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExecutorSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signerKey\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignatureType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWebAuthnAuthStruct\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWebAuthnSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSignersRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAuthorizedOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"SignerMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UseDirectEthWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UseExecutorEthWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WithdrawalExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAmount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"DirectWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ExecutorWithdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"ownerSig\",\"type\":\"bytes\"}],\"name\":\"directEthWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"ownerSig\",\"type\":\"bytes\"}],\"name\":\"directTokenWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ethBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"ownerSig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"executorSig\",\"type\":\"bytes\"}],\"name\":\"executorEthWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"ownerSig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"executorSig\",\"type\":\"bytes\"}],\"name\":\"executorTokenWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"tokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]","ContractName":"WithdrawalFacet","CompilerVersion":"v0.8.31+commit.fd3a2265","OptimizationUsed":"1","Runs":"200","EVMVersion":"cancun","Library":"","LicenseType":"","Proxy":"0","Implementation":"","SwarmSource":""}]}