UNPKG

@particle-network/connectkit

Version:
8 lines (7 loc) 33.5 kB
{ "version": 3, "sources": ["../../src/actions/switchAccount.ts", "../../src/hooks/useSwitchAccount.ts", "../../src/actions/switchChain.ts", "../../src/hooks/useSwitchChain.ts", "../../src/actions/getChainId.ts", "../../src/actions/watchChainId.ts", "../../src/hooks/useChainId.ts", "../../src/components/chainDropdown/index.tsx", "../../src/components/connectedWidget/styles.ts", "../../src/hooks/useEmbeddedWallet.ts", "../../src/hooks/useParticleAuth.ts", "../../src/actions/getClient.ts", "../../src/hooks/usePublicClient.ts", "../../src/hooks/useWallets.ts"], "sourcesContent": ["import {\n ConnectorNotConnectedError,\n type BaseError,\n type Connector,\n type ConnectorNotConnectedErrorType,\n type ErrorType,\n} from '@particle-network/connector-core';\nimport type { Config } from '../createConfig';\n\nexport type SwitchAccountParameters = {\n connector: Connector;\n};\n\nexport type SwitchAccountReturnType = {\n accounts: readonly [string, ...string[]];\n chainId: number;\n};\n\nexport type SwitchAccountErrorType = ConnectorNotConnectedErrorType | BaseError | ErrorType;\n\nexport async function switchAccount(\n config: Config,\n parameters: SwitchAccountParameters\n): Promise<SwitchAccountReturnType> {\n const { connector } = parameters;\n\n const connection = config.state.connections.get(connector.uid);\n if (!connection) throw new ConnectorNotConnectedError();\n\n await config.storage?.setItem('recentConnectorId', connector.id);\n config.setState((x) => ({\n ...x,\n current: connector.uid,\n }));\n return {\n accounts: connection.accounts,\n chainId: connection.chainId,\n };\n}\n", "import { switchAccount, type SwitchAccountParameters, type SwitchAccountReturnType } from '../actions/switchAccount';\nimport { useContext } from '../context';\nimport { useConnections } from './useConnections';\nimport { useMutation, type MutationOptions } from './useMutation';\n\nexport type UseSwitchAccountParameters = MutationOptions<SwitchAccountReturnType, SwitchAccountParameters>;\n\nexport function useSwitchAccount(parameters?: UseSwitchAccountParameters) {\n const { config } = useContext();\n\n const mutationFn = async (parameters: SwitchAccountParameters) => {\n return await switchAccount(config, parameters);\n };\n\n const { mutate, mutateAsync, ...result } = useMutation(mutationFn, parameters);\n\n return {\n ...result,\n connectors: useConnections().map((connection) => connection.connector),\n switchAccount: mutate,\n switchAccountAsync: mutateAsync,\n };\n}\n", "import {\n ChainNotConfiguredError,\n SwitchChainNotSupportedError,\n type AddEthereumChainParameter,\n type BaseErrorType,\n type ChainNotConfiguredErrorType,\n type ConnectorParameter,\n type ErrorType,\n type Evaluate,\n type ExactPartial,\n type ProviderNotFoundErrorType,\n type SwitchChainNotSupportedErrorType,\n type UserRejectedRequestErrorType,\n} from '@particle-network/connector-core';\nimport type { Chain } from 'viem';\nimport type { Config } from '../createConfig';\n\nexport type SwitchChainParameters = Evaluate<\n ConnectorParameter & {\n chainId: number;\n addEthereumChainParameter?: Evaluate<ExactPartial<Omit<AddEthereumChainParameter, 'chainId'>>> | undefined;\n }\n>;\n\nexport type SwitchChainReturnType = Chain;\n\nexport type SwitchChainErrorType =\n | SwitchChainNotSupportedErrorType\n | ChainNotConfiguredErrorType\n | ProviderNotFoundErrorType\n | UserRejectedRequestErrorType\n | BaseErrorType\n | ErrorType;\n\nexport async function switchChain(config: Config, parameters: SwitchChainParameters): Promise<SwitchChainReturnType> {\n const { addEthereumChainParameter, chainId } = parameters;\n\n const connection = config.state.connections.get(parameters.connector?.uid ?? config.state.current!);\n if (connection) {\n const connector = connection.connector;\n if (!connector.switchChain) throw new SwitchChainNotSupportedError({ connector });\n const chain = await connector.switchChain({\n addEthereumChainParameter,\n chainId,\n });\n return chain;\n }\n\n const chain = config.chains.find((x) => x.id === chainId);\n if (!chain) throw new ChainNotConfiguredError();\n config.setState((x) => ({ ...x, chainId }));\n return chain;\n}\n", "import type { Chain } from 'viem/chains';\nimport { switchChain, type SwitchChainParameters } from '../actions/switchChain';\nimport { useContext } from '../context';\nimport { useMutation, type MutationOptions } from './useMutation';\n\nexport type UseSwitchChainParameters = MutationOptions<Chain, SwitchChainParameters>;\n\nexport const useSwitchChain = (parameters?: UseSwitchChainParameters) => {\n const { config } = useContext();\n\n const mutationFn = async (parameters: SwitchChainParameters) => {\n return await switchChain(config, parameters);\n };\n\n const { status, data, error, mutate, mutateAsync } = useMutation(mutationFn, parameters);\n\n return {\n status,\n data,\n error,\n switchChain: mutate,\n switchChainAsync: mutateAsync,\n };\n};\n", "import type { Config } from '../createConfig';\n\nexport type GetChainIdReturnType<config extends Config = Config> = config['chains'][number]['id'];\n\nexport function getChainId<config extends Config>(config: config): GetChainIdReturnType<config> {\n return config.state.chainId;\n}\n", "import type { Config } from '../createConfig';\nimport type { GetChainIdReturnType } from './getChainId';\n\nexport type WatchChainIdParameters<config extends Config = Config> = {\n onChange(chainId: GetChainIdReturnType<config>, prevChainId: GetChainIdReturnType<config>): void;\n};\n\nexport type WatchChainIdReturnType = () => void;\n\nexport function watchChainId<config extends Config>(\n config: config,\n parameters: WatchChainIdParameters<config>\n): WatchChainIdReturnType {\n const { onChange } = parameters;\n return config.subscribe((state) => state.chainId, onChange);\n}\n", "import { useSyncExternalStore } from 'react';\nimport { getChainId } from '../actions/getChainId';\nimport { watchChainId } from '../actions/watchChainId';\nimport { useContext } from '../context';\n\nexport function useChainId() {\n const { config } = useContext();\n\n return useSyncExternalStore(\n (onChange) => watchChainId(config, { onChange }),\n () => getChainId(config),\n () => getChainId(config)\n );\n}\n", "import { getChainIcon, getChainType, isEVMChain } from '@particle-network/connector-core';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport CheckIcon from '../../assets/icons/CheckIcon';\nimport { useChainId } from '../../hooks/useChainId';\nimport { useChains } from '../../hooks/useChains';\nimport useClickAway from '../../hooks/useClickAway';\nimport useConnect from '../../hooks/useConnect';\nimport { useConnections } from '../../hooks/useConnections';\nimport { useConnectors } from '../../hooks/useConnectors';\nimport { useSwitchAccount } from '../../hooks/useSwitchAccount';\nimport { useSwitchChain } from '../../hooks/useSwitchChain';\nimport { useWalletConnections } from '../../hooks/useWalletConnections';\nimport { getChainDisplayName } from '../../utils/chains';\nimport CircleSpinner from '../circleSpinner';\nimport {\n StyleChainItem,\n StyleChainName,\n StyleCheckIcon,\n StyleDropdownContent,\n StyleDropdownWrapper,\n StyleHoverBg,\n} from './styles';\n\nconst ChainDropdown = ({\n visible,\n setVisible,\n clickAwayElements,\n maxHeight,\n supportChain = true,\n top,\n}: {\n visible: boolean;\n setVisible: (visible: boolean) => void;\n clickAwayElements: React.RefObject<HTMLDivElement>[];\n maxHeight?: number;\n supportChain?: boolean;\n top?: number;\n}) => {\n const chainList = useChains();\n const chainId = useChainId();\n const { switchChainAsync, status: switchStatus } = useSwitchChain();\n const [walletConnection] = useWalletConnections();\n const { switchAccountAsync } = useSwitchAccount();\n const connectors = useConnectors();\n const { connectAsync } = useConnect();\n const connections = useConnections();\n\n const [hoverIndex, setHoverIndex] = useState(-1);\n const [targetChainId, setTargetChainId] = useState<number>();\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const timer = useRef<NodeJS.Timeout>(undefined);\n const dropdownWrapperRef = useRef<HTMLDivElement>(null);\n const selectedItemRef = useRef<HTMLDivElement>(null);\n\n const isParticle = useMemo(() => {\n return Boolean(walletConnection && walletConnection.walletProps.connector.walletConnectorType === 'particleAuth');\n }, [walletConnection]);\n\n const currentChainId = useMemo(() => {\n return supportChain ? chainId : -1;\n }, [chainId, supportChain]);\n\n /**\n * Switch success\n */\n const switchSuccess = useMemo(() => {\n return targetChainId === currentChainId;\n }, [targetChainId, currentChainId]);\n\n const currentChainType = useMemo(() => {\n if (chainList && chainList?.length && currentChainId) {\n const chain = chainList.find((item) => item.id === currentChainId);\n if (chain) {\n return getChainType(chain);\n }\n return '';\n } else {\n return '';\n }\n }, [chainList, currentChainId]);\n\n useEffect(() => {\n if (switchSuccess && visible) {\n setVisible(false);\n setTargetChainId(undefined);\n }\n }, [switchSuccess, visible, setVisible]);\n\n useEffect(() => {\n console.log('\uD83D\uDE80 ~ currentChainId:', currentChainId);\n }, [currentChainId]);\n\n useClickAway(() => {\n setVisible(false);\n }, [dropdownRef, ...clickAwayElements]);\n\n useEffect(() => {\n setTimeout(() => {\n if (visible && dropdownWrapperRef.current && selectedItemRef.current) {\n const dropdownWrapper = dropdownWrapperRef.current;\n const selectedItem = selectedItemRef.current;\n const wrapperHeight = dropdownWrapper.clientHeight;\n const itemHeight = selectedItem.clientHeight;\n const itemTop = selectedItem.offsetTop;\n const scrollTop = itemTop - wrapperHeight / 2 + itemHeight / 2;\n const currentScrollTop = dropdownWrapper.scrollTop;\n if (itemTop < currentScrollTop || itemTop + itemHeight > currentScrollTop + wrapperHeight) {\n dropdownWrapper.scrollTop = scrollTop;\n }\n }\n }, 50);\n }, [visible, currentChainId]);\n\n return (\n <StyleDropdownContent ref={dropdownRef} top={top || 46}>\n <AnimatePresence>\n {visible && (\n <motion.div\n style={{\n overflow: 'hidden',\n }}\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: 'auto', opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n >\n <StyleDropdownWrapper\n ref={dropdownWrapperRef}\n style={{\n maxHeight: maxHeight || 320,\n }}\n >\n <StyleHoverBg index={hoverIndex} />\n {chainList.map((chain) => (\n <StyleChainItem\n key={chain.id}\n selected={currentChainId === chain.id}\n ref={currentChainId === chain.id ? selectedItemRef : null}\n onClick={async () => {\n try {\n if (chain.id === currentChainId) return;\n setTargetChainId(chain.id);\n if (isParticle && getChainType(chain) !== currentChainType) {\n const id = isEVMChain(chain) ? 'particleEVM' : 'particleSolana';\n const connector = connectors.find((item) => item.id === id)!;\n const isAuthorized = await connector.isAuthorized();\n if (!isAuthorized) {\n const provider = isEVMChain(chain) ? window.particle?.ethereum : window.particle?.solana;\n await provider!.connect();\n await connectAsync({\n connector,\n chainId: chain.id,\n });\n return;\n } else {\n // \u5982\u679C\u662Femial/phone\u767B\u5F55\u7684\uFF0C\u4E14\u5DF2\u7ECF\u751F\u6210\u4E86\u94B1\u5305\uFF0C\u5982\u679C\u6CA1\u6709\u8FDE\u63A5\u7684\u8BDD\u9700\u8981\u5148\u8FDE\u63A5\n if (connections.some((connection) => connection.connector.id === id)) {\n await switchAccountAsync({ connector });\n } else {\n await connectAsync({\n connector,\n chainId: chain.id,\n });\n return;\n }\n }\n }\n console.log('Switch chain:', chain.id);\n await switchChainAsync({\n chainId: chain.id,\n });\n } catch (error) {\n console.log('Switch chain error:', error);\n setVisible(false);\n setTargetChainId(undefined);\n }\n }}\n onMouseEnter={() => {\n clearTimeout(timer.current);\n setHoverIndex(chainList.findIndex((item) => item.id === chain.id));\n }}\n onMouseLeave={() => {\n timer.current = setTimeout(() => {\n setHoverIndex(-1);\n }, 100);\n }}\n >\n <div\n style={{\n marginRight: '10px',\n }}\n >\n <CircleSpinner\n inset={0}\n width={20}\n height={20}\n connecting={Boolean(!switchSuccess && switchStatus === 'loading' && chain.id === targetChainId)}\n logo={<img src={getChainIcon(chain)} alt={chain.name} />}\n />\n </div>\n <StyleChainName>{getChainDisplayName(chain)}</StyleChainName>\n <StyleCheckIcon>{currentChainId === chain.id && <CheckIcon />}</StyleCheckIcon>\n </StyleChainItem>\n ))}\n </StyleDropdownWrapper>\n </motion.div>\n )}\n </AnimatePresence>\n </StyleDropdownContent>\n );\n};\n\nexport default ChainDropdown;\n", "import { styled } from 'styled-components';\n\nexport const StyleConnectedWidgetContainer = styled.div`\n position: relative;\n display: inline-block;\n`;\n\nexport const StyleInfoBox = styled.div`\n display: inline-block;\n\n border-radius: var(--pcm-rounded-lg);\n background: var(--pcm-body-background);\n box-shadow: var(--pcm-modal-box-shadow);\n max-width: 400px;\n vertical-align: middle;\n line-height: normal;\n padding: 5px 0px;\n box-sizing: content-box;\n`;\n\nexport const StyleChainSection = styled.div<{ selected?: boolean }>`\n cursor: ${(props) => (props.selected ? 'pointer' : 'default')};\n display: inline-block;\n gap: 8px;\n height: 28px;\n margin: 0 10px;\n padding: 0 6px;\n border-radius: 6px;\n background-color: var(--pcm-body-background);\n transition: background-color 0.3s;\n\n ${(props) =>\n props.selected &&\n `\n &:hover {\n background-color: var(--pcm-body-background-secondary);\n }\n `}\n .wrap {\n display: flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n }\n`;\n\nexport const StyleChainIcon = styled.img`\n width: 20px;\n height: 20px;\n border-radius: 50%;\n`;\n\nexport const StyleChainName = styled.div`\n font-size: 14px;\n line-height: 1;\n position: relative;\n top: -1px;\n`;\n\nexport const StyleDivider = styled.div`\n display: inline-block;\n width: 1px;\n height: 19px;\n background: var(--pcm-secondary-button-bankground);\n`;\n\nexport const StyleAddressSection = styled.div`\n display: inline-block;\n gap: 8px;\n height: 28px;\n margin: 0 10px;\n padding: 0 6px;\n border-radius: 6px;\n background-color: var(--pcm-body-background);\n transition: background-color 0.3s;\n position: relative;\n top: 3px;\n &:hover {\n background-color: var(--pcm-body-background-secondary);\n }\n .wrap {\n display: flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n }\n`;\n\nexport const StyleIconWrapper = styled.div`\n width: 20px;\n height: 20px;\n`;\n\nexport const StyleWalletAddress = styled.div`\n font-size: 14px;\n`;\n\nexport const StyleSwitchNetwork = styled.div`\n font-size: 14px;\n color: var(--pcm-error-color);\n display: flex;\n gap: 6px;\n align-items: center;\n`;\n", "import type { GetWalletIFrameParamers, OpenWalletParamers, WalletPlugin } from '@particle-network/wallet-plugin';\nimport { useMemo } from 'react';\nimport { useContext } from '../context';\n\nexport type UseEmbeddedWalletReturnType = {\n openWallet: (parameters?: OpenWalletParamers) => void;\n destory: () => void;\n getWalletIFrame: (parameters?: GetWalletIFrameParamers) => void;\n isCanOpen: boolean;\n};\n\nexport const useEmbeddedWallet = (): UseEmbeddedWalletReturnType | null => {\n const { config } = useContext();\n const walletPlugin = useMemo(() => {\n const plugin = config.plugins.find((plugin) => plugin.id === 'wallet');\n if (plugin) {\n return plugin as WalletPlugin;\n }\n return undefined;\n }, []);\n\n const isCanOpen = useMemo(() => {\n return walletPlugin?.getPlugin().walletOptions.widgetIntegration !== 'embedded';\n }, [walletPlugin]);\n\n if (!walletPlugin) {\n return null;\n }\n\n return {\n openWallet: walletPlugin.openWallet.bind(walletPlugin),\n destory: walletPlugin.destory.bind(walletPlugin),\n getWalletIFrame: walletPlugin.getWalletIFrame.bind(walletPlugin),\n isCanOpen,\n };\n};\n", "import { useCallback, useMemo } from 'react';\nimport { useAccount } from './useAccount';\n\ninterface UserInfo {\n uuid: string;\n created_at: string;\n updated_at: string;\n phone: string | null;\n email: string | null;\n name: string | null;\n avatar: string | null;\n facebook_id: string | null;\n facebook_email: string | null;\n google_id: string | null;\n google_email: string | null;\n apple_id: string | null;\n apple_email: string | null;\n twitter_id: string | null;\n twitter_email: string | null;\n telegram_id: string | null;\n telegram_phone: string | null;\n discord_id: string | null;\n discord_email: string | null;\n github_id: string | null;\n github_email: string | null;\n twitch_id: string | null;\n twitch_email: string | null;\n microsoft_id: string | null;\n microsoft_email: string | null;\n linkedin_id: string | null;\n linkedin_email: string | null;\n jwt_id: string | null;\n passkeys_id: string | null;\n thirdparty_user_info: any | null;\n mac_key: string;\n token: string;\n wallets: Wallet[];\n cognito_result: CognitoResult;\n security_account: SecurityAccount;\n}\n\ninterface Wallet {\n public_address: string;\n encrypted_data: string;\n encrypted_type: number;\n encrypted_kms_data_key: string;\n uuid: string;\n type: number;\n chain_name: string;\n created_at: string;\n updated_at: string;\n user_uuid: string;\n}\n\ninterface CognitoResult {\n region: string;\n identity_id: string;\n id_token: string;\n kms_key_id: string;\n}\n\ninterface SecurityAccount {\n email: string | null;\n phone: string | null;\n has_set_master_password: boolean;\n has_set_payment_password: boolean;\n payment_password_updated_at: string | null;\n}\n\ninterface ParticleMethods {\n openAccountAndSecurity: () => void;\n openChangeMasterPassword: () => void;\n openChangePaymentPassword: () => void;\n openLinkLoginAccount: () => void;\n openRestoreByMasterPassword: () => void;\n openSetMasterPassword: () => void;\n openSetPaymentPassword: (securityAccountEmailOrPhone: string) => void;\n openSetSecurityAccount: () => void;\n hasMasterPassword: () => boolean;\n hasPaymentPassword: () => boolean;\n needRestoreWallet: () => boolean;\n getUserInfo: () => UserInfo;\n}\n\ninterface ParticleWindow {\n particle?: {\n _internal: ParticleMethods;\n };\n}\n\nexport const useParticleAuth = (): ParticleMethods => {\n const { connector } = useAccount();\n\n const isParticle = useMemo(() => {\n return connector?.walletConnectorType === 'particleAuth';\n }, [connector]);\n\n const particle = useMemo(() => {\n if (isParticle && 'particle' in window && (window as ParticleWindow).particle?._internal) {\n return (window as ParticleWindow)?.particle;\n }\n return null;\n }, [isParticle]);\n\n const createParticleMethod = useCallback(\n <T extends keyof ParticleMethods>(methodName: T) => {\n return (...args: Parameters<ParticleMethods[T]>): ReturnType<ParticleMethods[T]> => {\n if (!isParticle || !particle || !particle._internal || !particle._internal[methodName]) {\n throw new Error('The current wallet is not a particle wallet or particle is not initialized');\n }\n return (particle?._internal[methodName] as any)(...args);\n };\n },\n [isParticle, particle]\n );\n\n return {\n needRestoreWallet: () => {\n return Boolean((window as ParticleWindow)?.particle?._internal?.needRestoreWallet);\n },\n hasMasterPassword: createParticleMethod('hasMasterPassword'),\n hasPaymentPassword: createParticleMethod('hasPaymentPassword'),\n openAccountAndSecurity: createParticleMethod('openAccountAndSecurity'),\n openChangeMasterPassword: createParticleMethod('openChangeMasterPassword'),\n openChangePaymentPassword: createParticleMethod('openChangePaymentPassword'),\n openLinkLoginAccount: createParticleMethod('openLinkLoginAccount'),\n openRestoreByMasterPassword: createParticleMethod('openRestoreByMasterPassword'),\n openSetMasterPassword: createParticleMethod('openSetMasterPassword'),\n openSetSecurityAccount: createParticleMethod('openSetSecurityAccount'),\n openSetPaymentPassword: createParticleMethod('openSetPaymentPassword'),\n getUserInfo: createParticleMethod('getUserInfo'),\n };\n};\n", "import {\n isEVMChain,\n type ChainIdParameter,\n type ChainType,\n type ClientType,\n type EVMChain,\n} from '@particle-network/connector-core';\nimport type { Config } from '../createConfig';\n\nexport function getClient<chainType extends ChainType = EVMChain>(\n config: Config,\n parameters: ChainIdParameter = {}\n): ClientType<chainType> | null {\n const chainId = parameters.chainId || config.state.chainId;\n const chain = config.chains.find((chain) => chain.id === chainId);\n\n if (!chain) {\n return null;\n }\n\n const authWalletConnector = config.getWalletConnector('particleAuth');\n if (authWalletConnector) {\n return authWalletConnector.getClient(chainId) as ClientType<chainType>;\n }\n\n if (isEVMChain(chain)) {\n return config.getWalletConnector('evmWallet')!.getClient(chainId) as ClientType<chainType>;\n }\n\n return config.getWalletConnector('solanaWallet')!.getClient(chainId) as ClientType<chainType>;\n}\n", "import {\n type ChainIdParameter,\n type ChainType,\n type ClientType,\n type EVMChain,\n} from '@particle-network/connector-core';\nimport { getClient } from '../actions/getClient';\nimport { useContext } from '../context';\n\nexport function usePublicClient<chainType extends ChainType = EVMChain>(\n parameters: ChainIdParameter = {}\n): ClientType<chainType> | null {\n const { chainId } = parameters;\n const { config } = useContext();\n\n return getClient(config, { chainId });\n}\n", "import { useWeb3Context } from '../context/web3Provider';\n\nexport const useWallets = () => {\n const { wallets } = useWeb3Context();\n return wallets;\n};\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,OAKK;AAcP,eAAsB,cACpB,QACA,YACkC;AAClC,QAAM,EAAE,UAAU,IAAI;AAEtB,QAAM,aAAa,OAAO,MAAM,YAAY,IAAI,UAAU,GAAG;AAC7D,MAAI,CAAC;AAAY,UAAM,IAAI,2BAA2B;AAEtD,QAAM,OAAO,SAAS,QAAQ,qBAAqB,UAAU,EAAE;AAC/D,SAAO,SAAS,CAAC,OAAO;AAAA,IACtB,GAAG;AAAA,IACH,SAAS,UAAU;AAAA,EACrB,EAAE;AACF,SAAO;AAAA,IACL,UAAU,WAAW;AAAA,IACrB,SAAS,WAAW;AAAA,EACtB;AACF;AAtCA;AAAA;AAAA;AAAA;AAAA;;;ACOO,SAAS,iBAAiB,YAAyC;AACxE,QAAM,EAAE,OAAO,IAAI,WAAW;AAE9B,QAAM,aAAa,OAAOA,gBAAwC;AAChE,WAAO,MAAM,cAAc,QAAQA,W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