@tempoxyz/id 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -2
- package/dist/App.d.ts +121 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +132 -0
- package/dist/App.js.map +1 -0
- package/dist/app/client/.assetsignore +2 -0
- package/dist/app/client/_headers +4 -0
- package/dist/app/client/assets/Account-BYLpNFf3.css +1 -0
- package/dist/app/client/assets/Account-BllJah07.js +1 -0
- package/dist/app/client/assets/Amount-E_7snI0-.js +1 -0
- package/dist/app/client/assets/Amount-ZdtluGf-.css +1 -0
- package/dist/app/client/assets/Approval-CgV5JHlb.css +1 -0
- package/dist/app/client/assets/Approval-yKflypU2.js +1 -0
- package/dist/app/client/assets/ArrowUp-CRvqfMNU.js +1 -0
- package/dist/app/client/assets/Authentication-BAXhOh_4.js +2 -0
- package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/client/assets/BRZ-Cn3jEi9t.svg +1 -0
- package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/client/assets/Callout-B736759d.js +1 -0
- package/dist/app/client/assets/Callout-DBfEmP7q.css +1 -0
- package/dist/app/client/assets/Check-DVgD8tDG.js +1 -0
- package/dist/app/client/assets/ChevronRight-CsXtIZCB.js +1 -0
- package/dist/app/client/assets/ChooseAccount-BjxfQjPK.js +1 -0
- package/dist/app/client/assets/ChooseAccount-DL3wgJhE.css +1 -0
- package/dist/app/client/assets/Client-JrABNovb.js +1 -0
- package/dist/app/client/assets/Close-CRvWlhqc.js +1 -0
- package/dist/app/client/assets/Cloud-DgJsrqpQ.js +1 -0
- package/dist/app/client/assets/CodeInput-79Ctx8ZA.js +1 -0
- package/dist/app/client/assets/CodeInput-BqRteSwD.css +1 -0
- package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/client/assets/Deposit-CclrAoXL.css +1 -0
- package/dist/app/client/assets/Deposit-c7uYn2Eb.js +1 -0
- package/dist/app/client/assets/DevTools-BYkmtuV5.css +1 -0
- package/dist/app/client/assets/DevTools-BgnzDGo2.js +1 -0
- package/dist/app/client/assets/DeviceApproval-BBUVv58e.js +1 -0
- package/dist/app/client/assets/DeviceApproval-BffFLD8F.css +1 -0
- package/dist/app/client/assets/EURAU-sjieTTB9.svg +1 -0
- package/dist/app/client/assets/EURC.e-CxYiiwkz.svg +1 -0
- package/dist/app/client/assets/Fingerprint-BNCA6qOJ.js +1 -0
- package/dist/app/client/assets/GBPA-DI_25xSG.svg +4 -0
- package/dist/app/client/assets/GUSD-BDEP2Qb-.svg +1 -0
- package/dist/app/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/app/client/assets/Globe-f0eWzcEI.js +1 -0
- package/dist/app/client/assets/Grant-5a-n1gJH.css +1 -0
- package/dist/app/client/assets/Grant-Dp7mpcEi.js +1 -0
- package/dist/app/client/assets/Hex-C9KeV7_9.css +1 -0
- package/dist/app/client/assets/Hex-CSp2U46W.js +10 -0
- package/dist/app/client/assets/IconChip-DpZHa1JW.js +1 -0
- package/dist/app/client/assets/IconChip-yqaQ2y_d.css +1 -0
- package/dist/app/client/assets/InputGroup-BlZvt9In.css +1 -0
- package/dist/app/client/assets/InputGroup-CsOeBnpB.js +1 -0
- package/dist/app/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/app/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/app/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/app/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/app/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/app/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/app/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/app/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/app/client/assets/Loader-Cm9YJNNJ.js +1 -0
- package/dist/app/client/assets/MACH-sK0r79kQ.svg +4 -0
- package/dist/app/client/assets/OUSD-BFXgVo-Z.svg +5 -0
- package/dist/app/client/assets/OUSD.dark-BbbjMvA1.svg +17 -0
- package/dist/app/client/assets/OUSD.light-B_zpSz_c.svg +17 -0
- package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/client/assets/PopoverPopup-DprRXRQe.js +1 -0
- package/dist/app/client/assets/Rows-DPGTUdA8.css +1 -0
- package/dist/app/client/assets/Rows-Qqo3evtk.js +1 -0
- package/dist/app/client/assets/SBC-BTYkbkiD.svg +1 -0
- package/dist/app/client/assets/SEKAU-CB5Fc6o8.svg +5 -0
- package/dist/app/client/assets/Separator-CZUjVQOL.js +1 -0
- package/dist/app/client/assets/SignIn-HdaDzFmq.js +1 -0
- package/dist/app/client/assets/SignIn-mlBTwUq4.css +1 -0
- package/dist/app/client/assets/Stack-CkkvkOzj.js +1 -0
- package/dist/app/client/assets/Stack-D7Yt22Ed.css +1 -0
- package/dist/app/client/assets/Tag-BMh6ajrW.css +1 -0
- package/dist/app/client/assets/Tag-CLOVANTX.js +1 -0
- package/dist/app/client/assets/ToolbarRootContext-Zty_Dh3J.js +1 -0
- package/dist/app/client/assets/Tooltip-CLATV6YU.js +1 -0
- package/dist/app/client/assets/Tooltip-d3y9ESUJ.css +1 -0
- package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/client/assets/USDB-Ckwb6UQw.svg +11 -0
- package/dist/app/client/assets/USDC.e-3nMsKAMC.svg +1 -0
- package/dist/app/client/assets/USDT0-ia60Dw0e.svg +1 -0
- package/dist/app/client/assets/USDY-CB4iet2q.svg +16 -0
- package/dist/app/client/assets/USDe-BXHQCd92.svg +1 -0
- package/dist/app/client/assets/Upgrade-D0_aO5AP.js +1 -0
- package/dist/app/client/assets/WalletUpgrade-BPsPNQsd.js +1 -0
- package/dist/app/client/assets/WalletUpgrade-C04kW0Jl.css +1 -0
- package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/client/assets/___-I98bns4o.css +1 -0
- package/dist/app/client/assets/___.flows-XOlLwMIy.js +5 -0
- package/dist/app/client/assets/alphaUSD-CpCFoVuh.svg +1 -0
- package/dist/app/client/assets/authorize-C-MlCyaM.js +1 -0
- package/dist/app/client/assets/betaUSD-9A8AjgYg.svg +1 -0
- package/dist/app/client/assets/cUSD-WsQfa-iC.svg +1 -0
- package/dist/app/client/assets/cbBTC-DvUDqrDi.svg +1 -0
- package/dist/app/client/assets/choose-account-nXR-SKa2.js +1 -0
- package/dist/app/client/assets/deposit-G8tiLPN4.js +1 -0
- package/dist/app/client/assets/device-BojBF7hZ.js +1 -0
- package/dist/app/client/assets/error-KiOpX7GD.js +1 -0
- package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/client/assets/getPseudoElementBounds-BsLy4zf_.js +1 -0
- package/dist/app/client/assets/goUSD-D9kUvHsF.svg +5 -0
- package/dist/app/client/assets/iUSD-CWCJAq9X.svg +1 -0
- package/dist/app/client/assets/index-BZH0M7Nf.js +13 -0
- package/dist/app/client/assets/index-CIYxHmYA.css +1 -0
- package/dist/app/client/assets/login-DUjpk60p.js +1 -0
- package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/client/assets/preload-helper-Bs9KvdYl.js +1 -0
- package/dist/app/client/assets/rUSD-B-xuFS7T.svg +1 -0
- package/dist/app/client/assets/reUSD-CkIUs0Lx.svg +1 -0
- package/dist/app/client/assets/removable-DMiA3t_o.js +1 -0
- package/dist/app/client/assets/reset-co-CHrff.css +1 -0
- package/dist/app/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/dist/app/client/assets/routes-CK8cthzA.js +1 -0
- package/dist/app/client/assets/sUSDe-j9GOnH7I.svg +1 -0
- package/dist/app/client/assets/siUSD-C10QUNYS.svg +1 -0
- package/dist/app/client/assets/stcUSD-DIntDJeh.svg +1 -0
- package/dist/app/client/assets/syrupUSDC-DhYwZqdM.svg +5 -0
- package/dist/app/client/assets/thetaUSD-Dgmksf6G.svg +1 -0
- package/dist/app/client/assets/useNavigate-CB6S2u4J.js +1 -0
- package/dist/app/client/assets/useQuery-BpHfPhTT.js +1 -0
- package/dist/app/client/assets/useRegisterFieldControl-DsslqY-V.js +1 -0
- package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/client/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
- package/dist/app/client/assets/zyzz-DYC-X0_B.css +1 -0
- package/dist/app/client/assets/zyzz.config-DX_D_7j3.js +2 -0
- package/dist/app/db/auth.d.ts +3412 -0
- package/dist/app/db/auth.d.ts.map +1 -0
- package/dist/app/db/auth.js +349 -0
- package/dist/app/db/auth.js.map +1 -0
- package/dist/app/db/schema.d.ts +1091 -0
- package/dist/app/db/schema.d.ts.map +1 -0
- package/dist/app/db/schema.js +183 -0
- package/dist/app/db/schema.js.map +1 -0
- package/dist/app/db/table.d.ts +8 -0
- package/dist/app/db/table.d.ts.map +1 -0
- package/dist/app/db/table.js +28 -0
- package/dist/app/db/table.js.map +1 -0
- package/dist/app/server/.vite/manifest.json +2093 -0
- package/dist/app/server/assets/Account-BYLpNFf3.css +1 -0
- package/dist/app/server/assets/Account-G_SUeRU3.js +2 -0
- package/dist/app/server/assets/Account-G_SUeRU3.js.map +1 -0
- package/dist/app/server/assets/Amount-Cgwdr3Xt.js +2 -0
- package/dist/app/server/assets/Amount-Cgwdr3Xt.js.map +1 -0
- package/dist/app/server/assets/Amount-ZdtluGf-.css +1 -0
- package/dist/app/server/assets/Approval-CgV5JHlb.css +1 -0
- package/dist/app/server/assets/Approval-DvkB9tWA.js +2 -0
- package/dist/app/server/assets/Approval-DvkB9tWA.js.map +1 -0
- package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js +2 -0
- package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js.map +1 -0
- package/dist/app/server/assets/Authentication-BOkhlNQu.js +2 -0
- package/dist/app/server/assets/Authentication-BOkhlNQu.js.map +1 -0
- package/dist/app/server/assets/Authentication-C3oNZAVX.js +2 -0
- package/dist/app/server/assets/Authentication-C3oNZAVX.js.map +1 -0
- package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/server/assets/BRZ-Cn3jEi9t.svg +1 -0
- package/dist/app/server/assets/Bytes-C7CRVS3J.js +4 -0
- package/dist/app/server/assets/Bytes-C7CRVS3J.js.map +1 -0
- package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/server/assets/Callout-DBfEmP7q.css +1 -0
- package/dist/app/server/assets/Callout-tQoAitWq.js +2 -0
- package/dist/app/server/assets/Callout-tQoAitWq.js.map +1 -0
- package/dist/app/server/assets/ChainList-C4A_7e-9.js +6 -0
- package/dist/app/server/assets/ChainList-C4A_7e-9.js.map +1 -0
- package/dist/app/server/assets/ChainName-BMnJyJrd.js +2 -0
- package/dist/app/server/assets/ChainName-BMnJyJrd.js.map +1 -0
- package/dist/app/server/assets/Check-DU_oR3Ev.js +2 -0
- package/dist/app/server/assets/Check-DU_oR3Ev.js.map +1 -0
- package/dist/app/server/assets/ChevronRight-DTBnw-W6.js +2 -0
- package/dist/app/server/assets/ChevronRight-DTBnw-W6.js.map +1 -0
- package/dist/app/server/assets/ChooseAccount-BizJvMrY.js +2 -0
- package/dist/app/server/assets/ChooseAccount-BizJvMrY.js.map +1 -0
- package/dist/app/server/assets/ChooseAccount-DL3wgJhE.css +1 -0
- package/dist/app/server/assets/Client-Dx3KrpJZ.js +2 -0
- package/dist/app/server/assets/Client-Dx3KrpJZ.js.map +1 -0
- package/dist/app/server/assets/ClientOnly-CKLiu67O.js +2 -0
- package/dist/app/server/assets/ClientOnly-CKLiu67O.js.map +1 -0
- package/dist/app/server/assets/Close-DUeE37ev.js +2 -0
- package/dist/app/server/assets/Close-DUeE37ev.js.map +1 -0
- package/dist/app/server/assets/Cloud-CLB3rTTy.js +2 -0
- package/dist/app/server/assets/Cloud-CLB3rTTy.js.map +1 -0
- package/dist/app/server/assets/CodeInput-BqRteSwD.css +1 -0
- package/dist/app/server/assets/CodeInput-FsPzVuLU.js +2 -0
- package/dist/app/server/assets/CodeInput-FsPzVuLU.js.map +1 -0
- package/dist/app/server/assets/Credential-DFjcrdyI.js +2 -0
- package/dist/app/server/assets/Credential-DFjcrdyI.js.map +1 -0
- package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/server/assets/Deposit-CclrAoXL.css +1 -0
- package/dist/app/server/assets/Deposit-ChYGRfW2.js +2 -0
- package/dist/app/server/assets/Deposit-ChYGRfW2.js.map +1 -0
- package/dist/app/server/assets/DevTools-BYkmtuV5.css +1 -0
- package/dist/app/server/assets/DevTools-ZJVXqrIK.js +2 -0
- package/dist/app/server/assets/DevTools-ZJVXqrIK.js.map +1 -0
- package/dist/app/server/assets/DeviceApproval-BffFLD8F.css +1 -0
- package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js +2 -0
- package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js.map +1 -0
- package/dist/app/server/assets/EURAU-sjieTTB9.svg +1 -0
- package/dist/app/server/assets/EURC.e-CxYiiwkz.svg +1 -0
- package/dist/app/server/assets/ExecutionError-CDszGSF1.js +9 -0
- package/dist/app/server/assets/ExecutionError-CDszGSF1.js.map +1 -0
- package/dist/app/server/assets/Fingerprint-DhOPOdRr.js +2 -0
- package/dist/app/server/assets/Fingerprint-DhOPOdRr.js.map +1 -0
- package/dist/app/server/assets/GBPA-DI_25xSG.svg +4 -0
- package/dist/app/server/assets/GUSD-BDEP2Qb-.svg +1 -0
- package/dist/app/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/app/server/assets/Globe-2CxqxU-7.js +2 -0
- package/dist/app/server/assets/Globe-2CxqxU-7.js.map +1 -0
- package/dist/app/server/assets/Grant-5a-n1gJH.css +1 -0
- package/dist/app/server/assets/Grant-D_tun0mF.js +2 -0
- package/dist/app/server/assets/Grant-D_tun0mF.js.map +1 -0
- package/dist/app/server/assets/Hex-C9KeV7_9.css +1 -0
- package/dist/app/server/assets/Hex-Z6m_0Y0m.js +11 -0
- package/dist/app/server/assets/Hex-Z6m_0Y0m.js.map +1 -0
- package/dist/app/server/assets/IconChip-C9ZrmGB5.js +2 -0
- package/dist/app/server/assets/IconChip-C9ZrmGB5.js.map +1 -0
- package/dist/app/server/assets/IconChip-yqaQ2y_d.css +1 -0
- package/dist/app/server/assets/InputGroup-BlZvt9In.css +1 -0
- package/dist/app/server/assets/InputGroup-hpjuLuR7.js +2 -0
- package/dist/app/server/assets/InputGroup-hpjuLuR7.js.map +1 -0
- package/dist/app/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/app/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/app/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/app/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/app/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/app/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/app/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/app/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/app/server/assets/Loader-DnKC9P5p.js +2 -0
- package/dist/app/server/assets/Loader-DnKC9P5p.js.map +1 -0
- package/dist/app/server/assets/MACH-sK0r79kQ.svg +4 -0
- package/dist/app/server/assets/Match-CyVdYcSf.js +2 -0
- package/dist/app/server/assets/Match-CyVdYcSf.js.map +1 -0
- package/dist/app/server/assets/OUSD-BFXgVo-Z.svg +5 -0
- package/dist/app/server/assets/OUSD.dark-BbbjMvA1.svg +17 -0
- package/dist/app/server/assets/OUSD.light-B_zpSz_c.svg +17 -0
- package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/server/assets/PopoverPopup-CwqeQelI.js +2 -0
- package/dist/app/server/assets/PopoverPopup-CwqeQelI.js.map +1 -0
- package/dist/app/server/assets/Rows-CQKQwTI1.js +2 -0
- package/dist/app/server/assets/Rows-CQKQwTI1.js.map +1 -0
- package/dist/app/server/assets/Rows-DPGTUdA8.css +1 -0
- package/dist/app/server/assets/SBC-BTYkbkiD.svg +1 -0
- package/dist/app/server/assets/SEKAU-CB5Fc6o8.svg +5 -0
- package/dist/app/server/assets/Separator-DrI7KRAs.js +2 -0
- package/dist/app/server/assets/Separator-DrI7KRAs.js.map +1 -0
- package/dist/app/server/assets/SignIn-DfeeLEmN.js +2 -0
- package/dist/app/server/assets/SignIn-DfeeLEmN.js.map +1 -0
- package/dist/app/server/assets/SignIn-mlBTwUq4.css +1 -0
- package/dist/app/server/assets/Stack-D7Yt22Ed.css +1 -0
- package/dist/app/server/assets/Stack-DGktaLZc.js +2 -0
- package/dist/app/server/assets/Stack-DGktaLZc.js.map +1 -0
- package/dist/app/server/assets/Tag-9vSRBpph.js +2 -0
- package/dist/app/server/assets/Tag-9vSRBpph.js.map +1 -0
- package/dist/app/server/assets/Tag-BMh6ajrW.css +1 -0
- package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js +2 -0
- package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js.map +1 -0
- package/dist/app/server/assets/Tooltip-DLX41peb.js +2 -0
- package/dist/app/server/assets/Tooltip-DLX41peb.js.map +1 -0
- package/dist/app/server/assets/Tooltip-d3y9ESUJ.css +1 -0
- package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/server/assets/USDB-Ckwb6UQw.svg +11 -0
- package/dist/app/server/assets/USDC.e-3nMsKAMC.svg +1 -0
- package/dist/app/server/assets/USDT0-ia60Dw0e.svg +1 -0
- package/dist/app/server/assets/USDY-CB4iet2q.svg +16 -0
- package/dist/app/server/assets/USDe-BXHQCd92.svg +1 -0
- package/dist/app/server/assets/Upgrade-Dbfm2nm0.js +2 -0
- package/dist/app/server/assets/Upgrade-Dbfm2nm0.js.map +1 -0
- package/dist/app/server/assets/WalletUpgrade-C04kW0Jl.css +1 -0
- package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js +2 -0
- package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js.map +1 -0
- package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/server/assets/___-I98bns4o.css +1 -0
- package/dist/app/server/assets/___.flows-Cc-awUoC.js +6 -0
- package/dist/app/server/assets/___.flows-Cc-awUoC.js.map +1 -0
- package/dist/app/server/assets/_tanstack-start-manifest_v-U7TrtUSA.js +1 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows-B1pPOqsM.css +1 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js +2 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js.map +1 -0
- package/dist/app/server/assets/_zyzz_shared-BbDIEd_j.css +1 -0
- package/dist/app/server/assets/alphaUSD-CpCFoVuh.svg +1 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
- package/dist/app/server/assets/async-local-storage-DlOvwxXd.js +2 -0
- package/dist/app/server/assets/async-local-storage-DlOvwxXd.js.map +1 -0
- package/dist/app/server/assets/authorize-BXzTo2Pb.js +2 -0
- package/dist/app/server/assets/authorize-BXzTo2Pb.js.map +1 -0
- package/dist/app/server/assets/authorize-BzoUqOdA.js +2 -0
- package/dist/app/server/assets/authorize-BzoUqOdA.js.map +1 -0
- package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js +56 -0
- package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js.map +1 -0
- package/dist/app/server/assets/authorize-DfjPYJqS.css +1 -0
- package/dist/app/server/assets/betaUSD-9A8AjgYg.svg +1 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
- package/dist/app/server/assets/cUSD-WsQfa-iC.svg +1 -0
- package/dist/app/server/assets/call-dzi0xjZd.js +31 -0
- package/dist/app/server/assets/call-dzi0xjZd.js.map +1 -0
- package/dist/app/server/assets/cbBTC-DvUDqrDi.svg +1 -0
- package/dist/app/server/assets/ccip-DjD8z_3B.js +2 -0
- package/dist/app/server/assets/ccip-DjD8z_3B.js.map +1 -0
- package/dist/app/server/assets/choose-account-_X7xq5am.js +2 -0
- package/dist/app/server/assets/choose-account-_X7xq5am.js.map +1 -0
- package/dist/app/server/assets/choose-account-lqA5SLx9.css +1 -0
- package/dist/app/server/assets/choose-account-zm-5Qs3e.js +2 -0
- package/dist/app/server/assets/choose-account-zm-5Qs3e.js.map +1 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
- package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
- package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
- package/dist/app/server/assets/cookie-DxViaO10.js +2 -0
- package/dist/app/server/assets/cookie-DxViaO10.js.map +1 -0
- package/dist/app/server/assets/core-BBrZXfrB.js +56 -0
- package/dist/app/server/assets/core-BBrZXfrB.js.map +1 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
- package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js +2 -0
- package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js.map +1 -0
- package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js +2 -0
- package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js.map +1 -0
- package/dist/app/server/assets/deposit-BBaNI01u.js +2 -0
- package/dist/app/server/assets/deposit-BBaNI01u.js.map +1 -0
- package/dist/app/server/assets/deposit-LWS6ZTuf.js +2 -0
- package/dist/app/server/assets/deposit-LWS6ZTuf.js.map +1 -0
- package/dist/app/server/assets/deposit-oFx15XCA.css +1 -0
- package/dist/app/server/assets/device-CrXlusjr.js +2 -0
- package/dist/app/server/assets/device-CrXlusjr.js.map +1 -0
- package/dist/app/server/assets/device-DdFMgYe2.js +2 -0
- package/dist/app/server/assets/device-DdFMgYe2.js.map +1 -0
- package/dist/app/server/assets/device-tMCpu5zk.css +1 -0
- package/dist/app/server/assets/dist-CR6FW-yS.js +1 -0
- package/dist/app/server/assets/dist-CoH0hD1s.js +15 -0
- package/dist/app/server/assets/dist-CoH0hD1s.js.map +1 -0
- package/dist/app/server/assets/dist-DcICI3fd.js +2 -0
- package/dist/app/server/assets/dist-DcICI3fd.js.map +1 -0
- package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js +2 -0
- package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js.map +1 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
- package/dist/app/server/assets/error-CXy8gqdE.css +1 -0
- package/dist/app/server/assets/error-DXDT2AHy.js +2 -0
- package/dist/app/server/assets/error-DXDT2AHy.js.map +1 -0
- package/dist/app/server/assets/error-bnVzy9tx.js +2 -0
- package/dist/app/server/assets/error-bnVzy9tx.js.map +1 -0
- package/dist/app/server/assets/esm-C6SW--yt.js +4 -0
- package/dist/app/server/assets/esm-C6SW--yt.js.map +1 -0
- package/dist/app/server/assets/factory-dvoOlKer.js +5 -0
- package/dist/app/server/assets/factory-dvoOlKer.js.map +1 -0
- package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/server/assets/get-id-field-OwLpfjj2.js +6 -0
- package/dist/app/server/assets/get-id-field-OwLpfjj2.js.map +1 -0
- package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js +2 -0
- package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js.map +1 -0
- package/dist/app/server/assets/goUSD-D9kUvHsF.svg +5 -0
- package/dist/app/server/assets/iUSD-CWCJAq9X.svg +1 -0
- package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js +2 -0
- package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js.map +1 -0
- package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js +2 -0
- package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js.map +1 -0
- package/dist/app/server/assets/kysely-adapter-B8tQwTcu.js +1 -0
- package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js +2 -0
- package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js.map +1 -0
- package/dist/app/server/assets/load-server-Dr0IlySo.js +3 -0
- package/dist/app/server/assets/load-server-Dr0IlySo.js.map +1 -0
- package/dist/app/server/assets/login-BLq3tEEr.js +2 -0
- package/dist/app/server/assets/login-BLq3tEEr.js.map +1 -0
- package/dist/app/server/assets/login-DCIrAbED.js +2 -0
- package/dist/app/server/assets/login-DCIrAbED.js.map +1 -0
- package/dist/app/server/assets/login-msDnt3yT.css +1 -0
- package/dist/app/server/assets/matchContext-ByrIUj4L.js +2 -0
- package/dist/app/server/assets/matchContext-ByrIUj4L.js.map +1 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
- package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/server/assets/rUSD-B-xuFS7T.svg +1 -0
- package/dist/app/server/assets/reUSD-CkIUs0Lx.svg +1 -0
- package/dist/app/server/assets/react-dom-DYzj0HXX.js +2 -0
- package/dist/app/server/assets/react-dom-DYzj0HXX.js.map +1 -0
- package/dist/app/server/assets/removable-BCLTvPOx.js +2 -0
- package/dist/app/server/assets/removable-BCLTvPOx.js.map +1 -0
- package/dist/app/server/assets/reset-DZWeTZeQ.js +2 -0
- package/dist/app/server/assets/reset-DZWeTZeQ.js.map +1 -0
- package/dist/app/server/assets/reset-co-CHrff.css +1 -0
- package/dist/app/server/assets/resolveError-CZXXvCJR.js +2 -0
- package/dist/app/server/assets/resolveError-CZXXvCJR.js.map +1 -0
- package/dist/app/server/assets/rolldown-runtime-BWaJ3C7D.js +1 -0
- package/dist/app/server/assets/router-Bqz5X4Qw.js +2 -0
- package/dist/app/server/assets/router-Bqz5X4Qw.js.map +1 -0
- package/dist/app/server/assets/router-CclzitkY.css +1 -0
- package/dist/app/server/assets/routes-BLQdKqcZ.js +2 -0
- package/dist/app/server/assets/routes-BLQdKqcZ.js.map +1 -0
- package/dist/app/server/assets/routes-BgiIzrOt.css +1 -0
- package/dist/app/server/assets/routes-Bv6WzsSR.js +2 -0
- package/dist/app/server/assets/routes-Bv6WzsSR.js.map +1 -0
- package/dist/app/server/assets/sUSDe-j9GOnH7I.svg +1 -0
- package/dist/app/server/assets/schema-check-oLqvHR8y.js +9 -0
- package/dist/app/server/assets/schema-check-oLqvHR8y.js.map +1 -0
- package/dist/app/server/assets/secp256k1-yg8eeIYU.js +2 -0
- package/dist/app/server/assets/secp256k1-yg8eeIYU.js.map +1 -0
- package/dist/app/server/assets/server-RRUiOef2.js +76 -0
- package/dist/app/server/assets/server-RRUiOef2.js.map +1 -0
- package/dist/app/server/assets/siUSD-C10QUNYS.svg +1 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
- package/dist/app/server/assets/start-C63VetBp.js +2 -0
- package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
- package/dist/app/server/assets/stcUSD-DIntDJeh.svg +1 -0
- package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js +2 -0
- package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js.map +1 -0
- package/dist/app/server/assets/syrupUSDC-DhYwZqdM.svg +5 -0
- package/dist/app/server/assets/thetaUSD-Dgmksf6G.svg +1 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
- package/dist/app/server/assets/useNavigate-D6d1w7KE.js +2 -0
- package/dist/app/server/assets/useNavigate-D6d1w7KE.js.map +1 -0
- package/dist/app/server/assets/useQuery-BRpCr5vj.js +2 -0
- package/dist/app/server/assets/useQuery-BRpCr5vj.js.map +1 -0
- package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js +2 -0
- package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js.map +1 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
- package/dist/app/server/assets/utils-D57zfcg-.js +2 -0
- package/dist/app/server/assets/utils-D57zfcg-.js.map +1 -0
- package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js +2 -0
- package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js.map +1 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js +2 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js.map +1 -0
- package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/server/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
- package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js +2 -0
- package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js.map +1 -0
- package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js +2 -0
- package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js.map +1 -0
- package/dist/app/server/assets/zyzz-6R2K52xP.css +1 -0
- package/dist/app/server/assets/zyzz.config-CJRpjn0E.js +3 -0
- package/dist/app/server/assets/zyzz.config-CJRpjn0E.js.map +1 -0
- package/dist/app/server/index.js +532 -0
- package/dist/app/server/index.js.map +1 -0
- package/dist/app/server/wrangler.json +1 -0
- package/dist/cli/Admin.d.ts +34 -0
- package/dist/cli/Admin.d.ts.map +1 -0
- package/dist/cli/Admin.js +61 -0
- package/dist/cli/Admin.js.map +1 -0
- package/dist/cli/Apps.d.ts +9 -0
- package/dist/cli/Apps.d.ts.map +1 -0
- package/dist/cli/Apps.js +34 -0
- package/dist/cli/Apps.js.map +1 -0
- package/dist/cli/Cli.d.ts +13 -0
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +26 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/Project.d.ts +17 -0
- package/dist/cli/Project.d.ts.map +1 -0
- package/dist/cli/Project.js +90 -0
- package/dist/cli/Project.js.map +1 -0
- package/dist/cli/Realms.d.ts +24 -0
- package/dist/cli/Realms.d.ts.map +1 -0
- package/dist/cli/Realms.js +48 -0
- package/dist/cli/Realms.js.map +1 -0
- package/dist/cli/Session.d.ts +79 -0
- package/dist/cli/Session.d.ts.map +1 -0
- package/dist/cli/Session.js +229 -0
- package/dist/cli/Session.js.map +1 -0
- package/dist/cli/User.d.ts +24 -0
- package/dist/cli/User.d.ts.map +1 -0
- package/dist/cli/User.js +34 -0
- package/dist/cli/User.js.map +1 -0
- package/dist/cli/V1.d.ts +32 -0
- package/dist/cli/V1.d.ts.map +1 -0
- package/dist/cli/V1.js +38 -0
- package/dist/cli/V1.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +46 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin/apps/create.d.ts +23 -0
- package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/create.js +84 -0
- package/dist/cli/commands/admin/apps/create.js.map +1 -0
- package/dist/cli/commands/admin/apps/delete.d.ts +15 -0
- package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/delete.js +41 -0
- package/dist/cli/commands/admin/apps/delete.js.map +1 -0
- package/dist/cli/commands/admin/apps/index.d.ts +5 -0
- package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/index.js +14 -0
- package/dist/cli/commands/admin/apps/index.js.map +1 -0
- package/dist/cli/commands/admin/apps/list.d.ts +10 -0
- package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/list.js +26 -0
- package/dist/cli/commands/admin/apps/list.js.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts +17 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
- package/dist/cli/commands/admin/apps/update.d.ts +20 -0
- package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/update.js +71 -0
- package/dist/cli/commands/admin/apps/update.js.map +1 -0
- package/dist/cli/commands/admin/index.d.ts +5 -0
- package/dist/cli/commands/admin/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/index.js +13 -0
- package/dist/cli/commands/admin/index.js.map +1 -0
- package/dist/cli/commands/admin/migrate.d.ts +10 -0
- package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
- package/dist/cli/commands/admin/migrate.js +20 -0
- package/dist/cli/commands/admin/migrate.js.map +1 -0
- package/dist/cli/commands/admin/realms/add.d.ts +13 -0
- package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/add.js +42 -0
- package/dist/cli/commands/admin/realms/add.js.map +1 -0
- package/dist/cli/commands/admin/realms/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/index.js +13 -0
- package/dist/cli/commands/admin/realms/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/list.d.ts +14 -0
- package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/list.js +36 -0
- package/dist/cli/commands/admin/realms/list.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts +17 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.js +13 -0
- package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts +19 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.js +66 -0
- package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/remove.d.ts +12 -0
- package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/remove.js +35 -0
- package/dist/cli/commands/admin/realms/remove.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +16 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +16 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/set.d.ts +17 -0
- package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/set.js +46 -0
- package/dist/cli/commands/admin/realms/set.js.map +1 -0
- package/dist/cli/commands/admin/rotate-key.d.ts +16 -0
- package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
- package/dist/cli/commands/admin/rotate-key.js +46 -0
- package/dist/cli/commands/admin/rotate-key.js.map +1 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +34 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +12 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +29 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +8 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +19 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +12 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +24 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/client/Actions.d.ts +108 -0
- package/dist/client/Actions.d.ts.map +1 -0
- package/dist/client/Actions.js +94 -0
- package/dist/client/Actions.js.map +1 -0
- package/dist/client/Auth.d.ts +143 -0
- package/dist/client/Auth.d.ts.map +1 -0
- package/dist/client/Auth.js +106 -0
- package/dist/client/Auth.js.map +1 -0
- package/dist/client/Authorization.d.ts +29 -0
- package/dist/client/Authorization.d.ts.map +1 -0
- package/dist/client/Authorization.js +12 -0
- package/dist/client/Authorization.js.map +1 -0
- package/dist/client/Decorator.d.ts +172 -0
- package/dist/client/Decorator.d.ts.map +1 -0
- package/dist/client/Decorator.js +241 -0
- package/dist/client/Decorator.js.map +1 -0
- package/dist/client/Key.d.ts +82 -0
- package/dist/client/Key.d.ts.map +1 -0
- package/dist/client/Key.js +81 -0
- package/dist/client/Key.js.map +1 -0
- package/dist/client/Pending.d.ts +38 -0
- package/dist/client/Pending.d.ts.map +1 -0
- package/dist/client/Pending.js +12 -0
- package/dist/client/Pending.js.map +1 -0
- package/dist/client/Permissions.d.ts +36 -0
- package/dist/client/Permissions.d.ts.map +1 -0
- package/dist/client/Permissions.js +16 -0
- package/dist/client/Permissions.js.map +1 -0
- package/dist/client/Storage.d.ts +27 -0
- package/dist/client/Storage.d.ts.map +1 -0
- package/dist/client/Storage.js +16 -0
- package/dist/client/Storage.js.map +1 -0
- package/dist/client/TempoAccount.d.ts +52 -0
- package/dist/client/TempoAccount.d.ts.map +1 -0
- package/dist/client/TempoAccount.js +17 -0
- package/dist/client/TempoAccount.js.map +1 -0
- package/dist/client/Tokens.d.ts +25 -0
- package/dist/client/Tokens.d.ts.map +1 -0
- package/dist/client/Tokens.js +12 -0
- package/dist/client/Tokens.js.map +1 -0
- package/dist/client/User.d.ts +21 -0
- package/dist/client/User.d.ts.map +1 -0
- package/dist/client/User.js +12 -0
- package/dist/client/User.js.map +1 -0
- package/dist/client/actions/account.d.ts +75 -0
- package/dist/client/actions/account.d.ts.map +1 -0
- package/dist/client/actions/account.js +102 -0
- package/dist/client/actions/account.js.map +1 -0
- package/dist/client/actions/device.d.ts +52 -0
- package/dist/client/actions/device.d.ts.map +1 -0
- package/dist/client/actions/device.js +103 -0
- package/dist/client/actions/device.js.map +1 -0
- package/dist/client/actions/email.d.ts +89 -0
- package/dist/client/actions/email.d.ts.map +1 -0
- package/dist/client/actions/email.js +86 -0
- package/dist/client/actions/email.js.map +1 -0
- package/dist/client/actions/oauth.d.ts +112 -0
- package/dist/client/actions/oauth.d.ts.map +1 -0
- package/dist/client/actions/oauth.js +103 -0
- package/dist/client/actions/oauth.js.map +1 -0
- package/dist/client/actions/passkey.d.ts +140 -0
- package/dist/client/actions/passkey.d.ts.map +1 -0
- package/dist/client/actions/passkey.js +170 -0
- package/dist/client/actions/passkey.js.map +1 -0
- package/dist/client/actions/realm.d.ts +25 -0
- package/dist/client/actions/realm.d.ts.map +1 -0
- package/dist/client/actions/realm.js +16 -0
- package/dist/client/actions/realm.js.map +1 -0
- package/dist/client/actions/redirect.d.ts +152 -0
- package/dist/client/actions/redirect.d.ts.map +1 -0
- package/dist/client/actions/redirect.js +311 -0
- package/dist/client/actions/redirect.js.map +1 -0
- package/dist/client/internal/accessKey.d.ts +21 -0
- package/dist/client/internal/accessKey.d.ts.map +1 -0
- package/dist/client/internal/accessKey.js +38 -0
- package/dist/client/internal/accessKey.js.map +1 -0
- package/dist/client/internal/account.d.ts +17 -0
- package/dist/client/internal/account.d.ts.map +1 -0
- package/dist/client/internal/account.js +3 -0
- package/dist/client/internal/account.js.map +1 -0
- package/dist/client/internal/api.d.ts +110 -0
- package/dist/client/internal/api.d.ts.map +1 -0
- package/dist/client/internal/api.js +136 -0
- package/dist/client/internal/api.js.map +1 -0
- package/dist/client/internal/headless.d.ts +159 -0
- package/dist/client/internal/headless.d.ts.map +1 -0
- package/dist/client/internal/headless.js +196 -0
- package/dist/client/internal/headless.js.map +1 -0
- package/dist/client/internal/indexedDb.d.ts +8 -0
- package/dist/client/internal/indexedDb.d.ts.map +1 -0
- package/dist/client/internal/indexedDb.js +32 -0
- package/dist/client/internal/indexedDb.js.map +1 -0
- package/dist/client/internal/request.d.ts +56 -0
- package/dist/client/internal/request.d.ts.map +1 -0
- package/dist/client/internal/request.js +44 -0
- package/dist/client/internal/request.js.map +1 -0
- package/dist/client/internal/store.d.ts +12 -0
- package/dist/client/internal/store.d.ts.map +1 -0
- package/dist/client/internal/store.js +15 -0
- package/dist/client/internal/store.js.map +1 -0
- package/dist/client/internal/verifier.d.ts +25 -0
- package/dist/client/internal/verifier.d.ts.map +1 -0
- package/dist/client/internal/verifier.js +52 -0
- package/dist/client/internal/verifier.js.map +1 -0
- package/dist/client.d.ts +18 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +18 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Apps.d.ts +3169 -0
- package/dist/internal/Apps.d.ts.map +1 -0
- package/dist/internal/Apps.js +948 -0
- package/dist/internal/Apps.js.map +1 -0
- package/dist/internal/Auth.d.ts +4287 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +185 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Authorize.d.ts +526 -0
- package/dist/internal/Authorize.d.ts.map +1 -0
- package/dist/internal/Authorize.js +330 -0
- package/dist/internal/Authorize.js.map +1 -0
- package/dist/internal/Cache.d.ts +56 -0
- package/dist/internal/Cache.d.ts.map +1 -0
- package/dist/internal/Cache.js +65 -0
- package/dist/internal/Cache.js.map +1 -0
- package/dist/internal/Chain.d.ts +738 -0
- package/dist/internal/Chain.d.ts.map +1 -0
- package/dist/internal/Chain.js +65 -0
- package/dist/internal/Chain.js.map +1 -0
- package/dist/internal/ChainList.d.ts +117 -0
- package/dist/internal/ChainList.d.ts.map +1 -0
- package/dist/internal/ChainList.js +148 -0
- package/dist/internal/ChainList.js.map +1 -0
- package/dist/internal/ChainName.d.ts +11 -0
- package/dist/internal/ChainName.d.ts.map +1 -0
- package/dist/internal/ChainName.js +13 -0
- package/dist/internal/ChainName.js.map +1 -0
- package/dist/internal/CodeEmail.d.ts +38 -0
- package/dist/internal/CodeEmail.d.ts.map +1 -0
- package/dist/internal/CodeEmail.js +85 -0
- package/dist/internal/CodeEmail.js.map +1 -0
- package/dist/internal/ConfigurableAccount.d.ts +600 -0
- package/dist/internal/ConfigurableAccount.d.ts.map +1 -0
- package/dist/internal/ConfigurableAccount.js +795 -0
- package/dist/internal/ConfigurableAccount.js.map +1 -0
- package/dist/internal/Device.d.ts +246 -0
- package/dist/internal/Device.d.ts.map +1 -0
- package/dist/internal/Device.js +257 -0
- package/dist/internal/Device.js.map +1 -0
- package/dist/internal/Env.d.ts +97 -0
- package/dist/internal/Env.d.ts.map +1 -0
- package/dist/internal/Env.js +2 -0
- package/dist/internal/Env.js.map +1 -0
- package/dist/internal/ErrorResponse.d.ts +608 -0
- package/dist/internal/ErrorResponse.d.ts.map +1 -0
- package/dist/internal/ErrorResponse.js +701 -0
- package/dist/internal/ErrorResponse.js.map +1 -0
- package/dist/internal/Id.d.ts +10 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +34 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/KeyAuthorization.d.ts +1650 -0
- package/dist/internal/KeyAuthorization.d.ts.map +1 -0
- package/dist/internal/KeyAuthorization.js +1187 -0
- package/dist/internal/KeyAuthorization.js.map +1 -0
- package/dist/internal/Limits.d.ts +70 -0
- package/dist/internal/Limits.d.ts.map +1 -0
- package/dist/internal/Limits.js +36 -0
- package/dist/internal/Limits.js.map +1 -0
- package/dist/internal/Log.d.ts +34 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +99 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/LogLine.d.ts +29 -0
- package/dist/internal/LogLine.d.ts.map +1 -0
- package/dist/internal/LogLine.js +50 -0
- package/dist/internal/LogLine.js.map +1 -0
- package/dist/internal/Migrations.d.ts +28 -0
- package/dist/internal/Migrations.d.ts.map +1 -0
- package/dist/internal/Migrations.js +82 -0
- package/dist/internal/Migrations.js.map +1 -0
- package/dist/internal/Owner.d.ts +230 -0
- package/dist/internal/Owner.d.ts.map +1 -0
- package/dist/internal/Owner.js +101 -0
- package/dist/internal/Owner.js.map +1 -0
- package/dist/internal/Passkey.d.ts +901 -0
- package/dist/internal/Passkey.d.ts.map +1 -0
- package/dist/internal/Passkey.js +1185 -0
- package/dist/internal/Passkey.js.map +1 -0
- package/dist/internal/PendingKey.d.ts +49 -0
- package/dist/internal/PendingKey.d.ts.map +1 -0
- package/dist/internal/PendingKey.js +58 -0
- package/dist/internal/PendingKey.js.map +1 -0
- package/dist/internal/Privy.d.ts +138 -0
- package/dist/internal/Privy.d.ts.map +1 -0
- package/dist/internal/Privy.js +285 -0
- package/dist/internal/Privy.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +218 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +209 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Realm.d.ts +290 -0
- package/dist/internal/Realm.d.ts.map +1 -0
- package/dist/internal/Realm.js +502 -0
- package/dist/internal/Realm.js.map +1 -0
- package/dist/internal/RequestId.d.ts +16 -0
- package/dist/internal/RequestId.d.ts.map +1 -0
- package/dist/internal/RequestId.js +78 -0
- package/dist/internal/RequestId.js.map +1 -0
- package/dist/internal/SigningKey.d.ts +126 -0
- package/dist/internal/SigningKey.d.ts.map +1 -0
- package/dist/internal/SigningKey.js +221 -0
- package/dist/internal/SigningKey.js.map +1 -0
- package/dist/internal/TempoAccount.d.ts +181 -0
- package/dist/internal/TempoAccount.d.ts.map +1 -0
- package/dist/internal/TempoAccount.js +369 -0
- package/dist/internal/TempoAccount.js.map +1 -0
- package/dist/internal/TestInbox.d.ts +42 -0
- package/dist/internal/TestInbox.d.ts.map +1 -0
- package/dist/internal/TestInbox.js +20 -0
- package/dist/internal/TestInbox.js.map +1 -0
- package/dist/internal/Timing.d.ts +52 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +116 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Validation.d.ts +52 -0
- package/dist/internal/Validation.d.ts.map +1 -0
- package/dist/internal/Validation.js +22 -0
- package/dist/internal/Validation.js.map +1 -0
- package/dist/internal/Verification.d.ts +24 -0
- package/dist/internal/Verification.d.ts.map +1 -0
- package/dist/internal/Verification.js +37 -0
- package/dist/internal/Verification.js.map +1 -0
- package/dist/internal/Wallet.d.ts +66 -0
- package/dist/internal/Wallet.d.ts.map +1 -0
- package/dist/internal/Wallet.js +59 -0
- package/dist/internal/Wallet.js.map +1 -0
- package/dist/internal/owners/Passkey.d.ts +9 -0
- package/dist/internal/owners/Passkey.d.ts.map +1 -0
- package/dist/internal/owners/Passkey.js +58 -0
- package/dist/internal/owners/Passkey.js.map +1 -0
- package/dist/internal/owners/Privy.d.ts +13 -0
- package/dist/internal/owners/Privy.d.ts.map +1 -0
- package/dist/internal/owners/Privy.js +59 -0
- package/dist/internal/owners/Privy.js.map +1 -0
- package/dist/internal/owners/Secp256k1.d.ts +12 -0
- package/dist/internal/owners/Secp256k1.d.ts.map +1 -0
- package/dist/internal/owners/Secp256k1.js +99 -0
- package/dist/internal/owners/Secp256k1.js.map +1 -0
- package/dist/worker.d.ts +18 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +18 -0
- package/dist/worker.js.map +1 -0
- package/package.json +83 -3
- package/src/Api.ts +157 -0
- package/src/App.ts +316 -0
- package/src/api/account.ts +2266 -0
- package/src/api/authenticate.ts +1662 -0
- package/src/api/authorize.ts +1086 -0
- package/src/api/device.ts +516 -0
- package/src/api/health.ts +72 -0
- package/src/api/lib/AccountStep.ts +485 -0
- package/src/api/lib/Auth.ts +164 -0
- package/src/api/lib/Configure.ts +921 -0
- package/src/api/lib/Consent.ts +388 -0
- package/src/api/lib/Cors.ts +160 -0
- package/src/api/lib/Database.ts +10 -0
- package/src/api/lib/DeviceRequest.ts +244 -0
- package/src/api/lib/FirstAccount.ts +136 -0
- package/src/api/lib/Headless.ts +616 -0
- package/src/api/lib/IsolateCache.ts +28 -0
- package/src/api/lib/KeySigner.ts +690 -0
- package/src/api/lib/PasskeyLink.ts +162 -0
- package/src/api/lib/Session.ts +64 -0
- package/src/api/lib/SignInConsent.ts +393 -0
- package/src/api/oauth.ts +1796 -0
- package/src/app/components/CodeInput.tsx +153 -0
- package/src/app/components/DevTools.tsx +1071 -0
- package/src/app/components/Grant.tsx +476 -0
- package/src/app/components/icons/BRLA.png +0 -0
- package/src/app/components/icons/BRZ.svg +1 -0
- package/src/app/components/icons/CHFAU.png +0 -0
- package/src/app/components/icons/DLUSD.png +0 -0
- package/src/app/components/icons/EURAU.svg +1 -0
- package/src/app/components/icons/EURC.e.svg +1 -0
- package/src/app/components/icons/GBPA.svg +4 -0
- package/src/app/components/icons/GUSD.svg +1 -0
- package/src/app/components/icons/MACH.svg +4 -0
- package/src/app/components/icons/OUSD.svg +5 -0
- package/src/app/components/icons/PRIME.svg +14 -0
- package/src/app/components/icons/SBC.svg +1 -0
- package/src/app/components/icons/SEKAU.svg +5 -0
- package/src/app/components/icons/USD1.svg +30 -0
- package/src/app/components/icons/USDB.svg +11 -0
- package/src/app/components/icons/USDC.e.svg +1 -0
- package/src/app/components/icons/USDT0.svg +1 -0
- package/src/app/components/icons/USDY.svg +16 -0
- package/src/app/components/icons/USDe.svg +1 -0
- package/src/app/components/icons/YLDS.svg +3 -0
- package/src/app/components/icons/alphaUSD.svg +1 -0
- package/src/app/components/icons/betaUSD.svg +1 -0
- package/src/app/components/icons/cUSD.svg +1 -0
- package/src/app/components/icons/cbBTC.svg +1 -0
- package/src/app/components/icons/frxUSD.svg +1 -0
- package/src/app/components/icons/goUSD.svg +5 -0
- package/src/app/components/icons/iUSD.svg +1 -0
- package/src/app/components/icons/pathUSD.svg +25 -0
- package/src/app/components/icons/rUSD.svg +1 -0
- package/src/app/components/icons/reUSD.svg +1 -0
- package/src/app/components/icons/sUSDe.svg +1 -0
- package/src/app/components/icons/siUSD.svg +1 -0
- package/src/app/components/icons/stcUSD.svg +1 -0
- package/src/app/components/icons/syrupUSDC.svg +5 -0
- package/src/app/components/icons/thetaUSD.svg +1 -0
- package/src/app/components/icons/wYLDS.svg +10 -0
- package/src/app/components/icons/wsrUSD.svg +1 -0
- package/src/app/components/logos/OUSD.dark.svg +17 -0
- package/src/app/components/logos/OUSD.light.svg +17 -0
- package/src/app/coverage.server.ts +73 -0
- package/src/app/coverage.ts +69 -0
- package/src/app/crons/cleanup.ts +104 -0
- package/src/app/db/auth.ts +440 -0
- package/src/app/db/migrations/0000_better_auth.sql +53 -0
- package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
- package/src/app/db/migrations/0002_device_code.sql +17 -0
- package/src/app/db/migrations/0003_realms.sql +27 -0
- package/src/app/db/migrations/0004_default_realm.sql +2 -0
- package/src/app/db/migrations/0005_passkeys.sql +30 -0
- package/src/app/db/migrations/0006_first_accounts.sql +9 -0
- package/src/app/db/migrations/0007_pending_keys.sql +13 -0
- package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
- package/src/app/db/migrations/0009_device_requests.sql +8 -0
- package/src/app/db/migrations/0010_device_keys.sql +4 -0
- package/src/app/db/migrations/0011_registered_passkeys.sql +2 -0
- package/src/app/db/migrations/0012_passkey_accounts.sql +7 -0
- package/src/app/db/migrations/0013_first_party_apps.sql +4 -0
- package/src/app/db/migrations/0014_logout_revokes_tokens.sql +17 -0
- package/src/app/db/migrations/0015_expiry_indexes.sql +9 -0
- package/src/app/db/migrations/0016_configurable_accounts.sql +15 -0
- package/src/app/db/migrations/0017_account_config_keys.sql +3 -0
- package/src/app/db/migrations/0018_better_auth_1_8.sql +9 -0
- package/src/app/db/migrations/0019_drop_provider_account_index.sql +1 -0
- package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
- package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
- package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
- package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
- package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
- package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
- package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
- package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
- package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0011_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0012_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0013_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0014_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0015_snapshot.json +2375 -0
- package/src/app/db/migrations/meta/0016_snapshot.json +2475 -0
- package/src/app/db/migrations/meta/0017_snapshot.json +2481 -0
- package/src/app/db/migrations/meta/0018_snapshot.json +2535 -0
- package/src/app/db/migrations/meta/0019_snapshot.json +2514 -0
- package/src/app/db/migrations/meta/_journal.json +146 -0
- package/src/app/db/schema.ts +241 -0
- package/src/app/db/table.ts +31 -0
- package/src/app/env.ts +57 -0
- package/src/app/inbox.ts +190 -0
- package/src/app/lib/Client.ts +82 -0
- package/src/app/lib/Inbox.ts +11 -0
- package/src/app/lib/Loader.ts +21 -0
- package/src/app/lib/Upgrade.ts +221 -0
- package/src/app/package.json +8 -0
- package/src/app/public/_headers +4 -0
- package/src/app/routeTree.gen.ts +219 -0
- package/src/app/router.tsx +47 -0
- package/src/app/routes/[_].flows.tsx +4254 -0
- package/src/app/routes/__root.tsx +172 -0
- package/src/app/routes/authorize.tsx +379 -0
- package/src/app/routes/choose-account.tsx +144 -0
- package/src/app/routes/deposit.tsx +107 -0
- package/src/app/routes/device.tsx +273 -0
- package/src/app/routes/error.tsx +62 -0
- package/src/app/routes/index.tsx +511 -0
- package/src/app/routes/login.tsx +577 -0
- package/src/app/screens/Account.tsx +559 -0
- package/src/app/screens/Approval.tsx +444 -0
- package/src/app/screens/ChooseAccount.tsx +206 -0
- package/src/app/screens/Deposit.tsx +523 -0
- package/src/app/screens/DeviceApproval.tsx +500 -0
- package/src/app/screens/NotFound.tsx +62 -0
- package/src/app/screens/SignIn.tsx +372 -0
- package/src/app/screens/WalletUpgrade.tsx +121 -0
- package/src/app/screens/chains/base.svg +3 -0
- package/src/app/screens/chains/ethereum.svg +11 -0
- package/src/app/screens/chains/solana.svg +4 -0
- package/src/app/screens/chains/tempo.svg +4 -0
- package/src/app/server.ts +342 -0
- package/src/app/vite.config.ts +128 -0
- package/src/app/void.config.ts +36 -0
- package/src/app/wallet.ts +69 -0
- package/src/app/zyzz.config.ts +52 -0
- package/src/cli/Admin.ts +74 -0
- package/src/cli/Apps.ts +27 -0
- package/src/cli/Cli.ts +41 -0
- package/src/cli/Project.ts +119 -0
- package/src/cli/Realms.ts +49 -0
- package/src/cli/Session.ts +290 -0
- package/src/cli/User.ts +40 -0
- package/src/cli/V1.ts +54 -0
- package/src/cli/bin.ts +44 -0
- package/src/cli/commands/admin/apps/create.ts +96 -0
- package/src/cli/commands/admin/apps/delete.ts +38 -0
- package/src/cli/commands/admin/apps/index.ts +15 -0
- package/src/cli/commands/admin/apps/list.ts +25 -0
- package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
- package/src/cli/commands/admin/apps/update.ts +79 -0
- package/src/cli/commands/admin/index.ts +14 -0
- package/src/cli/commands/admin/migrate.ts +19 -0
- package/src/cli/commands/admin/realms/add.ts +40 -0
- package/src/cli/commands/admin/realms/index.ts +14 -0
- package/src/cli/commands/admin/realms/list.ts +38 -0
- package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
- package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
- package/src/cli/commands/admin/realms/privy/index.ts +14 -0
- package/src/cli/commands/admin/realms/privy/set.ts +69 -0
- package/src/cli/commands/admin/realms/remove.ts +33 -0
- package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
- package/src/cli/commands/admin/realms/set.ts +46 -0
- package/src/cli/commands/admin/rotate-key.ts +47 -0
- package/src/cli/commands/init.ts +42 -0
- package/src/cli/commands/login.ts +32 -0
- package/src/cli/commands/logout.ts +19 -0
- package/src/cli/commands/whoami.ts +23 -0
- package/src/client/Actions.ts +180 -0
- package/src/client/Auth.ts +267 -0
- package/src/client/Authorization.ts +34 -0
- package/src/client/Decorator.ts +444 -0
- package/src/client/Key.ts +137 -0
- package/src/client/Pending.ts +45 -0
- package/src/client/Permissions.ts +41 -0
- package/src/client/Storage.ts +29 -0
- package/src/client/TempoAccount.ts +55 -0
- package/src/client/Tokens.ts +27 -0
- package/src/client/User.ts +23 -0
- package/src/client/actions/account.ts +171 -0
- package/src/client/actions/device.ts +166 -0
- package/src/client/actions/email.ts +164 -0
- package/src/client/actions/oauth.ts +179 -0
- package/src/client/actions/passkey.ts +333 -0
- package/src/client/actions/realm.ts +37 -0
- package/src/client/actions/redirect.ts +502 -0
- package/src/client/internal/accessKey.ts +54 -0
- package/src/client/internal/account.ts +18 -0
- package/src/client/internal/api.ts +242 -0
- package/src/client/internal/headless.ts +308 -0
- package/src/client/internal/indexedDb.ts +44 -0
- package/src/client/internal/request.ts +70 -0
- package/src/client/internal/store.ts +20 -0
- package/src/client/internal/verifier.ts +75 -0
- package/src/client.ts +17 -0
- package/src/index.ts +5 -0
- package/src/internal/Apps.ts +1283 -0
- package/src/internal/Auth.ts +273 -0
- package/src/internal/Authorize.ts +433 -0
- package/src/internal/Balance.ts +144 -0
- package/src/internal/BodyLimit.ts +31 -0
- package/src/internal/Cache.ts +119 -0
- package/src/internal/Chain.ts +99 -0
- package/src/internal/ChainList.ts +270 -0
- package/src/internal/ChainName.ts +14 -0
- package/src/internal/ChainStatus.ts +65 -0
- package/src/internal/CodeEmail.ts +138 -0
- package/src/internal/ConfigurableAccount.ts +1315 -0
- package/src/internal/Device.ts +471 -0
- package/src/internal/Env.ts +92 -0
- package/src/internal/ErrorResponse.ts +896 -0
- package/src/internal/Faucet.ts +43 -0
- package/src/internal/Id.ts +41 -0
- package/src/internal/KeyAuthorization.ts +1536 -0
- package/src/internal/Limits.ts +40 -0
- package/src/internal/Log.ts +166 -0
- package/src/internal/LogLine.ts +81 -0
- package/src/internal/Logout.ts +356 -0
- package/src/internal/Migrations.ts +120 -0
- package/src/internal/OpenApi.ts +300 -0
- package/src/internal/Owner.ts +310 -0
- package/src/internal/Passkey.ts +1904 -0
- package/src/internal/PendingKey.ts +104 -0
- package/src/internal/Privy.ts +536 -0
- package/src/internal/RateLimit.ts +346 -0
- package/src/internal/Realm.ts +814 -0
- package/src/internal/RequestId.ts +118 -0
- package/src/internal/SignInGrant.ts +175 -0
- package/src/internal/SigningKey.ts +319 -0
- package/src/internal/TempoAccount.ts +545 -0
- package/src/internal/TestInbox.ts +51 -0
- package/src/internal/Timing.ts +172 -0
- package/src/internal/Validation.ts +52 -0
- package/src/internal/Verification.ts +58 -0
- package/src/internal/Wallet.ts +101 -0
- package/src/internal/owners/Passkey.ts +76 -0
- package/src/internal/owners/Privy.ts +82 -0
- package/src/internal/owners/Secp256k1.ts +139 -0
- package/src/types/app.d.ts +39 -0
- package/src/worker.ts +17 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-Bv6WzsSR.js","names":["ownerWindow","_formatErrorMessage","isFocusVisible","frontmostHeight","ownerWindow","isFocusVisible","ToastViewportCssVars.frontmostHeight","_formatErrorMessage","TransitionStatusDataAttributes.startingStyle","TransitionStatusDataAttributes.endingStyle","ToastRootDataAttributes.swipeDirection","offsetY","ToastRootCssVars.swipeMovementX","ToastRootCssVars.swipeMovementY","ToastRootCssVars.index","ToastRootCssVars.offsetY","ToastRootCssVars.height","_jsx","BaseUi.Toast.Provider","BaseUi.Toast.useToastManager","BaseUi.Toast.Portal","BaseUi.Toast.Viewport","styles","BaseUi.Toast.Root","_jsxs","BaseUi.Toast.Content","BaseUi.Toast.Title","BaseUi.Toast.Description","BaseUi.Toast.Action","BaseUi.Toast.Close","createFileRoute","parseResponse","Client","Loader","style","CeremonyError","Error","name","Route","component","lazyRouteComponent","$$splitComponentImporter","loader","match","Promise","Page","Props","client","create","requested","deps","chain","read","Chain","v1","account","$get","query","catch","error","first","unknown","reason","signIn","redirect","href","session","methods","all","auth","passkeys","user","accountError","failure","accounts","configurable","email","faucet","listed","tempo","length","$post","json","listing","chains","i","found","find","entry","unlinked","flatMap","owner","config","owners","candidate","toLowerCase","address","balance","chainId","undefined","type","map","credentialId","const","loaderDeps","search","message","styles","page","ReturnType","Client.create","Client.reason","Client.message","__toESM","require_react","require_jsx_runtime","require_react_dom","AlertCircle","AlertTriangle","InfoCircle","CheckCircle","createFileRoute","lazyRouteComponent","reason","create","parseResponse","message","useStableCallback","useRefWithInit","closest","transitionStatusMapping","visuallyHidden","contains","matchesFocusVisible","useRenderElement","LEGACY_SWIPE_IGNORE_SELECTOR","activeElement","ownerDocument","formatErrorMessage","useTimeout","useButton","useOpenChangeComplete","useId","create$1","ReactStore","FloatingPortalLite","getWindow","addEventListener","FocusGuard","getTarget","mergeCleanups","inertValue","useIsoLayoutEffect","BASE_UI_SWIPE_IGNORE_SELECTOR","useOnMount","Timeout","Close","redirect","import_react","import_jsx_runtime","import_react_dom","getElementTransform","transform","computedStyle","element","translateX","translateY","scale","matrix","values","getDisplacement","direction","deltaY","deltaX","ToastContext","useToastProviderContext","context","counter","generateId","prefix","resolvePromiseOptions","options","resolvedOptions","result","createToastMetadata","metadata","visibleIndex","offsetY","toasts","isEnding","toast","toastIndex","applyLimited","activeIndex","limited","limit","selectors","state","id","ToastStore","initialState","viewport","limitChanged","timeout","updates","newToasts","timer","index","toastId","skipOnRemove","existingToast","ignoredId","ignoredTransitionStatus","toastToAdd","updatedToasts","duration","prevToast","nextToast","markUpdated","nextTimeout","prevTimeout","timeoutUpdated","shouldHaveTimer","hasTimer","timeoutChanged","wasLoading","resetTimer","closeAll","toastsToClose","item","loadingOptions","handledPromise","promiseValue","successOptions","errorOptions","error","event","target","start","currentTimeout","delay","callback","clearInteraction","activeEl","currentIndex","scan","from","step","ToastProvider","props","store","toastManager","action","ToastProviderPropsSynchronizer","children","frontmostHeight","ToastViewport","elementProps","componentProps","windowFocusTimeout","handlingFocusGuardRef","markedReadyForMouseLeaveRef","touchActiveRef","isEmpty","focused","expanded","prevFocusElement","frontmostHeight$1","hasTransitioningToasts","highPriorityToasts","win","doc","handleGlobalKeyDown","handleWindowBlur","handleWindowFocus","handleFocusGuard","firstFocusableToast","handleKeyDown","flushMouseLeave","handleMouseEnter","handleMouseLeave","handlePointerDown","handlePointerEnd","handleFocus","handleBlur","defaultProps","focusGuard","forwardedRef","ToastRootContext","useToastRootContext","height","swipeMovementX","swipeMovementY","swipeDirection","toastRootStateAttributesMapping","value","SWIPE_THRESHOLD","REVERSE_CANCEL_THRESHOLD","OPPOSITE_DIRECTION_DAMPING_FACTOR","MIN_DRAG_THRESHOLD","TOAST_SWIPE_IGNORE_SELECTOR","ToastRoot","isAnchored","swipeDirections","swipeEnabled","currentSwipeDirection","setCurrentSwipeDirection","isSwiping","setIsSwiping","isRealSwipe","setIsRealSwipe","dragOffset","setDragOffset","initialTransform","setInitialTransform","titleId","setTitleId","descriptionId","setDescriptionId","lockedDirection","setLockedDirection","rootRef","lastToastIdRef","dragStartPosRef","initialTransformRef","intendedSwipeDirectionRef","maxSwipeDisplacementRef","cancelledSwipeRef","swipeCancelBaselineRef","isFirstPointerMoveRef","dragOffsetRef","activePointerIdRef","dragAbortControllerRef","domIndex","offsetY$1","recalculateHeight","previousHeight","update","flushSync","previousToastId","setResolvedDragOffset","nextDragOffset","applyDirectionalDamping","damp","delta","dampX","dampY","handleSwipeEnd","resolvedInitialTransform","resolvedDragOffset","dismissDirection","dragAbortController","handlePointerMove","movementY","clientY","movementX","clientX","cancelDeltaY","cancelDeltaX","resolvedLockedDirection","hasHorizontal","hasVertical","candidate","currentDisplacement","dampedDelta","newOffsetX","newOffsetY","hasHorizontalDir","hasVerticalDir","preventDefaultTouchStart","getDragStyles","isHighPriority","toastRoot","ToastContent","contentRef","node","resizeObserver","mutationObserver","isRenderableNode","hasRenderableChildren","useToastLabelPart","setId","part","childrenProp","idProp","useToastLabelElement","shouldRender","currentId","ToastDescription","ToastTitle","ToastClose","hasFocus","setHasFocus","nativeButton","buttonRef","getButtonProps","ToastAction","computedChildren","ToastPortal","useToastManager","icons","Toast","Provider","useToast","manager","rest","intent","Viewport","attributes","styles$1","Glyph","external","input","style","vars","inline","className","\"intent\"","Route","client","requested","match","read","first","unknown","chain","account","signIn","session","methods","failure","user","listed","listing","found","chains","entry","unlinked","owner","styles"],"sources":["../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/getElementTransform.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/useSwipeDismiss.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/provider/ToastProviderContext.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/generateId.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/utils/resolvePromiseOptions.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/store.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/provider/ToastProvider.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/viewport/ToastViewportCssVars.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/viewport/ToastViewport.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/root/ToastRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/root/ToastRootCssVars.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/root/ToastRootDataAttributes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/root/ToastRoot.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/content/ToastContent.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/utils/isRenderableNode.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/utils/useToastLabelPart.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/description/ToastDescription.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/title/ToastTitle.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/close/ToastClose.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/action/ToastAction.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/portal/ToastPortal.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toast/useToastManager.mjs","../../../../../node_modules/.pnpm/@tempoxyz+ds@0.2.6_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react-native@0.86_f564df10a26f3190a3aaf6288ad1f3d1/node_modules/@tempoxyz/ds/dist/web/components/Toast.js","../../../routes/index.tsx"],"sourcesContent":["import { ownerWindow } from '@base-ui/utils/owner';\n\n/**\n * Extracts the 2D translation and scale from the element's computed `transform` matrix.\n * Note that the `translate`, `rotate`, and `scale` longhands are separate properties and\n * are not reflected in the computed `transform` value.\n *\n * Pass `computedStyle` when the caller has already resolved it to avoid a second lookup.\n */\nexport function getElementTransform(element, computedStyle) {\n const transform = (computedStyle ?? ownerWindow(element).getComputedStyle(element)).transform;\n let translateX = 0;\n let translateY = 0;\n let scale = 1;\n if (transform && transform !== 'none') {\n const matrix = transform.match(/matrix(?:3d)?\\(([^)]+)\\)/);\n if (matrix) {\n const values = matrix[1].split(', ').map(parseFloat);\n if (values.length === 6) {\n translateX = values[4];\n translateY = values[5];\n scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);\n } else if (values.length === 16) {\n translateX = values[12];\n translateY = values[13];\n scale = values[0];\n }\n }\n }\n return {\n x: translateX,\n y: translateY,\n scale\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { closest, contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { findScrollableAncestor, findScrollableTouchTarget } from \"./scrollable.mjs\";\nimport { getElementAtPoint } from \"./getElementAtPoint.mjs\";\nimport { getElementTransform } from \"./getElementTransform.mjs\";\nconst DEFAULT_SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst MIN_VELOCITY_DURATION_MS = 50;\n// Under one frame at 240 Hz, so it only damps near-simultaneous samples.\nconst MIN_RELEASE_VELOCITY_DURATION_MS = 4;\nconst MAX_RELEASE_VELOCITY_AGE_MS = 80;\nconst MIN_VELOCITY_SAMPLE_DISTANCE = 1;\nconst DEFAULT_IGNORE_SELECTOR = 'button,a,input,select,textarea,label,[role=\"button\"]';\nexport function getDisplacement(direction, deltaX, deltaY) {\n switch (direction) {\n case 'up':\n return -deltaY;\n case 'down':\n return deltaY;\n case 'left':\n return -deltaX;\n case 'right':\n return deltaX;\n default:\n return 0;\n }\n}\nfunction getValidTimeStamp(timeStamp) {\n return Number.isFinite(timeStamp) && timeStamp > 0 ? timeStamp : null;\n}\nfunction getDragTransform(dragOffset, scale) {\n return `translate3d(${dragOffset.x}px,${dragOffset.y}px,0) scale(${scale})`;\n}\nfunction hasPrimaryMouseButton(buttons) {\n return buttons % 2 === 1;\n}\nfunction safelyChangePointerCapture(element, pointerId, method) {\n const pointerCaptureMethod = element[method];\n if (typeof pointerCaptureMethod !== 'function') {\n return;\n }\n try {\n pointerCaptureMethod.call(element, pointerId);\n } catch (error) {\n if (error && typeof error === 'object' && 'name' in error && error.name === 'NotFoundError') {\n return;\n }\n throw error;\n }\n}\nexport function useSwipeDismiss(options) {\n const {\n enabled,\n directions,\n elementRef,\n movementCssVars,\n canStart,\n ignoreSelectorWhenTouch = true,\n ignoreScrollableAncestors = false,\n swipeThreshold: swipeThresholdProp,\n onDismiss,\n onProgress,\n onCancel,\n onSwipeStart,\n onRelease,\n onSwipingChange,\n trackDrag = true\n } = options;\n const ignoreSelector = DEFAULT_IGNORE_SELECTOR;\n const primaryDirection = directions.length === 1 ? directions[0] : undefined;\n const swipeThresholdDefault = Math.max(0, typeof swipeThresholdProp === 'number' ? swipeThresholdProp : DEFAULT_SWIPE_THRESHOLD);\n const allowLeft = directions.includes('left');\n const allowRight = directions.includes('right');\n const allowUp = directions.includes('up');\n const allowDown = directions.includes('down');\n const hasHorizontal = allowLeft || allowRight;\n const hasVertical = allowUp || allowDown;\n\n // Consumers only pass directions on a single axis.\n const scrollAxis = hasHorizontal ? 'horizontal' : 'vertical';\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [dragDismissed, setDragDismissed] = React.useState(false);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastMovePosRef = React.useRef(null);\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const pendingSwipeRef = React.useRef(false);\n const pendingSwipeStartPosRef = React.useRef(null);\n const swipeFromScrollableRef = React.useRef(false);\n const sawPrimaryButtonsOnMoveRef = React.useRef(false);\n const elementSizeRef = React.useRef({\n width: 0,\n height: 0\n });\n const swipeProgressRef = React.useRef(0);\n const swipeThresholdRef = React.useRef(swipeThresholdDefault);\n const swipeThresholdFunctionRef = React.useRef(null);\n const swipeStartTimeRef = React.useRef(null);\n const lastDragSampleRef = React.useRef(null);\n const hasStationarySampleRef = React.useRef(false);\n const lastDragVelocityRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastProgressDetailsRef = React.useRef(null);\n const isSwipingRef = React.useRef(false);\n const dragStyleSnapshotRef = React.useRef(null);\n const setSwiping = useStableCallback(nextSwiping => {\n if (isSwipingRef.current === nextSwiping) {\n return;\n }\n isSwipingRef.current = nextSwiping;\n setIsSwiping(nextSwiping);\n onSwipingChange?.(nextSwiping);\n });\n function resolveSwipeThreshold(direction) {\n if (!direction) {\n return;\n }\n const element = elementRef.current;\n const thresholdFunction = swipeThresholdFunctionRef.current;\n if (!element || !thresholdFunction) {\n return;\n }\n const value = thresholdFunction({\n element,\n direction\n });\n swipeThresholdRef.current = Math.max(0, value);\n }\n const updateSwipeProgress = useStableCallback((progress, details) => {\n const nextProgress = Number.isFinite(progress) ? clamp(progress, 0, 1) : 0;\n const progressChanged = nextProgress !== swipeProgressRef.current;\n let detailsChanged = false;\n if (details) {\n const lastDetails = lastProgressDetailsRef.current;\n detailsChanged = !lastDetails || lastDetails.deltaX !== details.deltaX || lastDetails.deltaY !== details.deltaY || lastDetails.direction !== details.direction;\n }\n if (!progressChanged && !detailsChanged) {\n return;\n }\n swipeProgressRef.current = nextProgress;\n if (details) {\n lastProgressDetailsRef.current = details;\n } else if (progressChanged) {\n lastProgressDetailsRef.current = null;\n }\n onProgress?.(nextProgress, details);\n });\n const syncDragStyles = useStableCallback(swiping => {\n const element = elementRef.current;\n if (!trackDrag || !element) {\n if (!swiping) {\n dragStyleSnapshotRef.current = null;\n }\n return;\n }\n const style = element.style;\n const dragStyleSnapshot = dragStyleSnapshotRef.current;\n if (swiping) {\n if (!dragStyleSnapshot) {\n dragStyleSnapshotRef.current = [style.transition, style.transform];\n }\n style.transition = 'none';\n } else if (dragStyleSnapshot) {\n [style.transition, style.transform] = dragStyleSnapshot;\n dragStyleSnapshotRef.current = null;\n }\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (swiping) {\n style.transform = getDragTransform(dragOffset, initialTransform.scale);\n }\n style.setProperty(movementCssVars.x, `${deltaX}px`);\n style.setProperty(movementCssVars.y, `${deltaY}px`);\n });\n function recordDragSample(offset, timeStamp) {\n if (timeStamp === null) {\n return;\n }\n const lastSample = lastDragSampleRef.current;\n if (lastSample && timeStamp > lastSample.time) {\n // Some Android devices emit one effectively stationary move immediately before release.\n // Keep the last moving sample and its timestamp. Repeated stationary moves still clear\n // the velocity, and a release after a hold still expires the last moving sample.\n const stationary = Math.abs(offset.x - lastSample.x) < MIN_VELOCITY_SAMPLE_DISTANCE && Math.abs(offset.y - lastSample.y) < MIN_VELOCITY_SAMPLE_DISTANCE;\n const skipSample = stationary && !hasStationarySampleRef.current;\n hasStationarySampleRef.current = stationary;\n if (skipSample) {\n return;\n }\n const durationMs = Math.max(timeStamp - lastSample.time, MIN_RELEASE_VELOCITY_DURATION_MS);\n lastDragVelocityRef.current = {\n x: (offset.x - lastSample.x) / durationMs,\n y: (offset.y - lastSample.y) / durationMs\n };\n }\n lastDragSampleRef.current = {\n x: offset.x,\n y: offset.y,\n time: timeStamp\n };\n }\n const reset = React.useCallback(() => {\n setCurrentSwipeDirection(undefined);\n setSwiping(false);\n setDragDismissed(false);\n updateSwipeProgress(0);\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = null;\n dragStartPosRef.current = {\n x: 0,\n y: 0\n };\n dragOffsetRef.current = {\n x: 0,\n y: 0\n };\n initialTransformRef.current = {\n x: 0,\n y: 0,\n scale: 1\n };\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n cancelledSwipeRef.current = false;\n swipeCancelBaselineRef.current = {\n x: 0,\n y: 0\n };\n isFirstPointerMoveRef.current = false;\n lastMovePosRef.current = null;\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = false;\n elementSizeRef.current = {\n width: 0,\n height: 0\n };\n swipeStartTimeRef.current = null;\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n lastProgressDetailsRef.current = null;\n syncDragStyles(false);\n }, [setSwiping, swipeThresholdDefault, syncDragStyles, updateSwipeProgress]);\n function getPrimaryPointerPosition(event) {\n if ('touches' in event) {\n const touch = event.touches[0];\n return touch ? {\n x: touch.clientX,\n y: touch.clientY\n } : null;\n }\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n function isTouchLikeEvent(event) {\n if ('touches' in event) {\n return true;\n }\n return event.pointerType === 'touch';\n }\n function getTargetAtPoint(position, nativeEvent) {\n const root = elementRef.current?.getRootNode();\n const elementAtPoint = getElementAtPoint(root, position.x, position.y);\n const target = elementAtPoint ?? getTarget(nativeEvent);\n return target;\n }\n function findGestureScrollableTouchTarget(target, root) {\n // The swiped element is positioned relative to the viewport, so the page scroller must not\n // gate the gesture (a reset like `html, body { height: 100%; overflow: auto }` makes `body`\n // a real scroll container). The drawer viewport's native touchmove handler already ignores it.\n const find = axis => {\n const scrollTarget = findScrollableTouchTarget(target, root, axis);\n const doc = ownerDocument(scrollTarget);\n return scrollTarget === doc.body || scrollTarget === doc.documentElement ? null : scrollTarget;\n };\n return find(scrollAxis);\n }\n function startSwipeAtPosition(event, position, startOptions) {\n swipeFromScrollableRef.current = false;\n const touchLike = isTouchLikeEvent(event);\n const target = getTargetAtPoint(position, event.nativeEvent);\n const doc = ownerDocument(elementRef.current);\n const body = doc.body;\n const scrollableTarget = touchLike && body ? findGestureScrollableTouchTarget(target, body) : null;\n const ignoreScrollableTarget = startOptions?.ignoreScrollableTarget ?? false;\n if (scrollableTarget && !ignoreScrollableTarget) {\n return false;\n }\n swipeFromScrollableRef.current = Boolean(scrollableTarget && ignoreScrollableTarget);\n const isInteractiveElement = closest(target, ignoreSelector);\n if (isInteractiveElement && (!touchLike || ignoreSelectorWhenTouch)) {\n return false;\n }\n const element = elementRef.current;\n if (ignoreScrollableAncestors && element && target) {\n const ignoreAncestors = startOptions?.ignoreScrollableAncestors ?? false;\n if (!ignoreAncestors && findScrollableAncestor(target, element, scrollAxis) != null) {\n return false;\n }\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n dragStartPosRef.current = position;\n swipeStartTimeRef.current = getValidTimeStamp(event.timeStamp);\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n swipeCancelBaselineRef.current = position;\n lastMovePosRef.current = position;\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = typeof swipeThresholdProp === 'function' ? swipeThresholdProp : null;\n if (element) {\n elementSizeRef.current = {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n resolveSwipeThreshold(primaryDirection);\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n dragOffsetRef.current = {\n x: transform.x,\n y: transform.y\n };\n recordDragSample({\n x: transform.x,\n y: transform.y\n }, swipeStartTimeRef.current);\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'setPointerCapture');\n }\n }\n onSwipeStart?.(event.nativeEvent);\n setSwiping(true);\n isFirstPointerMoveRef.current = true;\n updateSwipeProgress(0);\n syncDragStyles(true);\n return true;\n }\n function resetPendingSwipeState() {\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n lastMovePosRef.current = null;\n }\n function clearPendingSwipeStartState() {\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n }\n function cancelSwipeInteraction(event) {\n resetPendingSwipeState();\n if (!isSwipingRef.current) {\n return;\n }\n setSwiping(false);\n const resolvedInitialTransform = initialTransformRef.current;\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n sawPrimaryButtonsOnMoveRef.current = false;\n syncDragStyles(false);\n const element = elementRef.current;\n if (element) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n updateSwipeProgress(0, {\n deltaX: 0,\n deltaY: 0,\n direction: undefined\n });\n onCancel?.(event.nativeEvent);\n }\n function applyDirectionalDamping(deltaX, deltaY) {\n const exponent = value => Math.sign(value) * Math.abs(value) ** 0.5;\n const dampAxis = (delta, allowNegative, allowPositive) => {\n if (!allowNegative && delta < 0 || !allowPositive && delta > 0) {\n return exponent(delta);\n }\n return delta;\n };\n const newDeltaX = hasHorizontal ? dampAxis(deltaX, allowLeft, allowRight) : exponent(deltaX);\n const newDeltaY = hasVertical ? dampAxis(deltaY, allowUp, allowDown) : exponent(deltaY);\n return {\n x: newDeltaX,\n y: newDeltaY\n };\n }\n function canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY) {\n // Swiping toward the axis start edge (down/right) is allowed when scrolled to the start;\n // toward the end edge (up/left) when scrolled to the end.\n const canSwipeOnAxis = (delta, scrollOffset, maxScrollOffset, allowTowardStart, allowTowardEnd) => delta > 0 && scrollOffset <= 0 && allowTowardStart || delta < 0 && scrollOffset >= Math.max(0, maxScrollOffset) && allowTowardEnd;\n if (hasVertical && deltaY !== 0) {\n return canSwipeOnAxis(deltaY, scrollTarget.scrollTop, scrollTarget.scrollHeight - scrollTarget.clientHeight, allowDown, allowUp);\n }\n if (hasHorizontal && deltaX !== 0) {\n return canSwipeOnAxis(deltaX, scrollTarget.scrollLeft, scrollTarget.scrollWidth - scrollTarget.clientWidth, allowRight, allowLeft);\n }\n return null;\n }\n const handleStart = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n if (event.defaultPrevented || event.nativeEvent.defaultPrevented) {\n return;\n }\n if (!('touches' in event) && event.button !== 0) {\n return;\n }\n const startPos = getPrimaryPointerPosition(event);\n if (!startPos) {\n return;\n }\n pendingSwipeRef.current = true;\n pendingSwipeStartPosRef.current = startPos;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = !('touches' in event);\n const allowedToStart = canStart ? canStart(startPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (!allowedToStart) {\n return;\n }\n if (startSwipeAtPosition(event, startPos)) {\n clearPendingSwipeStartState();\n }\n });\n function handleMoveCore(event, position, movement) {\n if (!enabled || !isSwipingRef.current) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n if (isTouchLikeEvent(event) && !swipeFromScrollableRef.current) {\n const boundaryElement = event.currentTarget;\n if (findGestureScrollableTouchTarget(target, boundaryElement)) {\n return;\n }\n }\n if (!('touches' in event)) {\n // Prevent text selection on Safari\n event.preventDefault();\n }\n if (isFirstPointerMoveRef.current) {\n isFirstPointerMoveRef.current = false;\n // Reset the drag origin to the first move's position to absorb the gap between the press and\n // the first move event — notably on iOS touch, where the first `touchmove` arrives already\n // offset from the `touchstart` — which would otherwise make the dragged element jump. This\n // only matters when an element follows the pointer; when `trackDrag` is false (e.g. the\n // swipe-area, which only opens the drawer) keep the original press position so a quick flick\n // still registers: on a low-refresh-rate display the whole travel can land in this single\n // first move, and discarding it would drop the gesture.\n if (trackDrag) {\n dragStartPosRef.current = position;\n const moveTime = getValidTimeStamp(event.timeStamp);\n if (moveTime !== null) {\n swipeStartTimeRef.current = moveTime;\n }\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n }\n }\n const clientX = position.x;\n const clientY = position.y;\n const movementX = movement.x;\n const movementY = movement.y;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate) {\n const isAllowed = candidate === 'left' && allowLeft || candidate === 'right' && allowRight || candidate === 'up' && allowUp || candidate === 'down' && allowDown;\n if (isAllowed) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n resolveSwipeThreshold(candidate);\n }\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > swipeThresholdRef.current) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(allowLeft && allowRight) && !(allowUp && allowDown) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n if (hasHorizontal) {\n newOffsetX += dampedDelta.x;\n }\n if (hasVertical) {\n newOffsetY += dampedDelta.y;\n }\n\n // Only rewrite drag styles when the drag offset actually changed. `syncDragStyles` writes the\n // raw (undamped) frozen transform and movement vars, relying on the consumer's `onProgress`\n // to overwrite them with damped styles — but `updateSwipeProgress` dedupes unchanged\n // deltas and skips `onProgress`. A move that doesn't change the offset (e.g. the cursor\n // pinned at a screen edge during an off-screen drag, jittering only on the ignored axis)\n // would otherwise reinstate the raw styles with no correction, jumping the element to the\n // undamped position.\n const previousOffset = dragOffsetRef.current;\n const offsetChanged = newOffsetX !== previousOffset.x || newOffsetY !== previousOffset.y;\n dragOffsetRef.current = {\n x: newOffsetX,\n y: newOffsetY\n };\n if (offsetChanged) {\n syncDragStyles(true);\n }\n recordDragSample({\n x: newOffsetX,\n y: newOffsetY\n }, getValidTimeStamp(event.timeStamp));\n const dragDeltaX = newOffsetX - initialTransformRef.current.x;\n const dragDeltaY = newOffsetY - initialTransformRef.current.y;\n const progressDetails = {\n deltaX: dragDeltaX,\n deltaY: dragDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n let progress = 0;\n const progressDirection = primaryDirection ?? intendedSwipeDirectionRef.current;\n if (progressDirection) {\n const size = progressDirection === 'left' || progressDirection === 'right' ? elementSizeRef.current.width : elementSizeRef.current.height;\n const scale = initialTransformRef.current.scale || 1;\n const progressDisplacement = getDisplacement(progressDirection, dragDeltaX, dragDeltaY);\n if (size > 0 && scale > 0 && progressDisplacement > 0) {\n progress = progressDisplacement / (size * scale);\n }\n }\n updateSwipeProgress(progress, progressDetails);\n }\n const handleEnd = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const resolvedInitialTransform = initialTransformRef.current;\n const releaseDeltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const releaseDeltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n const progressDetails = {\n deltaX: releaseDeltaX,\n deltaY: releaseDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n if (!isSwipingRef.current) {\n resetPendingSwipeState();\n updateSwipeProgress(0, progressDetails);\n return;\n }\n setSwiping(false);\n resetPendingSwipeState();\n sawPrimaryButtonsOnMoveRef.current = false;\n const element = elementRef.current;\n if (element) {\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n }\n const deltaX = releaseDeltaX;\n const deltaY = releaseDeltaY;\n const startTime = swipeStartTimeRef.current;\n const endTime = getValidTimeStamp(event.timeStamp);\n const durationMs = startTime !== null && endTime !== null && endTime > startTime ? endTime - startTime : 0;\n const velocityDurationMs = durationMs > 0 ? Math.max(durationMs, MIN_VELOCITY_DURATION_MS) : 0;\n const velocityX = velocityDurationMs > 0 ? deltaX / velocityDurationMs : 0;\n const velocityY = velocityDurationMs > 0 ? deltaY / velocityDurationMs : 0;\n let releaseVelocityX = lastDragVelocityRef.current.x;\n let releaseVelocityY = lastDragVelocityRef.current.y;\n const lastSample = lastDragSampleRef.current;\n if (lastSample && endTime !== null && endTime >= lastSample.time) {\n const ageMs = endTime - lastSample.time;\n if (ageMs <= MAX_RELEASE_VELOCITY_AGE_MS) {\n const sampleDurationMs = Math.max(ageMs, MIN_RELEASE_VELOCITY_DURATION_MS);\n const deltaFromLastSampleX = resolvedDragOffset.x - lastSample.x;\n const deltaFromLastSampleY = resolvedDragOffset.y - lastSample.y;\n const sampleVelocityX = deltaFromLastSampleX / sampleDurationMs;\n const sampleVelocityY = deltaFromLastSampleY / sampleDurationMs;\n if (Math.abs(deltaFromLastSampleX) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityX = sampleVelocityX;\n }\n if (Math.abs(deltaFromLastSampleY) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityY = sampleVelocityY;\n }\n } else {\n releaseVelocityX = 0;\n releaseVelocityY = 0;\n }\n }\n const releaseDecision = onRelease?.({\n event: event.nativeEvent,\n direction: intendedSwipeDirectionRef.current,\n deltaX,\n deltaY,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n });\n const hasReleaseDecision = typeof releaseDecision === 'boolean';\n if (cancelledSwipeRef.current && !hasReleaseDecision) {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n return;\n }\n let shouldClose = false;\n let dismissDirection;\n if (hasReleaseDecision) {\n shouldClose = releaseDecision;\n dismissDirection = intendedSwipeDirectionRef.current ?? primaryDirection;\n } else {\n for (const direction of directions) {\n if (getDisplacement(direction, deltaX, deltaY) > swipeThresholdRef.current) {\n shouldClose = true;\n dismissDirection = direction;\n break;\n }\n }\n }\n if (shouldClose && dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n setDragDismissed(true);\n syncDragStyles(false);\n onDismiss?.(event.nativeEvent, {\n direction: dismissDirection\n });\n } else {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n }\n });\n const handleMove = useStableCallback(event => {\n const currentPos = getPrimaryPointerPosition(event);\n if (!currentPos) {\n return;\n }\n let endAfterMove = false;\n if (!('touches' in event)) {\n const hasPrimaryButton = hasPrimaryMouseButton(event.buttons);\n if (hasPrimaryButton) {\n sawPrimaryButtonsOnMoveRef.current = true;\n }\n\n // Cancel the swipe if a non-primary button takes over the interaction.\n // This handles cases where a right-click interrupts dragging.\n if (event.buttons !== 0 && !hasPrimaryButton) {\n cancelSwipeInteraction(event);\n return;\n }\n\n // A `buttons: 0` pointermove means the primary button was already released, so the gesture is\n // over even if no pointerup reached us. On fast trackpad flicks this trailing move is\n // dispatched just before pointerup; treat it as the release (mirroring touchend) instead of\n // cancelling and snapping the element back.\n if (event.buttons === 0 && sawPrimaryButtonsOnMoveRef.current) {\n if (!isSwipingRef.current) {\n // The gesture never activated — discard it.\n handleEnd(event);\n return;\n }\n // This release move can itself carry the threshold-crossing displacement (and the peak\n // release velocity), so let it flow through `handleMoveCore` below to update the drag\n // offset / velocity sample, then commit the release afterwards.\n endAfterMove = true;\n }\n }\n if (!isSwiping && pendingSwipeRef.current) {\n if (!isTouchLikeEvent(event) && (event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n resetPendingSwipeState();\n return;\n }\n const allowedToStart = canStart ? canStart(currentPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (allowedToStart) {\n const pendingStartPos = pendingSwipeStartPosRef.current;\n let ignoreScrollableOnStart = false;\n if (isTouchLikeEvent(event)) {\n const element = elementRef.current;\n if (pendingStartPos && element) {\n const target = getTargetAtPoint(currentPos, event.nativeEvent);\n const doc = ownerDocument(element);\n const body = doc.body;\n const scrollTarget = body ? findGestureScrollableTouchTarget(target, body) : null;\n if (scrollTarget && (contains(element, scrollTarget) || contains(scrollTarget, element))) {\n const deltaX = currentPos.x - pendingStartPos.x;\n const deltaY = currentPos.y - pendingStartPos.y;\n const canSwipeFromEdge = canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY);\n if (canSwipeFromEdge === false) {\n return;\n }\n if (canSwipeFromEdge === true) {\n ignoreScrollableOnStart = true;\n }\n }\n }\n }\n const started = startSwipeAtPosition(event, currentPos, {\n ignoreScrollableTarget: ignoreScrollableOnStart,\n ignoreScrollableAncestors: ignoreScrollableOnStart\n });\n if (started) {\n if (pendingStartPos && ignoreScrollableOnStart) {\n // Preserve displacement between touchstart and the move that activates swipe from\n // a scroll-edge so quick flicks can dismiss.\n clearPendingSwipeStartState();\n dragStartPosRef.current = pendingStartPos;\n swipeCancelBaselineRef.current = pendingStartPos;\n lastMovePosRef.current = pendingStartPos;\n isFirstPointerMoveRef.current = false;\n } else {\n // Start from the current in-bounds position without dropping follow-up move\n // displacement; this avoids jumps when entering from outside the element while\n // keeping swipe tracking responsive on the next move.\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n }\n }\n }\n }\n const previousPos = lastMovePosRef.current;\n const movement = previousPos === null ? {\n x: 0,\n y: 0\n } : {\n x: currentPos.x - previousPos.x,\n y: currentPos.y - previousPos.y\n };\n lastMovePosRef.current = currentPos;\n handleMoveCore(event, currentPos, movement);\n\n // `endAfterMove` is only set in the non-touch branch above; the `'touches'` guard re-narrows the\n // event type for `handleEnd` after the shared move handling has run.\n if (endAfterMove && !('touches' in event)) {\n handleEnd(event);\n }\n });\n\n // Feeds a native touchmove into the swipe pipeline. Used by consumers that claim the gesture\n // in a capture-phase listener and stop it from reaching React's delegated touch handlers.\n const moveNative = useStableCallback((nativeEvent, currentTarget) => {\n handleMove({\n touches: nativeEvent.touches,\n currentTarget,\n nativeEvent,\n defaultPrevented: nativeEvent.defaultPrevented,\n timeStamp: nativeEvent.timeStamp\n });\n });\n const getDragStyles = React.useCallback(() => {\n // Read `isSwipingRef`, not the lagging `isSwiping` state, to match the imperative writer\n // `syncDragStyles`. Otherwise a render that commits before `setSwiping(true)` flushes strips the\n // transform it just wrote, flashing the popup to its resting position for a frame.\n const swiping = isSwipingRef.current;\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (!swiping && deltaX === 0 && deltaY === 0 && !dragDismissed) {\n return {\n [movementCssVars.x]: '0px',\n [movementCssVars.y]: '0px'\n };\n }\n return {\n transition: swiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: swiping ? getDragTransform(dragOffset, initialTransform.scale) : undefined,\n [movementCssVars.x]: `${deltaX}px`,\n [movementCssVars.y]: `${deltaY}px`\n };\n }, [dragDismissed, movementCssVars]);\n const getPointerProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onPointerDown: handleStart,\n onPointerMove: handleMove,\n onPointerUp: handleEnd,\n onPointerCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n const getTouchProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onTouchStart: handleStart,\n onTouchMove: handleMove,\n onTouchEnd: handleEnd,\n onTouchCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n return {\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection,\n dragDismissed,\n getPointerProps,\n getTouchProps,\n moveNative,\n getDragStyles,\n reset\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastContext.displayName = \"ToastContext\";\nexport function useToastProviderContext() {\n const context = React.useContext(ToastContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: useToastManager must be used within <Toast.Provider>.' : _formatErrorMessage(73));\n }\n return context;\n}","let counter = 0;\nexport function generateId(prefix) {\n counter += 1;\n return `${prefix}-${Math.random().toString(36).slice(2, 6)}-${counter}`;\n}","export function resolvePromiseOptions(options, result) {\n if (typeof options === 'string') {\n return {\n description: options\n };\n }\n if (typeof options === 'function') {\n const resolvedOptions = options(result);\n return typeof resolvedOptions === 'string' ? {\n description: resolvedOptions\n } : resolvedOptions;\n }\n return options;\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { generateId } from '@base-ui/utils/generateId';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { resolvePromiseOptions } from \"./utils/resolvePromiseOptions.mjs\";\nimport { activeElement, contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { isFocusVisible } from \"./utils/focusVisible.mjs\";\n\n/**\n * A toast once it lives in the store. `addToast` is the only way in and it always\n * assigns `updateKey`, so unlike the public `ToastObject` it is never missing.\n */\n\nfunction createToastMetadata(toasts) {\n const metadata = new Map();\n let visibleIndex = 0;\n let offsetY = 0;\n toasts.forEach((toast, toastIndex) => {\n const isEnding = toast.transitionStatus === 'ending';\n metadata.set(toast.id, {\n value: toast,\n domIndex: toastIndex,\n visibleIndex: isEnding ? -1 : visibleIndex,\n offsetY\n });\n offsetY += toast.height || 0;\n if (!isEnding) {\n visibleIndex += 1;\n }\n });\n return metadata;\n}\n\n// Marks the active (non-ending) toasts beyond `limit` as limited. Callers pass\n// toasts in newest-first order, so the newest `limit` toasts stay visible and\n// the rest are flagged. Returns the same toast reference when its `limited`\n// flag is unchanged to avoid unnecessary re-renders.\nfunction applyLimited(toasts, limit) {\n let activeIndex = 0;\n return toasts.map(toast => {\n if (toast.transitionStatus === 'ending') {\n return toast;\n }\n const limited = activeIndex >= limit;\n activeIndex += 1;\n return toast.limited === limited ? toast : {\n ...toast,\n limited\n };\n });\n}\nexport const selectors = {\n toasts: state => state.toasts,\n isEmpty: state => state.toasts.length === 0,\n toast: (state, id) => state.toastMetadata.get(id)?.value,\n toastIndex: (state, id) => state.toastMetadata.get(id)?.domIndex ?? -1,\n toastOffsetY: (state, id) => state.toastMetadata.get(id)?.offsetY ?? 0,\n toastVisibleIndex: (state, id) => state.toastMetadata.get(id)?.visibleIndex ?? -1,\n focused: state => state.focused,\n expanded: state => state.hovering || state.focused,\n expandedOrOutOfFocus: state => state.hovering || state.focused || !state.isWindowFocused,\n prevFocusElement: state => state.prevFocusElement\n};\nexport class ToastStore extends ReactStore {\n timers = new Map();\n areTimersPaused = false;\n constructor(initialState) {\n super({\n ...initialState,\n toastMetadata: createToastMetadata(initialState.toasts)\n }, {}, selectors);\n }\n setViewport = viewport => {\n this.set('viewport', viewport);\n };\n syncProviderProps(timeout, limit) {\n const limitChanged = this.state.limit !== limit;\n if (this.state.timeout === timeout && !limitChanged) {\n return;\n }\n const updates = {\n timeout,\n limit\n };\n if (limitChanged) {\n const newToasts = applyLimited(this.state.toasts, limit);\n updates.toasts = newToasts;\n updates.toastMetadata = createToastMetadata(newToasts);\n }\n this.update(updates);\n }\n disposeEffect = () => {\n return () => {\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n };\n };\n removeToast(toastId, skipOnRemove = false) {\n const index = selectors.toastIndex(this.state, toastId);\n if (index === -1) {\n return;\n }\n const toast = this.state.toasts[index];\n if (!skipOnRemove) {\n toast?.onRemove?.();\n }\n const newToasts = [...this.state.toasts];\n newToasts.splice(index, 1);\n this.setToasts(newToasts);\n }\n addToast = toast => {\n const {\n timeout,\n limit\n } = this.state;\n const id = toast.id || generateId('toast');\n if (toast.id) {\n const existingToast = selectors.toast(this.state, toast.id);\n if (existingToast) {\n if (existingToast.transitionStatus === 'ending') {\n this.removeToast(toast.id, true);\n } else {\n const {\n id: ignoredId,\n transitionStatus: ignoredTransitionStatus,\n ...updates\n } = toast;\n this.updateToastInternal(toast.id, updates, true, true);\n return toast.id;\n }\n }\n }\n const toastToAdd = {\n ...toast,\n id,\n updateKey: 0,\n transitionStatus: 'starting'\n };\n const updatedToasts = [toastToAdd, ...this.state.toasts];\n this.setToasts(applyLimited(updatedToasts, limit));\n const duration = toastToAdd.timeout ?? timeout;\n if (toastToAdd.type !== 'loading' && duration > 0) {\n this.scheduleTimer(id, duration, () => this.closeToast(id));\n }\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n return id;\n };\n updateToast = (id, updates) => {\n const prevToast = selectors.toast(this.state, id);\n // Never run the updater for an update the store is going to ignore.\n if (!prevToast || prevToast.transitionStatus === 'ending') {\n return;\n }\n\n // The updater may have called back into the store, so the internal update\n // reads the current state again.\n this.updateToastInternal(id, typeof updates === 'function' ? updates(prevToast) : updates, false, true);\n };\n updateToastInternal = (id, updates, resetTimer = false, markUpdated = false) => {\n const {\n timeout,\n toasts\n } = this.state;\n const prevToast = selectors.toast(this.state, id);\n if (!prevToast) {\n return;\n }\n\n // Ignore updates for toasts that are already closing.\n // This prevents races where async updates (e.g. promise success/error)\n // can block a dismissal from completing.\n if (prevToast.transitionStatus === 'ending') {\n return;\n }\n const nextToast = {\n ...prevToast,\n ...updates,\n ...(markUpdated && {\n updateKey: prevToast.updateKey + 1\n })\n };\n this.setToasts(toasts.map(toast => toast.id === id ? nextToast : toast));\n const nextTimeout = nextToast.timeout ?? timeout;\n const prevTimeout = prevToast.timeout ?? timeout;\n const timeoutUpdated = Object.hasOwn(updates, 'timeout');\n const shouldHaveTimer = nextToast.transitionStatus !== 'ending' && nextToast.type !== 'loading' && nextTimeout > 0;\n const hasTimer = this.timers.has(id);\n const timeoutChanged = prevTimeout !== nextTimeout;\n const wasLoading = prevToast.type === 'loading';\n if (!shouldHaveTimer && hasTimer) {\n this.clearTimer(id);\n return;\n }\n\n // Schedule or reschedule timer if needed\n if (shouldHaveTimer && (!hasTimer || timeoutChanged || timeoutUpdated || wasLoading || resetTimer)) {\n this.clearTimer(id);\n this.scheduleTimer(id, nextTimeout, () => this.closeToast(id));\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n }\n };\n closeToast = toastId => {\n const closeAll = toastId === undefined;\n const {\n limit,\n toasts\n } = this.state;\n let toastsToClose;\n if (closeAll) {\n toastsToClose = toasts;\n this.clearTimers();\n } else {\n const toast = selectors.toast(this.state, toastId);\n if (!toast) {\n return;\n }\n toastsToClose = [toast];\n this.clearTimer(toastId);\n }\n const endingToasts = toasts.map(item => closeAll || item.id === toastId ? {\n ...item,\n transitionStatus: 'ending',\n height: 0\n } : item);\n const newToasts = applyLimited(endingToasts, limit);\n this.setToasts(newToasts, !newToasts.some(toast => toast.transitionStatus !== 'ending'));\n toastsToClose.forEach(toast => {\n if (toast.transitionStatus !== 'ending') {\n toast.onClose?.();\n }\n });\n this.handleFocusManagement(toastId);\n };\n promiseToast = (promiseValue, options) => {\n // Create a loading toast (which does not auto-dismiss).\n const loadingOptions = resolvePromiseOptions(options.loading);\n const id = this.addToast({\n ...loadingOptions,\n type: 'loading'\n });\n const handledPromise = promiseValue.then(result => {\n const successOptions = resolvePromiseOptions(options.success, result);\n this.updateToast(id, {\n ...successOptions,\n type: 'success',\n timeout: successOptions.timeout\n });\n return result;\n }).catch(error => {\n const errorOptions = resolvePromiseOptions(options.error, error);\n this.updateToast(id, {\n ...errorOptions,\n type: 'error',\n timeout: errorOptions.timeout\n });\n return Promise.reject(error);\n });\n\n // Private API used exclusively by `Manager` to handoff the promise\n // back to the manager after it's handled here.\n if ({}.hasOwnProperty.call(options, 'setPromise')) {\n options.setPromise(handledPromise);\n }\n return handledPromise;\n };\n pauseTimers() {\n if (this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = true;\n this.timers.forEach(timer => {\n // Timers added while already paused have no running timeout, so their\n // `remaining` is still the full delay and must be left alone.\n if (timer.timeout) {\n timer.timeout.clear();\n // `start` is stamped on every resume, so subtracting from `remaining`\n // (rather than from the original delay) keeps repeated pause/resume\n // cycles from handing the toast extra time.\n timer.remaining = Math.max(timer.remaining - (Date.now() - timer.start), 0);\n }\n });\n }\n resumeTimers() {\n if (!this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = false;\n this.timers.forEach((timer, id) => {\n timer.remaining = timer.remaining > 0 ? timer.remaining : timer.delay;\n timer.timeout ??= Timeout.create();\n timer.timeout.start(timer.remaining, () => {\n this.handleTimerFired(id);\n timer.callback();\n });\n timer.start = Date.now();\n });\n }\n restoreFocusToPrevElement() {\n this.state.prevFocusElement?.focus({\n preventScroll: true\n });\n }\n handleDocumentPointerDown = event => {\n if (event.pointerType !== 'touch') {\n return;\n }\n const target = getTarget(event);\n if (contains(this.state.viewport, target)) {\n return;\n }\n\n // This is explicit touch activity outside the viewport, so the paused\n // interaction state should end even if the window focus state is unchanged.\n this.resumeTimers();\n this.update({\n hovering: false,\n focused: false\n });\n };\n scheduleTimer(id, delay, callback) {\n const start = Date.now();\n const shouldStartActive = !selectors.expandedOrOutOfFocus(this.state);\n const currentTimeout = shouldStartActive ? Timeout.create() : undefined;\n currentTimeout?.start(delay, () => {\n this.handleTimerFired(id);\n callback();\n });\n this.timers.set(id, {\n timeout: currentTimeout,\n start,\n delay,\n remaining: delay,\n callback\n });\n }\n clearTimers() {\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n this.areTimersPaused = false;\n }\n clearTimer(id) {\n const timer = this.timers.get(id);\n timer?.timeout?.clear();\n this.timers.delete(id);\n this.resetPausedStateIfNoTimersRemain();\n }\n handleTimerFired(id) {\n this.timers.delete(id);\n this.resetPausedStateIfNoTimersRemain();\n }\n resetPausedStateIfNoTimersRemain() {\n if (this.timers.size === 0) {\n // No timers remain to keep paused; clear the flag so a fresh toast's\n // running timer can be paused again on hover/focus.\n this.areTimersPaused = false;\n }\n }\n setToasts(newToasts, clearInteraction = newToasts.length === 0) {\n const updates = {\n toasts: newToasts,\n toastMetadata: createToastMetadata(newToasts)\n };\n if (clearInteraction) {\n updates.hovering = false;\n updates.focused = false;\n }\n this.update(updates);\n }\n handleFocusManagement(toastId) {\n const activeEl = activeElement(ownerDocument(this.state.viewport));\n if (!this.state.viewport || !contains(this.state.viewport, activeEl) || !isFocusVisible(activeEl)) {\n return;\n }\n if (toastId === undefined) {\n this.restoreFocusToPrevElement();\n return;\n }\n const toasts = selectors.toasts(this.state);\n const currentIndex = selectors.toastIndex(this.state, toastId);\n const scan = (from, step) => {\n for (let index = from; index >= 0 && index < toasts.length; index += step) {\n if (toasts[index].transitionStatus !== 'ending') {\n return toasts[index];\n }\n }\n return null;\n };\n\n // Try to find the next toast that isn't animating out, then fall back to the previous one.\n const nextToast = scan(currentIndex + 1, 1) ?? scan(currentIndex - 1, -1);\n if (nextToast) {\n nextToast.ref?.current?.focus();\n } else {\n this.restoreFocusToPrevElement();\n }\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ToastContext } from \"./ToastProviderContext.mjs\";\nimport { ToastStore } from \"../store.mjs\";\n\n/**\n * Provides a context for creating and managing toasts.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ToastProvider = function ToastProvider(props) {\n const {\n children,\n timeout = 5000,\n limit = 3,\n toastManager\n } = props;\n const store = useRefWithInit(() => new ToastStore({\n timeout,\n limit,\n viewport: null,\n toasts: [],\n hovering: false,\n focused: false,\n isWindowFocused: true,\n prevFocusElement: null\n })).current;\n useOnMount(store.disposeEffect);\n React.useEffect(function subscribeToToastManager() {\n if (!toastManager) {\n return undefined;\n }\n const unsubscribe = toastManager[' subscribe'](({\n action,\n options\n }) => {\n const id = options.id;\n if (action === 'promise' && options.promise) {\n store.promiseToast(options.promise, options);\n } else if (action === 'update' && id) {\n store.updateToast(id, options.updates);\n } else if (action === 'close') {\n store.closeToast(id);\n } else {\n store.addToast(options);\n }\n });\n return unsubscribe;\n }, [store, toastManager]);\n return /*#__PURE__*/_jsxs(ToastContext.Provider, {\n value: store,\n children: [/*#__PURE__*/_jsx(ToastProviderPropsSynchronizer, {\n store: store,\n timeout: timeout,\n limit: limit\n }), children]\n });\n};\nif (process.env.NODE_ENV !== \"production\") ToastProvider.displayName = \"ToastProvider\";\nfunction ToastProviderPropsSynchronizer(props) {\n const {\n store,\n timeout,\n limit\n } = props;\n\n // `limit` needs custom syncing because changing it must also recompute each\n // toast's `limited` flag; `useSyncedValues` would only update the raw value.\n useIsoLayoutEffect(() => {\n store.syncProviderProps(timeout, limit);\n }, [store, timeout, limit]);\n return null;\n}","/**\n * Indicates the height of the frontmost toast.\n * @type {number}\n */\nexport const frontmostHeight = '--toast-frontmost-height';","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { activeElement, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { isFocusVisible } from \"../utils/focusVisible.mjs\";\nimport * as ToastViewportCssVars from \"./ToastViewportCssVars.mjs\";\n\n/**\n * A container viewport for toasts.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ToastViewport = /*#__PURE__*/React.forwardRef(function ToastViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const windowFocusTimeout = useTimeout();\n const handlingFocusGuardRef = React.useRef(false);\n const markedReadyForMouseLeaveRef = React.useRef(false);\n const touchActiveRef = React.useRef(false);\n const isEmpty = store.useState('isEmpty');\n const toasts = store.useState('toasts');\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n const prevFocusElement = store.useState('prevFocusElement');\n const frontmostHeight = toasts[0]?.height;\n const hasTransitioningToasts = toasts.some(toast => toast.transitionStatus === 'ending');\n const highPriorityToasts = toasts.filter(toast => toast.priority === 'high');\n React.useEffect(() => {\n // `store.state.viewport` isn't available on the first render, since the portal node hasn't yet\n // been created. Depending on `isEmpty` ensures the listeners are attached once toasts exist and\n // the viewport ref is available.\n const viewport = store.state.viewport;\n if (!viewport || isEmpty) {\n return undefined;\n }\n const win = ownerWindow(viewport);\n const doc = ownerDocument(viewport);\n\n // Listen globally for F6 so we can force-focus the viewport.\n function handleGlobalKeyDown(event) {\n if (event.key === 'F6' && getTarget(event) !== viewport) {\n event.preventDefault();\n store.set('prevFocusElement', activeElement(doc));\n viewport?.focus({\n preventScroll: true\n });\n store.pauseTimers();\n store.set('focused', true);\n }\n }\n function handleWindowBlur(event) {\n if (getTarget(event) !== win) {\n return;\n }\n store.set('isWindowFocused', false);\n store.pauseTimers();\n }\n function handleWindowFocus(event) {\n if (event.relatedTarget) {\n return;\n }\n const target = getTarget(event);\n const activeEl = activeElement(ownerDocument(viewport));\n if (target === win || !contains(viewport, target) || !isFocusVisible(activeEl)) {\n store.resumeTimers();\n }\n\n // Wait for the `handleFocus` event to fire.\n windowFocusTimeout.start(0, () => store.set('isWindowFocused', true));\n }\n return mergeCleanups(addEventListener(win, 'keydown', handleGlobalKeyDown), addEventListener(win, 'blur', handleWindowBlur, true), addEventListener(win, 'focus', handleWindowFocus, true), addEventListener(doc, 'pointerdown', store.handleDocumentPointerDown, true));\n }, [store, windowFocusTimeout, isEmpty]);\n function handleFocusGuard(event) {\n handlingFocusGuardRef.current = true;\n\n // If we're coming off the container, move to the first toast that can hold\n // focus, skipping toasts that are animating out or inert because they're limited.\n const firstFocusableToast = event.relatedTarget === store.state.viewport ? toasts.find(toast => toast.transitionStatus !== 'ending' && !toast.limited) : undefined;\n if (firstFocusableToast) {\n firstFocusableToast.ref?.current?.focus();\n } else {\n store.restoreFocusToPrevElement();\n }\n }\n function handleKeyDown(event) {\n if (event.key === 'Tab' && event.shiftKey && getTarget(event.nativeEvent) === store.state.viewport) {\n event.preventDefault();\n // Restoring focus blurs the viewport, and `handleBlur` resumes the timers\n // from there. Resuming here as well would also fire when the previously\n // focused element lives inside the viewport, letting toasts dismiss out\n // from under the keyboard.\n store.restoreFocusToPrevElement();\n }\n }\n function flushMouseLeave() {\n const hasEndingToasts = store.state.toasts.some(toast => toast.transitionStatus === 'ending');\n if (hasEndingToasts || touchActiveRef.current || !markedReadyForMouseLeaveRef.current) {\n return;\n }\n\n // Apply any mouseleave that was deferred until transitions finished.\n store.set('hovering', false);\n if (!store.select('expandedOrOutOfFocus')) {\n store.resumeTimers();\n }\n markedReadyForMouseLeaveRef.current = false;\n }\n React.useEffect(flushMouseLeave, [hasTransitioningToasts, store]);\n function handleMouseEnter() {\n store.pauseTimers();\n store.set('hovering', true);\n markedReadyForMouseLeaveRef.current = false;\n }\n function handleMouseLeave() {\n // Defer to `flushMouseLeave`: while toasts are transitioning out or a touch gesture is active it\n // records the intent and collapses later; otherwise it collapses immediately.\n markedReadyForMouseLeaveRef.current = true;\n flushMouseLeave();\n }\n function handlePointerDown(event) {\n if (event.pointerType === 'touch') {\n touchActiveRef.current = true;\n }\n }\n function handlePointerEnd(event) {\n if (event.pointerType !== 'touch') {\n return;\n }\n touchActiveRef.current = false;\n flushMouseLeave();\n }\n function handleFocus() {\n if (handlingFocusGuardRef.current) {\n handlingFocusGuardRef.current = false;\n return;\n }\n if (focused) {\n return;\n }\n\n // Only set focused when the active element is focus-visible.\n // This prevents the viewport from staying expanded when clicking inside without\n // keyboard navigation.\n if (isFocusVisible(activeElement(ownerDocument(store.state.viewport)))) {\n store.set('focused', true);\n store.pauseTimers();\n }\n }\n function handleBlur(event) {\n if (!focused || contains(store.state.viewport, event.relatedTarget)) {\n return;\n }\n store.set('focused', false);\n if (!store.select('expandedOrOutOfFocus')) {\n store.resumeTimers();\n }\n }\n const defaultProps = {\n tabIndex: -1,\n role: 'region',\n 'aria-live': 'polite',\n 'aria-atomic': false,\n 'aria-relevant': 'additions text',\n 'aria-label': 'Notifications',\n onMouseEnter: handleMouseEnter,\n onMouseMove: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onClick: handleFocus,\n onPointerDown: handlePointerDown,\n onPointerUp: handlePointerEnd,\n onPointerCancel: handlePointerEnd,\n style: {\n [ToastViewportCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined\n }\n };\n const state = {\n expanded\n };\n const focusGuard = !isEmpty && prevFocusElement && /*#__PURE__*/_jsx(FocusGuard, {\n onFocus: handleFocusGuard\n });\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.setViewport],\n state,\n props: [defaultProps, elementProps, {\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [focusGuard, children, focusGuard]\n })\n }]\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [focusGuard, element, !focused && highPriorityToasts.length > 0 && /*#__PURE__*/_jsx(\"div\", {\n style: visuallyHidden,\n children: highPriorityToasts.map(toast => /*#__PURE__*/_jsxs(\"div\", {\n role: \"alert\",\n \"aria-atomic\": true,\n children: [/*#__PURE__*/_jsx(\"div\", {\n children: toast.title\n }), /*#__PURE__*/_jsx(\"div\", {\n children: toast.description\n })]\n }, toast.id))\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastViewport.displayName = \"ToastViewport\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastRootContext.displayName = \"ToastRootContext\";\nexport function useToastRootContext() {\n const context = React.useContext(ToastRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.' : _formatErrorMessage(66));\n }\n return context;\n}","/**\n * Indicates the index of the toast in the list.\n * @type {number}\n */\nexport const index = '--toast-index';\n/**\n * Indicates the vertical pixels offset of the toast in the list when expanded.\n * @type {number}\n */\nexport const offsetY = '--toast-offset-y';\n/**\n * Indicates the measured natural height of the toast in pixels.\n * @type {number}\n */\nexport const height = '--toast-height';\n/**\n * Indicates the horizontal swipe movement of the toast.\n * @type {number}\n */\nexport const swipeMovementX = '--toast-swipe-movement-x';\n/**\n * Indicates the vertical swipe movement of the toast.\n * @type {number}\n */\nexport const swipeMovementY = '--toast-swipe-movement-y';","import { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Present when the toast is expanded in the viewport.\n * @type {boolean}\n */\nexport const expanded = 'data-expanded';\n/**\n * Present when the toast was limited because the toast limit was exceeded.\n * @type {boolean}\n */\nexport const limited = 'data-limited';\n/**\n * The type of the toast.\n * @type {string}\n */\nexport const type = 'data-type';\n/**\n * Present when the toast is being swiped.\n * @type {boolean}\n */\nexport const swiping = 'data-swiping';\n/**\n * The direction the toast was swiped.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\nexport const swipeDirection = 'data-swipe-direction';\n/**\n * Present when the toast begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n/**\n * Present when the toast is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { ToastRootContext } from \"./ToastRootContext.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { BASE_UI_SWIPE_IGNORE_SELECTOR, LEGACY_SWIPE_IGNORE_SELECTOR } from \"../../internals/constants.mjs\";\nimport { getDisplacement } from \"../../utils/useSwipeDismiss.mjs\";\nimport { getElementTransform } from \"../../utils/getElementTransform.mjs\";\nimport * as ToastRootCssVars from \"./ToastRootCssVars.mjs\";\nimport * as ToastRootDataAttributes from \"./ToastRootDataAttributes.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const toastRootStateAttributesMapping = {\n ...transitionStatusMapping,\n swipeDirection(value) {\n return value ? {\n [ToastRootDataAttributes.swipeDirection]: value\n } : null;\n }\n};\nconst SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst OPPOSITE_DIRECTION_DAMPING_FACTOR = 0.5;\nconst MIN_DRAG_THRESHOLD = 1;\nconst TOAST_SWIPE_IGNORE_SELECTOR = `${BASE_UI_SWIPE_IGNORE_SELECTOR},${LEGACY_SWIPE_IGNORE_SELECTOR}`;\n\n/**\n * Groups all parts of an individual toast.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastRoot = /*#__PURE__*/React.forwardRef(function ToastRoot(componentProps, forwardedRef) {\n const {\n toast,\n render,\n className,\n swipeDirection = ['down', 'right'],\n style,\n ...elementProps\n } = componentProps;\n const isAnchored = toast.positionerProps?.anchor !== undefined;\n let swipeDirections = [];\n if (!isAnchored) {\n swipeDirections = Array.isArray(swipeDirection) ? swipeDirection : [swipeDirection];\n }\n const swipeEnabled = swipeDirections.length > 0;\n const store = useToastProviderContext();\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [isRealSwipe, setIsRealSwipe] = React.useState(false);\n const [dragOffset, setDragOffset] = React.useState({\n x: 0,\n y: 0\n });\n const [initialTransform, setInitialTransform] = React.useState({\n x: 0,\n y: 0,\n scale: 1\n });\n const [titleId, setTitleId] = React.useState();\n const [descriptionId, setDescriptionId] = React.useState();\n const [lockedDirection, setLockedDirection] = React.useState(null);\n const rootRef = React.useRef(null);\n const lastToastIdRef = React.useRef(undefined);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const activePointerIdRef = React.useRef(null);\n const dragAbortControllerRef = React.useRef(null);\n const domIndex = store.useState('toastIndex', toast.id);\n const visibleIndex = store.useState('toastVisibleIndex', toast.id);\n const offsetY = store.useState('toastOffsetY', toast.id);\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n useOpenChangeComplete({\n open: toast.transitionStatus !== 'ending',\n ref: rootRef,\n onComplete() {\n if (toast.transitionStatus === 'ending') {\n store.removeToast(toast.id);\n }\n }\n });\n\n // Recalculates the natural height of the toast and updates it in the toast manager.\n // `flushSync` avoids visual flickers when called from observer callbacks.\n // The store ignores this write while the toast is transitioning out.\n const recalculateHeight = useStableCallback((flushSync = false) => {\n const element = rootRef.current;\n if (!element) {\n return;\n }\n const previousHeight = element.style.height;\n element.style.height = 'auto';\n const height = element.offsetHeight;\n element.style.height = previousHeight;\n function update() {\n store.updateToastInternal(toast.id, {\n ref: rootRef,\n height,\n transitionStatus: undefined\n });\n }\n if (flushSync) {\n ReactDOM.flushSync(update);\n } else {\n update();\n }\n });\n\n // Initialize the toast on mount, and reinitialize when it begins a new lifecycle:\n // re-adding an ending toast retains the same root instance (`key={toast.id}`), and\n // index-keyed lists can hand an existing instance a different toast.\n useIsoLayoutEffect(() => {\n const previousToastId = lastToastIdRef.current;\n // `recalculateHeight` clears the `starting` status itself, so bail out on the\n // resulting re-run and on the later `ending` one, which the store discards anyway.\n if (toast.transitionStatus !== 'starting' && previousToastId === toast.id) {\n return;\n }\n if (previousToastId !== undefined) {\n // A retained root keeps component-local swipe state from its previous lifecycle;\n // clear it so the toast doesn't stay offset or exit in the swiped direction.\n setCurrentSwipeDirection(undefined);\n setInitialTransform({\n x: 0,\n y: 0,\n scale: 1\n });\n setResolvedDragOffset({\n x: 0,\n y: 0\n });\n }\n lastToastIdRef.current = toast.id;\n recalculateHeight();\n }, [recalculateHeight, toast.id, toast.transitionStatus]);\n function setResolvedDragOffset(nextDragOffset) {\n dragOffsetRef.current = nextDragOffset;\n setDragOffset(nextDragOffset);\n }\n useIsoLayoutEffect(() => {\n return () => {\n dragAbortControllerRef.current?.abort();\n };\n }, []);\n function applyDirectionalDamping(deltaX, deltaY) {\n const damp = delta => delta > 0 ? delta ** OPPOSITE_DIRECTION_DAMPING_FACTOR : -(Math.abs(delta) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);\n const dampX = deltaX > 0 && !swipeDirections.includes('right') || deltaX < 0 && !swipeDirections.includes('left');\n const dampY = deltaY > 0 && !swipeDirections.includes('down') || deltaY < 0 && !swipeDirections.includes('up');\n return {\n x: dampX ? damp(deltaX) : deltaX,\n y: dampY ? damp(deltaY) : deltaY\n };\n }\n const handleSwipeEnd = useStableCallback(event => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n activePointerIdRef.current = null;\n dragAbortControllerRef.current?.abort();\n dragAbortControllerRef.current = null;\n setIsSwiping(false);\n setIsRealSwipe(false);\n setLockedDirection(null);\n const resolvedInitialTransform = initialTransformRef.current;\n if (event.type === 'pointercancel' || cancelledSwipeRef.current) {\n setResolvedDragOffset({\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const deltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const deltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n let dismissDirection;\n for (const direction of swipeDirections) {\n if (getDisplacement(direction, deltaX, deltaY) > SWIPE_THRESHOLD) {\n dismissDirection = direction;\n break;\n }\n }\n if (dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n store.closeToast(toast.id);\n } else {\n setResolvedDragOffset({\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n }\n });\n function handlePointerDown(event) {\n if (event.button !== 0) {\n return;\n }\n if (event.pointerType === 'touch') {\n store.pauseTimers();\n }\n const target = getTarget(event.nativeEvent);\n const isInteractiveElement = closest(target, `button,a,input,textarea,[role=\"button\"],${TOAST_SWIPE_IGNORE_SELECTOR}`);\n if (isInteractiveElement) {\n return;\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n activePointerIdRef.current = event.pointerId;\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n swipeCancelBaselineRef.current = dragStartPosRef.current;\n const element = event.currentTarget;\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n setInitialTransform(transform);\n setResolvedDragOffset({\n x: transform.x,\n y: transform.y\n });\n store.set('hovering', true);\n setIsSwiping(true);\n setIsRealSwipe(false);\n setLockedDirection(null);\n isFirstPointerMoveRef.current = true;\n dragAbortControllerRef.current?.abort();\n const dragAbortController = new AbortController();\n dragAbortControllerRef.current = dragAbortController;\n const doc = ownerDocument(element);\n doc.addEventListener('pointerup', handleSwipeEnd, {\n signal: dragAbortController.signal\n });\n doc.addEventListener('pointercancel', handleSwipeEnd, {\n signal: dragAbortController.signal\n });\n element.setPointerCapture?.(event.pointerId);\n }\n function handlePointerMove(event) {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n\n // Prevent text selection on Safari\n event.preventDefault();\n if (isFirstPointerMoveRef.current) {\n // Adjust the starting position to the current position on the first move\n // to account for the delay between pointerdown and the first pointermove on iOS.\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n isFirstPointerMoveRef.current = false;\n }\n const {\n clientY,\n clientX,\n movementX,\n movementY\n } = event;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let resolvedLockedDirection = lockedDirection;\n if (!isRealSwipe) {\n const movementDistance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (movementDistance >= MIN_DRAG_THRESHOLD) {\n setIsRealSwipe(true);\n // `lockedDirection` is always reset alongside `isRealSwipe`, so it is\n // still `null` here. Locking is only meaningful when both axes are\n // swipeable; otherwise the single axis already constrains the gesture.\n const hasHorizontal = swipeDirections.includes('left') || swipeDirections.includes('right');\n const hasVertical = swipeDirections.includes('up') || swipeDirections.includes('down');\n if (hasHorizontal && hasVertical) {\n const absX = Math.abs(deltaX);\n const absY = Math.abs(deltaY);\n resolvedLockedDirection = absX > absY ? 'horizontal' : 'vertical';\n setLockedDirection(resolvedLockedDirection);\n }\n }\n }\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (resolvedLockedDirection === 'vertical') {\n if (deltaY > 0) {\n candidate = 'down';\n } else if (deltaY < 0) {\n candidate = 'up';\n }\n } else if (resolvedLockedDirection === 'horizontal') {\n if (deltaX > 0) {\n candidate = 'right';\n } else if (deltaX < 0) {\n candidate = 'left';\n }\n } else if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate && swipeDirections.includes(candidate)) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > SWIPE_THRESHOLD) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(swipeDirections.includes('left') && swipeDirections.includes('right')) && !(swipeDirections.includes('up') && swipeDirections.includes('down')) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n const hasHorizontalDir = swipeDirections.includes('left') || swipeDirections.includes('right');\n const hasVerticalDir = swipeDirections.includes('up') || swipeDirections.includes('down');\n if (resolvedLockedDirection !== 'vertical' && hasHorizontalDir) {\n newOffsetX += dampedDelta.x;\n }\n if (resolvedLockedDirection !== 'horizontal' && hasVerticalDir) {\n newOffsetY += dampedDelta.y;\n }\n setResolvedDragOffset({\n x: newOffsetX,\n y: newOffsetY\n });\n }\n function handleKeyDown(event) {\n if (event.key === 'Escape') {\n if (!rootRef.current || !contains(rootRef.current, activeElement(ownerDocument(rootRef.current)))) {\n return;\n }\n store.closeToast(toast.id);\n }\n }\n React.useEffect(() => {\n const element = rootRef.current;\n if (!swipeEnabled || !element) {\n return undefined;\n }\n function preventDefaultTouchStart(event) {\n if (activePointerIdRef.current === null || !contains(element, getTarget(event))) {\n return;\n }\n\n // React's pointermove preventDefault is not enough on iOS; this\n // non-passive touchmove listener blocks native scrolling while dragging.\n event.preventDefault();\n }\n return addEventListener(element, 'touchmove', preventDefaultTouchStart, {\n passive: false\n });\n }, [swipeEnabled]);\n function getDragStyles() {\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n return {\n transition: isSwiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: isSwiping ? `translateX(${dragOffset.x}px) translateY(${dragOffset.y}px) scale(${initialTransform.scale})` : undefined,\n [ToastRootCssVars.swipeMovementX]: `${deltaX}px`,\n [ToastRootCssVars.swipeMovementY]: `${deltaY}px`\n };\n }\n const isHighPriority = toast.priority === 'high';\n const defaultProps = {\n role: isHighPriority ? 'alertdialog' : 'dialog',\n tabIndex: 0,\n 'aria-modal': false,\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n 'aria-hidden': isHighPriority && !focused ? true : undefined,\n onPointerDown: swipeEnabled ? handlePointerDown : undefined,\n onPointerMove: swipeEnabled ? handlePointerMove : undefined,\n onPointerUp: swipeEnabled ? handleSwipeEnd : undefined,\n onPointerCancel: swipeEnabled ? handleSwipeEnd : undefined,\n onKeyDown: handleKeyDown,\n inert: inertValue(toast.limited),\n style: {\n ...getDragStyles(),\n [ToastRootCssVars.index]: toast.transitionStatus === 'ending' ? domIndex : visibleIndex,\n [ToastRootCssVars.offsetY]: `${offsetY}px`,\n [ToastRootCssVars.height]: toast.height ? `${toast.height}px` : undefined\n }\n };\n const toastRoot = React.useMemo(() => ({\n toast,\n setTitleId,\n setDescriptionId,\n recalculateHeight,\n visibleIndex,\n expanded\n }), [toast, setTitleId, setDescriptionId, recalculateHeight, visibleIndex, expanded]);\n const state = {\n transitionStatus: toast.transitionStatus,\n expanded,\n limited: toast.limited || false,\n type: toast.type,\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, rootRef],\n state,\n stateAttributesMapping: toastRootStateAttributesMapping,\n props: [defaultProps, elementProps]\n });\n return /*#__PURE__*/_jsx(ToastRootContext.Provider, {\n value: toastRoot,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastRoot.displayName = \"ToastRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * A container for the contents of a toast.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastContent = /*#__PURE__*/React.forwardRef(function ToastContent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n visibleIndex,\n expanded,\n recalculateHeight\n } = useToastRootContext();\n const contentRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n recalculateHeight();\n const node = contentRef.current;\n if (!node || typeof ResizeObserver !== 'function' || typeof MutationObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(() => recalculateHeight(true));\n const mutationObserver = new MutationObserver(() => recalculateHeight(true));\n resizeObserver.observe(node);\n mutationObserver.observe(node, {\n childList: true,\n subtree: true,\n characterData: true\n });\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n };\n }, [recalculateHeight]);\n const behind = visibleIndex > 0;\n const state = {\n expanded,\n behind\n };\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, contentRef],\n state,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastContent.displayName = \"ToastContent\";","import * as React from 'react';\nexport function isRenderableNode(node) {\n if (node == null || typeof node === 'boolean' || node === '') {\n return false;\n }\n if (Array.isArray(node)) {\n return node.some(isRenderableNode);\n }\n return true;\n}\nexport function hasRenderableChildren(element) {\n return /*#__PURE__*/React.isValidElement(element) && isRenderableNode(element.props.children);\n}","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { hasRenderableChildren } from \"./isRenderableNode.mjs\";\n\n/**\n * Shared logic for `Toast.Title` and `Toast.Description`, which only differ by the rendered tag,\n * the fallback content, and which id setter they register with. Resolves the content and returns\n * the pieces each part passes to `useRenderElement` and `useToastLabelElement`.\n */\nexport function useToastLabelPart(idProp, childrenProp, part) {\n const {\n toast,\n setTitleId,\n setDescriptionId\n } = useToastRootContext();\n const setId = part === 'title' ? setTitleId : setDescriptionId;\n const children = childrenProp ?? (part === 'title' ? toast.title : toast.description);\n const id = useId(idProp);\n return {\n id,\n children,\n type: toast.type,\n setId\n };\n}\n\n/**\n * Mounts the evaluated label element only when it carries renderable content (so a `render` prop's\n * own children count, while a childless styling-only `render` stays conditional), registering the\n * generated id with the root while the part renders.\n */\nexport function useToastLabelElement(element, id, setId) {\n const shouldRender = hasRenderableChildren(element);\n useIsoLayoutEffect(() => {\n if (!shouldRender) {\n return undefined;\n }\n setId(id);\n return () => {\n setId(currentId => currentId === id ? undefined : currentId);\n };\n }, [shouldRender, id, setId]);\n return shouldRender ? element : null;\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useToastLabelElement, useToastLabelPart } from \"../utils/useToastLabelPart.mjs\";\n\n/**\n * A description that describes the toast.\n * Can be used as the default message for the toast when no title is provided.\n * Renders a `<p>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastDescription = /*#__PURE__*/React.forwardRef(function ToastDescription(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n id,\n children,\n type,\n setId\n } = useToastLabelPart(idProp, childrenProp, 'description');\n const state = {\n type\n };\n const element = useRenderElement('p', componentProps, {\n ref: forwardedRef,\n state,\n props: {\n ...elementProps,\n id,\n children\n }\n });\n return useToastLabelElement(element, id, setId);\n});\nif (process.env.NODE_ENV !== \"production\") ToastDescription.displayName = \"ToastDescription\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useToastLabelElement, useToastLabelPart } from \"../utils/useToastLabelPart.mjs\";\n\n/**\n * A title that labels the toast.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastTitle = /*#__PURE__*/React.forwardRef(function ToastTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n id,\n children,\n type,\n setId\n } = useToastLabelPart(idProp, childrenProp, 'title');\n const state = {\n type\n };\n const element = useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n state,\n props: {\n ...elementProps,\n id,\n children\n }\n });\n return useToastLabelElement(element, id, setId);\n});\nif (process.env.NODE_ENV !== \"production\") ToastTitle.displayName = \"ToastTitle\";","'use client';\n\nimport * as React from 'react';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * Closes the toast when clicked.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastClose = /*#__PURE__*/React.forwardRef(function ToastClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const {\n toast,\n expanded\n } = useToastRootContext();\n const [hasFocus, setHasFocus] = React.useState(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n type: toast.type\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n 'aria-hidden': !expanded && !hasFocus,\n onClick() {\n store.closeToast(toast.id);\n },\n onFocus() {\n setHasFocus(true);\n },\n onBlur() {\n setHasFocus(false);\n }\n }, elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastClose.displayName = \"ToastClose\";","'use client';\n\nimport * as React from 'react';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { hasRenderableChildren } from \"../utils/isRenderableNode.mjs\";\n\n/**\n * Performs an action when clicked.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastAction = /*#__PURE__*/React.forwardRef(function ToastAction(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const {\n toast\n } = useToastRootContext();\n const computedChildren = toast.actionProps?.children ?? elementProps.children;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n type: toast.type\n };\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [elementProps, toast.actionProps, getButtonProps, {\n children: computedChildren\n }]\n });\n return hasRenderableChildren(element) ? element : null;\n});\nif (process.env.NODE_ENV !== \"production\") ToastAction.displayName = \"ToastAction\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortalLite } from \"../../utils/FloatingPortalLite.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A portal element that moves the viewport to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastPortal = /*#__PURE__*/React.forwardRef(function ToastPortal(props, forwardedRef) {\n return /*#__PURE__*/_jsx(FloatingPortalLite, {\n ref: forwardedRef,\n ...props\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastPortal.displayName = \"ToastPortal\";","'use client';\n\nimport * as React from 'react';\nimport { useToastProviderContext } from \"./provider/ToastProviderContext.mjs\";\n/**\n * Returns the array of toasts and methods to manage them.\n */\nexport function useToastManager() {\n const store = useToastProviderContext();\n const toasts = store.useState('toasts');\n return React.useMemo(() => ({\n toasts,\n add: store.addToast,\n close: store.closeToast,\n update: store.updateToast,\n promise: store.promiseToast\n }), [toasts, store]);\n}","\nimport { Props as __zyzzProps } from 'zyzz/runtime';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as BaseUi from '@base-ui/react/toast';\nimport { AlertCircle } from '../icons/AlertCircle.js';\nimport { AlertTriangle } from '../icons/AlertTriangle.js';\nimport { CheckCircle } from '../icons/CheckCircle.js';\nimport { Close } from '../icons/Close.js';\nimport { InfoCircle } from '../icons/InfoCircle.js';\nimport { style, variants } from '../zyzz.config.js';\nconst icons = {\n info: InfoCircle,\n negative: AlertCircle,\n positive: CheckCircle,\n warning: AlertTriangle,\n};\n/**\n * Brief notifications queued with `Toast.useToast` and rendered by `Toast.Viewport` in a portal.\n * The viewport is a `region` live area that F6 focuses. Hovering it or moving keyboard focus into\n * it pauses the dismiss timers, which also pause while the window is blurred.\n *\n * - Use toasts for brief, non-critical confirmations. Show critical errors inline or in a dialog.\n * - Never make a toast action the only path to a task, since the toast can dismiss before use.\n * - Pass `timeout: 0` for a toast that must stay until the user dismisses it.\n * - Reserve `priority: 'high'` for urgent toasts, which Base UI announces assertively.\n *\n * @example\n * <Toast.Provider>\n * <App />\n * <Toast.Viewport />\n * </Toast.Provider>\n *\n * @see {@link https://base-ui.com/react/components/toast | Base UI Toast}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/status_role | MDN status role}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/alert_role | MDN alert role}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html | WCAG 2.2 Status Messages}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/timing-adjustable.html | WCAG 2.2 Timing Adjustable}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html | WCAG 2.2 Pause, Stop, Hide}\n */\nexport var Toast;\n(function (Toast) {\n /**\n * Holds the toast queue for `Toast.useToast` and `Toast.Viewport` beneath it. The oldest toasts\n * past `limit` stay mounted but hidden.\n */\n function Provider(props) {\n return _jsx(BaseUi.Toast.Provider, { ...props });\n }\n Toast.Provider = Provider;\n /**\n * Returns `add`, which queues a toast and returns its id, and `close`, which dismisses the toast\n * with that id or every toast when called without one. Call it under `Toast.Provider`.\n *\n * @example\n * const toast = Toast.useToast()\n * toast.add({ intent: 'positive', title: 'Payment sent' })\n */\n function useToast() {\n const manager = BaseUi.Toast.useToastManager();\n return {\n add(options) {\n const { action, intent, ...rest } = options;\n return manager.add({\n ...rest,\n actionProps: action && { children: action.label, onClick: action.onClick },\n type: intent,\n });\n },\n close: manager.close,\n };\n }\n Toast.useToast = useToast;\n /**\n * Renders the queued toasts in a portal, each with its title, description, optional action and\n * a Dismiss button. It spans the bottom edge on narrow screens and sits 24rem wide at the bottom\n * end from 40rem up.\n */\n function Viewport(props) {\n const { className, vars, ...attributes } = props;\n const { toasts } = BaseUi.Toast.useToastManager();\n return (_jsx(BaseUi.Toast.Portal, { children: _jsx(BaseUi.Toast.Viewport, { ...attributes, ...styles.viewport({ className, style: props.style, vars }), children: toasts.map((toast) => {\n const intent = (toast.type ?? 'neutral');\n const Glyph = intent === 'neutral' ? undefined : icons[intent];\n return (_jsx(BaseUi.Toast.Root, { toast: toast, ...styles.root(), children: _jsxs(BaseUi.Toast.Content, { ...styles.content(), children: [Glyph && (_jsx(\"span\", { \"aria-hidden\": \"true\", ...styles.icon({ intent }), children: _jsx(Glyph, {}) })), _jsxs(\"div\", { ...styles.body(), children: [_jsx(BaseUi.Toast.Title, { ...styles.title() }), _jsx(BaseUi.Toast.Description, { ...styles.description() })] }), toast.actionProps && _jsx(BaseUi.Toast.Action, { ...styles.action() }), _jsx(BaseUi.Toast.Close, { \"aria-label\": \"Dismiss\", ...styles.close(), children: _jsx(Close, {}) })] }) }, toast.id));\n }) }) }));\n }\n Toast.Viewport = Viewport;\n})(Toast || (Toast = {}));\nvar styles;\n(function (styles) {\n styles.action = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6I0 z_tds_2f_web-xYZB6I1 z_tds_2f_web-xYZB6I2 z_tds_2f_web-xYZB6I3 z_tds_2f_web-xYZB6I4 z_tds_2f_web-xYZB6I5 z_tds_2f_web-xYZB6I6 z_tds_2f_web-xYZB6I7 z_tds_2f_web-xYZB6I8 z_tds_2f_web-xYZB6I9 z_tds_2f_web-xYZB6Ia z_tds_2f_web-xYZB6Ib z_tds_2f_web-xYZB6Ic z_tds_2f_web-xYZB6Id z_tds_2f_web-xYZB6Ie z_tds_2f_web-xYZB6If z_tds_2f_web-xYZB6Ig z_tds_2f_web-xYZB6Ih z_tds_2f_web-xYZB6Ii z_tds_2f_web-xYZB6Ij z_tds_2f_web-xYZB6Ik z_tds_2f_web-xYZB6Il z_tds_2f_web-xYZB6Im z_tds_2f_web-xYZB6In z_tds_2f_web-xYZB6Io z_tds_2f_web-xYZB6Ip z_tds_2f_web-xYZB6Iq z_tds_2f_web-xYZB6Ir z_tds_2f_web-xYZB6Is\"});\n styles.body = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6It z_tds_2f_web-xYZB6Iu z_tds_2f_web-xYZB6Iv z_tds_2f_web-xYZB6Iw z_tds_2f_web-xYZB6Ix\"});\n styles.close = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6I0 z_tds_2f_web-xYZB6Iy z_tds_2f_web-xYZB6I2 z_tds_2f_web-xYZB6I3 z_tds_2f_web-xYZB6Iz z_tds_2f_web-xYZB6I5 z_tds_2f_web-xYZB6I10 z_tds_2f_web-xYZB6I11 z_tds_2f_web-xYZB6I12 z_tds_2f_web-xYZB6I13 z_tds_2f_web-xYZB6I14 z_tds_2f_web-xYZB6I15 z_tds_2f_web-xYZB6I16 z_tds_2f_web-xYZB6If z_tds_2f_web-xYZB6Io z_tds_2f_web-xYZB6Ig z_tds_2f_web-xYZB6Ip z_tds_2f_web-xYZB6Ih z_tds_2f_web-xYZB6Ii z_tds_2f_web-xYZB6Ij z_tds_2f_web-xYZB6Ik z_tds_2f_web-xYZB6Ir z_tds_2f_web-xYZB6Il z_tds_2f_web-xYZB6In z_tds_2f_web-xYZB6Is z_tds_2f_web-xYZB6I17\"});\n styles.content = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6I0 z_tds_2f_web-xYZB6I18 z_tds_2f_web-xYZB6I19 z_tds_2f_web-xYZB6I1a z_tds_2f_web-xYZB6I1b z_tds_2f_web-xYZB6I1c z_tds_2f_web-xYZB6I1d z_tds_2f_web-xYZB6I1e z_tds_2f_web-xYZB6I1f z_tds_2f_web-xYZB6I1g z_tds_2f_web-xYZB6Il z_tds_2f_web-xYZB6I1h z_tds_2f_web-xYZB6I1i z_tds_2f_web-xYZB6I1j\"});\n styles.description = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6I1k z_tds_2f_web-xYZB6I1l z_tds_2f_web-xYZB6I1m z_tds_2f_web-xYZB6I1n z_tds_2f_web-xYZB6I1o z_tds_2f_web-xYZB6I1p z_tds_2f_web-xYZB6I1q\"});\n styles.icon = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xYZB6I1r z_tds_2f_web-xYZB6I11 z_tds_2f_web-xYZB6I1s z_tds_2f_web-xYZB6I1t z_tds_2f_web-xYZB6I1u z_tds_2f_web-xYZB6I1v z_tds_2f_web-xYZB6I1w\"+\" \"+external:\"z_tds_2f_web-xYZB6I1r z_tds_2f_web-xYZB6I11 z_tds_2f_web-xYZB6I1s z_tds_2f_web-xYZB6I1t z_tds_2f_web-xYZB6I1u z_tds_2f_web-xYZB6I1v z_tds_2f_web-xYZB6I1w\",result=inline?{className,style:inline}:{className};let value;value=Object.hasOwn(input,\"intent\")?input[\"intent\"]:void 0;if(value!==null&&value!==void 0)result[\"data-intent\"]=String(value);return result});\n styles.root = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6I1x z_tds_2f_web-xYZB6I1y z_tds_2f_web-xYZB6I1z z_tds_2f_web-xYZB6I18 z_tds_2f_web-xYZB6I20 z_tds_2f_web-xYZB6I21 z_tds_2f_web-xYZB6I22 z_tds_2f_web-xYZB6I23 z_tds_2f_web-xYZB6I24 z_tds_2f_web-xYZB6I25 z_tds_2f_web-xYZB6I26 z_tds_2f_web-xYZB6I27 z_tds_2f_web-xYZB6I28 z_tds_2f_web-xYZB6I29 z_tds_2f_web-xYZB6I2a z_tds_2f_web-xYZB6I2b z_tds_2f_web-xYZB6I2c z_tds_2f_web-xYZB6I2d z_tds_2f_web-xYZB6I2e z_tds_2f_web-xYZB6I2f z_tds_2f_web-xYZB6I2g z_tds_2f_web-xYZB6I2h z_tds_2f_web-xYZB6I2i z_tds_2f_web-xYZB6I2j z_tds_2f_web-xYZB6I2k z_tds_2f_web-xYZB6I2l z_tds_2f_web-xYZB6I2m z_tds_2f_web-xYZB6I2n z_tds_2f_web-xYZB6I2o z_tds_2f_web-xYZB6I2p z_tds_2f_web-xYZB6I2q z_tds_2f_web-xYZB6I2r z_tds_2f_web-xYZB6I2s\"});\n styles.title = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6I20 z_tds_2f_web-xYZB6I1l z_tds_2f_web-xYZB6I2t z_tds_2f_web-xYZB6I2u z_tds_2f_web-xYZB6I2v z_tds_2f_web-xYZB6I2w z_tds_2f_web-xYZB6I2x\"});\n styles.viewport = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xYZB6I2y z_tds_2f_web-xYZB6I2z z_tds_2f_web-xYZB6I30 z_tds_2f_web-xYZB6I31 z_tds_2f_web-xYZB6I32 z_tds_2f_web-xYZB6I33 z_tds_2f_web-xYZB6I34 z_tds_2f_web-xYZB6I35 z_tds_2f_web-xYZB6I36\"});\n})(styles || (styles = {}));\n//# sourceMappingURL=Toast.js.map\nimport './Toast.css';\n","/**\n * The account page: Tempo Accounts and balances, the faucet, passkeys, and sign-out. On a chain\n * with configurable accounts, it also adds owners and upgrades a passkey's account.\n * @module\n */\nimport { useMutation, useQueries, useQueryClient } from '@tanstack/react-query'\nimport { createFileRoute, useRouter } from '@tanstack/react-router'\nimport { Toast } from '@tempoxyz/ds'\nimport { DetailedError, parseResponse } from 'hono/client'\nimport { Authentication, Registration } from 'webauthx/client'\nimport type * as Chain from '../../internal/Chain.js'\nimport * as Client from '../lib/Client.js'\nimport * as Loader from '../lib/Loader.js'\nimport * as Upgrade from '../lib/Upgrade.js'\nimport { Account } from '../screens/Account.js'\nimport { style } from '../zyzz.config.js'\n\n/** Wraps a failure of the browser's passkey ceremony. */\nclass CeremonyError extends Error {\n override name = 'Page.CeremonyError'\n}\n\nexport const Route = createFileRoute('/')({\n component: () => <Page {...Route.useLoaderData()} />,\n /**\n * Redirects a visitor without a session to sign-in. Otherwise returns the user and the `default`\n * realm's accounts, after creating the first if none exists, or `accounts: null`.\n */\n loader: async (match): Promise<Page.Props> => {\n const client = Client.create()\n const requested = match.deps.chain ?? 'mainnet'\n // One read returns the user, the accounts, and the passkeys, and refuses a visitor without a\n // session before it spends a limit.\n const read = (chain: Chain.Chain) =>\n parseResponse(client.v1.account.$get({ query: { chain } })).catch(\n (error: unknown) => ({ error }),\n )\n const first = await read(requested)\n // A name that no chain has, such as a stale link's, reads Tempo mainnet, as a page without\n // `chain` does. The read sends no other field that the API refuses with `invalid_field`.\n const unknown =\n requested !== 'mainnet' &&\n 'error' in first &&\n Client.reason(first.error) === 'invalid_field'\n const chain = unknown ? 'mainnet' : requested\n const account = unknown ? await read(chain) : first\n // The sign-in offers the wallet upgrade on this page's chain, then returns here.\n const signIn = match.deps.chain ? `/login?chain=${chain}` : '/login'\n if ('error' in account) {\n if (Client.reason(account.error) === 'session_required')\n Loader.redirect({ href: signIn })\n // A refused or failed read returns no user, so the session's user fills the page. The read of\n // the sign-in methods calls no Privy app, so a user can add a passkey during a Privy outage.\n const [session, methods] = await Promise.all([\n parseResponse(client.v1.auth.session.$get()),\n parseResponse(client.v1.auth.methods.$get({ query: {} })).catch(() => ({\n passkeys: false,\n })),\n ])\n if (!session.user) Loader.redirect({ href: signIn })\n return {\n accountError: failure(account.error),\n accounts: null,\n configurable: null,\n email: session.user.email,\n faucet: null,\n name: session.user.name,\n passkeys: methods.passkeys,\n }\n }\n\n const user = {\n email: account.email,\n name: account.name,\n passkeys: account.passkeys,\n }\n // A user without a wallet, such as one whose creation at sign-in failed or a spent limit\n // skipped, receives one here, so a signed-in user always holds one where the realm creates\n // wallets. The creation returns the accounts with their balances, and a realm that creates no\n // wallets returns the empty list.\n const listed =\n account.tempo.length > 0\n ? account\n : await parseResponse(\n client.v1.account.$post({ json: { chain } }),\n ).catch((error: unknown) => ({ error }))\n if ('error' in listed)\n return {\n ...user,\n accountError: failure(listed.error),\n accounts: null,\n configurable: null,\n faucet: null,\n }\n\n // `GET /i/chains` states whether the chain's accounts are configurable and whether its faucet\n // funds them. A failed read of it offers no faucet, and no owner change.\n const listing = await (async () => {\n const { chains } = await parseResponse(client.i.chains.$get()).catch(\n () => ({ chains: [] }),\n )\n const found = chains.find((entry) => entry.name === chain)\n return {\n configurable: found?.configurable ?? false,\n faucet: found?.faucet ?? false,\n }\n })()\n\n // On a chain whose accounts are configurable, a wallet.tempo passkey of the user's email that has\n // not linked is the user's wallet too, whose upgrade links it. A failed read lists none.\n const unlinked = listing.configurable\n ? (\n await parseResponse(client.i.account.passkeys.$get()).catch(() => ({\n passkeys: [],\n }))\n ).passkeys\n : []\n\n // The key that acts as the account names its kind, and the guard only narrows the read.\n return {\n ...user,\n accountError: null,\n accounts: [\n ...listed.tempo.flatMap((entry) => {\n const owner =\n entry.config.owners.find(\n (candidate) =>\n candidate.owner.toLowerCase() === entry.address.toLowerCase(),\n ) ?? entry.config.owners[0]\n return owner\n ? [\n {\n address: entry.address,\n balance: 'balance' in entry ? (entry.balance ?? null) : null,\n configurable: entry.config.chainId !== undefined,\n owner: owner.type,\n owners: entry.config.owners.map(\n (candidate) => candidate.type,\n ),\n },\n ]\n : []\n }),\n ...unlinked.map((entry) => ({\n address: entry.address,\n balance: null,\n credentialId: entry.credentialId,\n owner: 'webAuthn' as const,\n })),\n ],\n configurable: listing.configurable ? chain : null,\n faucet: listing.faucet ? chain : null,\n }\n },\n // A change of chain loads the balances again.\n loaderDeps: (match: { search: { chain?: Chain.Chain | undefined } }) => ({\n chain: match.search.chain,\n }),\n})\n\n/** Renders the page. */\nfunction Page(props: Page.Props) {\n const client = Client.use()\n const router = useRouter()\n const toast = Toast.useToast()\n const fund = useMutation({\n mutationFn: (variables: { address: `0x${string}`; chain: Chain.Chain }) =>\n parseResponse(client.i.account.fund.$post({ json: variables })),\n // The mutation stays pending until the balances load again, so the button holds until then.\n onSuccess: () => router.invalidate({ sync: true }),\n })\n const signOut = useMutation({\n mutationFn: () => parseResponse(client.v1.auth.logout.$post()),\n // The mutation stays pending until the sign-in page renders, so the button holds until then.\n onSuccess: () => router.navigate({ to: '/login' }),\n })\n // One click runs both ceremonies, since the new passkey signs a proof challenge: its attestation\n // proves no private key. Safari before iOS 17.4 can refuse the second ceremony.\n const passkey = useMutation({\n async mutationFn(variables: { account?: `0x${string}` | undefined }) {\n const { options } = await parseResponse(\n client.v1.account.passkey.options.$post({ json: {} }),\n )\n // The response reads an absent `excludeCredentials` as `undefined`, which the ceremony's options\n // omit instead.\n const { excludeCredentials, ...publicKey } = options.publicKey\n const credential = await (async () => {\n try {\n return await Registration.create({\n options: {\n publicKey: {\n ...publicKey,\n ...(excludeCredentials ? { excludeCredentials } : {}),\n },\n },\n })\n } catch (error) {\n throw new CeremonyError('Passkey ceremony failed.', { cause: error })\n }\n })()\n const created = { credentialId: credential.id, rpId: publicKey.rp.id }\n // Tempo ID stores the passkey only after its proof, so a failure before the proof drops the\n // passkey from the device. The next click creates another.\n const assertion = await (async () => {\n try {\n const { step } = await parseResponse(\n client.v1.account.passkey.$post({ json: { credential } }),\n )\n return await Authentication.sign({\n // ox types the request with optional members that the DOM types leave out when absent.\n // The object is the one that ox built for `navigator.credentials.get`.\n getFn: (request) =>\n navigator.credentials.get(request as CredentialRequestOptions),\n options: step.options,\n }).catch((error: unknown) => {\n throw new CeremonyError('Passkey ceremony failed.', {\n cause: error,\n })\n })\n } catch (error) {\n forget(created)\n throw error\n }\n })()\n try {\n const { account } = variables\n // The request names the chain that the page shows, where an update applies and whose address\n // of the passkey's own account the response returns.\n return await parseResponse(\n client.v1.account.passkey.verify.$post({\n json: {\n assertion,\n ...(account ? { account } : {}),\n ...(props.configurable ? { chain: props.configurable } : {}),\n },\n }),\n )\n } catch (error) {\n // Any failure but a refusal can follow a stored passkey, so the device keeps it.\n if (refused(error)) forget(created)\n throw error\n }\n },\n // The mutation stays pending until the accounts load again, so the new passkey's wallet shows\n // with the toast.\n async onSuccess() {\n await router.invalidate({ sync: true })\n toast.add({ intent: 'positive', title: 'Passkey added' })\n },\n })\n\n // A wallet.tempo passkey's account upgrades with one click. The page prepares each upgrade's passkey\n // step ahead of the click, since a browser such as Safari spends a click's user activation on a\n // request before the ceremony. A step lasts 5 minutes, so the page prepares it again before then.\n const upgradable = props.configurable\n ? (props.accounts ?? []).filter(\n (entry) => !entry.configurable && entry.owner === 'webAuthn',\n )\n : []\n const queryClient = useQueryClient()\n const steps = useQueries({\n queries: upgradable.map((entry) => ({\n queryFn: () =>\n Upgrade.prepare(client, {\n chain: props.configurable!,\n target: target(entry),\n }),\n queryKey: ['upgrade', props.configurable, entry.address],\n refetchInterval: Upgrade.stepLifetime,\n // A hidden tab keeps its step fresh, and a tab that comes back after a stale step prepares\n // another, since the server keeps a step for 5 minutes.\n refetchIntervalInBackground: true,\n refetchOnWindowFocus: true,\n retry: false,\n staleTime: Upgrade.stepLifetime,\n })),\n })\n const upgrade = useMutation({\n async mutationFn(variables: { address: `0x${string}` }) {\n const index = upgradable.findIndex(\n (entry) => entry.address === variables.address,\n )\n const entry = upgradable[index]!\n // A step that failed to load, such as for a session older than 10 minutes, loads now, so its\n // refusal shows. So does one older than 4 minutes, which the server may already have expired.\n // The cache holds the newest step, since a background refetch renders the page no second time.\n const step = queryClient.getQueryState<\n Awaited<ReturnType<typeof Upgrade.prepare>>\n >(['upgrade', props.configurable, entry.address])\n const options =\n step?.data && Date.now() - step.dataUpdatedAt < Upgrade.stepLifetime\n ? step.data\n : await Upgrade.prepare(client, {\n chain: props.configurable!,\n target: target(entry),\n })\n const assertion = await (async () => {\n try {\n return await Authentication.sign({\n getFn: (request) =>\n navigator.credentials.get(request as CredentialRequestOptions),\n options,\n })\n } catch (error) {\n throw new CeremonyError('Passkey ceremony failed.', { cause: error })\n }\n })()\n try {\n return await parseResponse(\n client.v1.account.upgrade.$post({\n json: {\n ...target(entry),\n chain: props.configurable!,\n passkey: { assertion },\n },\n }),\n )\n } catch (error) {\n // The server spends the step's challenge before it sends the upgrade, so a refused or failed\n // upgrade prepares a new step for the next click.\n await steps[index]?.refetch()\n throw error\n }\n },\n // The server spent the step's challenge, so the accounts load again, without the upgrade, and a\n // toast confirms it.\n async onSuccess() {\n await router.invalidate({ sync: true })\n toast.add({ intent: 'positive', title: 'Wallet upgraded' })\n },\n })\n\n return (\n <main {...styles.page()} aria-label=\"Your account\">\n <Account\n accountError={props.accountError ?? undefined}\n accounts={props.accounts}\n addingPasskey={passkey.isPending}\n email={props.email}\n error={(() => {\n if (signOut.error) return Client.message(signOut.error)\n if (fund.error) return Client.message(fund.error)\n if (upgrade.error) return message(upgrade.error)\n if (passkey.error) return message(passkey.error)\n return undefined\n })()}\n funding={fund.isPending ? fund.variables.address : undefined}\n name={props.name ?? undefined}\n onAddPasskey={\n // A user with a passkey wallet needs no second one, so the page offers none. Accounts that\n // failed to load list no passkey wallet, so the page still offers one.\n props.passkeys &&\n !props.accounts?.some((entry) => entry.owner === 'webAuthn')\n ? () => {\n signOut.reset()\n fund.reset()\n passkey.mutate({})\n }\n : undefined\n }\n onAddOwner={\n props.configurable\n ? (address) => {\n signOut.reset()\n fund.reset()\n upgrade.reset()\n passkey.mutate({ account: address })\n }\n : undefined\n }\n onFund={(() => {\n const chain = props.faucet\n if (chain === null) return undefined\n return (address: `0x${string}`) => {\n // A pending request holds every faucet button, so a second click sends nothing.\n if (fund.isPending) return\n signOut.reset()\n // A registration in progress keeps its state, so only a finished one clears.\n if (!passkey.isPending) passkey.reset()\n fund.mutate({ address, chain })\n }\n })()}\n onUpgrade={\n props.configurable\n ? (address) => {\n signOut.reset()\n fund.reset()\n passkey.reset()\n upgrade.mutate({ address })\n }\n : undefined\n }\n onSignOut={() => {\n passkey.reset()\n fund.reset()\n signOut.mutate()\n }}\n ownerAdded={(() => {\n if (passkey.isSuccess && passkey.variables.account) return 'passkey'\n return undefined\n })()}\n passkeyAdded={passkey.isSuccess && !passkey.variables.account}\n passkeys={props.passkeys}\n preparing={upgradable.flatMap((entry, index) =>\n steps[index]?.isPending ? [entry.address] : [],\n )}\n signingOut={signOut.isPending}\n upgrading={upgrade.isPending ? upgrade.variables.address : undefined}\n />\n </main>\n )\n}\n\ndeclare namespace Page {\n type Props = {\n /** `null` when the accounts loaded. */\n accountError: string | null\n /** Oldest first, or `null` on a failed read. */\n accounts: Account.Props['accounts']\n /**\n * The selected chain when its accounts are configurable, so each account offers the owner that it\n * lacks, or `null` on any other chain.\n */\n configurable: Chain.Chain | null\n /** The signed-in user's email address. */\n email: string\n /** The chain whose faucet funds the accounts, or `null`. */\n faucet: Chain.Chain | null\n /** `null` if the user has none. */\n name: string | null\n /** Whether the `default` realm holds passkeys at Tempo ID's origin. */\n passkeys: boolean\n }\n}\n\n/** Returns the message for a failed passkey registration. */\nfunction message(error: unknown) {\n if (!(error instanceof CeremonyError)) return Client.message(error)\n if (names(error).includes('InvalidStateError'))\n return 'This device already holds one of your passkeys. Add a passkey on another device.'\n if (names(error).includes('NotAllowedError'))\n return 'Adding a passkey was canceled. Try again.'\n return 'Your passkey could not be created. Try again.'\n}\n\n/** Returns the message for a failed read or creation of the accounts. */\nfunction failure(error: unknown) {\n return Client.reason(error) === 'rate_limited'\n ? Client.message(error)\n : 'Your wallets failed to load. Reload the page to try again.'\n}\n\n/**\n * Whether Tempo ID refused a request with a 4xx and a `reason`, so it stored nothing. An owner change\n * can return `config_conflict` or `rate_limited` after it stores the passkey.\n */\nfunction refused(error: unknown) {\n const reason = Client.reason(error)\n return (\n reason !== undefined &&\n reason !== 'config_conflict' &&\n reason !== 'rate_limited' &&\n error instanceof DetailedError &&\n typeof error.statusCode === 'number' &&\n error.statusCode < 500\n )\n}\n\n/** Signals the browser to drop the unstored passkey `credentialId`, if it supports the signal. */\nfunction forget(options: { credentialId: string; rpId: string }) {\n const signal = (\n PublicKeyCredential as {\n signalUnknownCredential?: (options: {\n credentialId: string\n rpId: string\n }) => Promise<void>\n }\n ).signalUnknownCredential\n // The signal is best effort: a failure leaves the passkey, which sign-in refuses.\n void signal\n ?.call(PublicKeyCredential, {\n credentialId: options.credentialId,\n rpId: options.rpId,\n })\n .catch(() => {})\n}\n\n/** Returns the names of `error` and its causes. */\nfunction names(error: unknown): readonly string[] {\n if (!(error instanceof Error)) return []\n return [error.name, ...names(error.cause)]\n}\n\nnamespace styles {\n // Content starts at the same height as on `/deposit`, so moving between them keeps the title in place.\n export const page = style({\n alignItems: 'flex-start',\n display: 'flex',\n justifyContent: 'center',\n minHeight: '100dvh !custom',\n paddingBlock: '64',\n paddingInline: '16',\n })\n}\n\n/** Returns what an upgrade names: the user's account, or a wallet.tempo passkey that has not linked. */\nfunction target(entry: Account.Entry): Upgrade.Target {\n return entry.credentialId\n ? { credentialId: entry.credentialId }\n : { account: entry.address }\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],"mappings":"A,+rBASA,SAAgBiK,GAAoB,EAAS,EAAe,CAC1D,IAAMC,GAAaC,GAAiBnK,GAAYoK,CAAO,CAAC,CAAC,iBAAiBA,CAAO,EAAA,CAAG,UAChFC,EAAa,EACbC,EAAa,EACbC,EAAQ,EACZ,GAAIL,G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AO,CACL,GAAGC,EACHC,aAAc,KACdE,SAAU,CACR,GAAGI,EAAOC,MAAMW,QAASF,GAAU,CACjC,IAAMG,EACJH,EAAMI,OAAOC,OAAON,KACjBO,GACCA,EAAUH,MAAMI,YAAY,IAAMP,EAAMQ,QAAQD,YAAY,CAChE,GAAKP,EAAMI,OAAOC,OAAO,GAC3B,OAAOF,EACH,CACE,CACEK,QAASR,EAAMQ,QACfC,QAAS,YAAaT,EAASA,EAAMS,SAAW,KAAQ,KACxDtB,aAAca,EAAMI,OAAOM,UAAYC,IAAAA,GACvCR,MAAOA,EAAMS,KACbP,OAAQL,EAAMI,OAAOC,OAAOQ,IACzBP,GAAcA,EAAUM,IAC3B,CACF,CAAC,EAEH,CAAA,CACN,CAAC,EACD,GAAGX,EAASY,IAAKb,IAAW,CAC1BQ,QAASR,EAAMQ,QACfC,QAAS,KACTK,aAAcd,EAAMc,aACpBX,MAAO,UACT,EAAE,CAAC,EAELhB,aAAcQ,EAAQR,aAAexB,EAAQ,KAC7C0B,OAAQM,EAAQN,OAAS1B,EAAQ,IACnC,CACF,EAEAqD,WAAa7D,IAA4D,CACvEQ,MAAOR,EAAM8D,OAAOtD,KACtB,EACF,CAAC,EAgSD,SAASsB,GAAQd,EAAgB,CAC/B,OAAO3B,EAAc2B,CAAK,IAAM,eAC5B3B,EAAe2B,CAAK,EACpB,4DACN,CA2CA,IAAUgD,IAAV,SAAA,EAAA,CAEeC,EAAAA,KAAO,CAQtB,EAAA,CAAA,AAAA2U,KAAA,CAAA,CAAA,E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="398" height="398" fill="none" viewBox="0 0 398 398"><path fill="#fff" stroke="#111" stroke-width="7.054" d="M198.996 7.527h.007C304.75 7.527 390.476 93.252 390.476 199v.007c0 105.747-85.726 191.473-191.473 191.473h-.007c-105.748 0-191.473-85.726-191.473-191.473V199C7.523 93.252 93.248 7.527 198.996 7.527Z"/><path fill="url(#a)" fill-opacity=".7" d="M199.003 4h-.007c-107.696 0-195 87.304-195 195v.007c0 107.695 87.304 194.999 195 194.999h.007c107.695 0 194.999-87.304 194.999-194.999V199c0-107.696-87.304-195-194.999-195"/><path stroke="url(#b)" stroke-width="7.143" d="M199.003 4h-.007c-107.696 0-195 87.304-195 195v.007c0 107.695 87.304 194.999 195 194.999h.007c107.695 0 194.999-87.304 194.999-194.999V199c0-107.696-87.304-195-194.999-195Z"/><path fill="#000" fill-rule="evenodd" d="M167.799 38.559C92.491 53.064 35.606 119.32 35.606 198.862c0 79.541 56.885 145.797 132.193 160.302v-15.3c-66.971-14.276-117.2-73.773-117.2-145.002s50.229-130.727 117.2-145.003zm62.401 15.36V38.613c75.169 14.616 131.914 80.805 131.914 160.249S305.369 344.494 230.2 359.11v-15.306c66.831-14.382 116.921-73.813 116.921-144.942S297.031 68.301 230.2 53.919" clip-rule="evenodd"/><path fill="#000" d="M222.118 193.406q18.685 3.56 28.985 13.735 10.3 9.92 10.301 25.435v16.279q0 18.568-13.415 30.013-13.414 11.192-35.213 11.192h-5.03v25.944h-17.247V290.06h-5.27q-14.373 0-25.392-6.359-11.019-6.613-17.247-18.313-5.988-11.955-5.988-27.47h17.247q0 15.77 8.623 25.689 8.863 9.666 23.236 9.666h26.589q14.133 0 22.757-6.613 8.623-6.868 8.623-17.805v-16.279q0-8.647-6.467-14.752-6.228-6.105-17.247-7.885l-43.118-7.631q-18.205-3.306-28.266-13.735t-10.061-26.198V148.64q0-18.567 12.935-29.505 13.174-11.191 34.734-11.191h4.312V82h17.247v25.944h5.509q20.362 0 32.818 13.226 12.456 12.972 12.456 34.338h-17.247q0-13.99-7.665-22.383-7.666-8.394-20.362-8.394h-27.068q-13.655 0-21.798 6.613-8.145 6.359-8.145 17.296v13.735q0 8.902 5.989 15.007 6.228 6.105 17.007 8.139z"/><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 411.151 -289.409 0 199.418 60.946)" gradientUnits="userSpaceOnUse"><stop offset=".031" stop-color="#fafafa"/><stop offset="1" stop-color="#e3e3e3"/></radialGradient><linearGradient id="b" x1="198.999" x2="198.999" y1=".321" y2="397.686" gradientUnits="userSpaceOnUse"><stop stop-color="#f4f4f4"/><stop offset="1" stop-color="#bebebe"/></linearGradient></defs></svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{h as e,x as t}from"./get-id-field-OwLpfjj2.js";function n(t,{usePlural:n=!1}={}){let r={};for(let i of Object.values(e(t))){let e=n?`${i.modelName}s`:i.modelName,t=r[e]??={fields:{},disableMigrations:!0};for(let[e,n]of Object.entries(i.fields))t.fields[n.fieldName||e]=n;t.disableMigrations=t.disableMigrations&&!!i.disableMigrations}return r}function r(e,t){let n=[];for(let[r,i]of Object.entries(e)){if(i.disableMigrations)continue;let e=t.find(e=>e.name===r&&(i.schema===void 0||e.schema===i.schema));if(!e){n.push({kind:`missing-table`,table:r});continue}let a=new Set([i.idColumn??`id`,...Object.keys(i.fields)]);for(let t of a)e.columns.some(e=>e.name===t)||n.push({kind:`missing-column`,table:r,column:t});for(let t of e.columns)a.has(t.name)||t.nullable||t.hasDefault||n.push({kind:`unexpected-required-column`,table:r,column:t.name})}return n}var i={database:"Run `npx auth migrate` to add it.",drizzle:"Run `npx auth generate` to refresh the Drizzle schema, then apply it with your migration tool.",prisma:"Run `npx auth generate` to refresh the Prisma schema, then run `prisma migrate`."},a={database:`Drop the column, make it nullable, or give it a database default.`,drizzle:`Remove it from the Drizzle schema, make it nullable, or give it a default, then apply the change with your migration tool.`,prisma:"Remove it from the Prisma schema, make it optional, or give it a default, then run `prisma migrate`."},o={database:`Database`,drizzle:`Drizzle`,prisma:`Prisma`};function s(e,t){switch(e.kind){case`missing-table`:return`Table "${e.table}" is missing. ${i[t]}`;case`missing-column`:return`Column "${e.column}" is missing from table "${e.table}". ${i[t]}`;case`unexpected-required-column`:{let n=e.column===`issuer`?` If this column came from Better Auth 1.7.0 through 1.7.2, follow the upgrade guide before removing it: https://www.better-auth.com/docs/guides/1-7-upgrade-guide`:``;return`Column "${e.column}" on table "${e.table}" is required but Better Auth never writes it, so every insert into "${e.table}" fails. ${a[t]}${n}`}}}var c={database:`Make the listed columns nullable, give them defaults, or remove them.`,drizzle:`Make the listed columns nullable in your Drizzle schema, give them defaults, or remove them.`,prisma:`Make the listed fields optional in your Prisma schema, give them defaults, or remove them.`},l={...i,database:"Run `npx auth migrate` to add the missing tables and columns."};function u(e,t){let n=[],r=[],i=[],a=new Set,s=!1;for(let t of e)switch(t.kind){case`missing-table`:n.push(t.table);break;case`missing-column`:r.push(`${t.table}.${t.column}`);break;case`unexpected-required-column`:i.push(`${t.table}.${t.column}`),a.add(t.table),s||=t.column===`issuer`}let u=[`${o[t]} schema mismatch`];n.length&&u.push(` Missing tables\n ${n.join(`, `)}`),r.length&&u.push(` Missing columns\n ${r.join(`
|
|
2
|
+
`)}`),i.length&&(u.push(` Required columns Better Auth never writes\n ${i.join(`
|
|
3
|
+
`)}`),u.push(` Inserts into ${[...a].join(`, `)} will fail.`));let d=[];return i.length&&d.push(c[t]),(n.length||r.length||i.length&&t!==`database`)&&d.push(l[t]),d.length&&u.push(` help: ${d.join(`
|
|
4
|
+
`)}`),s&&u.push(` note: If this column came from Better Auth 1.7.0 through 1.7.2,
|
|
5
|
+
follow the upgrade guide before removing it:
|
|
6
|
+
https://www.better-auth.com/docs/guides/1-7-upgrade-guide`),u.join(`
|
|
7
|
+
|
|
8
|
+
`)}var d=class extends t{code=`SCHEMA_MISMATCH`;constructor(e,t){super(u(e,t)),this.findings=e,this.source=t}};function f(e){return e.advanced?.database?.validateSchema!==!1}var p=new WeakMap,m=new WeakMap;function h(e){let t=m.get(e);t&&t.value++}function g(e,t,n={}){let r=n.runtimeEnabled??!0;p.set(e,{check:t,runtimeEnabled:r})}function _(e){return p.get(e)?.check}function v(e){let t=p.get(e);return t?.runtimeEnabled?t.check:void 0}function y(e,t,n){let r=n?m.get(n):void 0;n&&!r&&(r={value:0},m.set(n,r));let i=r?.value,a=!1,o,s=function n(){let s=r?.value;if(i!==s&&(i=s,a=!1,o=void 0),!a)return o??=Promise.resolve().then(e).then(e=>{if(r?.value!==s)return n();if(e.length)throw new d(e,t);i===s&&(a=!0)},e=>{if(r?.value!==s)return n();throw i===s&&(o=void 0),e})};return s.source=t,s}export{v as a,r as c,g as i,s as l,y as n,_ as o,h as r,d as s,f as t,n as u};
|
|
9
|
+
//# sourceMappingURL=schema-check-oLqvHR8y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-check-oLqvHR8y.js","names":["getAuthTables","BetterAuthError","getExpectedSchema","expected","table","options","name","usePlural","entry","key","field","diffSchema","findings","tableName","actualTable","actual","candidate","written","column","applyHint","relaxHint","sourceLabel","formatSchemaFinding","finding","source","issuer","repairHint","migrationHint","formatSchemaMismatch","tables","columns","required","affectedTables","hasIssuer","sections","help","SchemaMismatchError","checksSchema","schemaChecks","schemaRevisions","invalidateSchemaChecks","revision","database","registerSchemaCheck","runtimeEnabled","adapter","schemaCheckFor","runtimeSchemaCheckFor","registration","createSchemaCheck","checkedRevision","clean","verdict","checkSchema","currentRevision","find","error"],"sources":["../../../../../node_modules/.pnpm/@better-auth+core@1.8.0-beta.2_@better-auth+utils@0.5.0_@better-fetch+fetch@1.3.2_bette_ae4ec27bd601b85ec1331456bd274772/node_modules/@better-auth/core/dist/db/schema-diff.mjs","../../../../../node_modules/.pnpm/@better-auth+core@1.8.0-beta.2_@better-auth+utils@0.5.0_@better-fetch+fetch@1.3.2_bette_ae4ec27bd601b85ec1331456bd274772/node_modules/@better-auth/core/dist/db/schema-check.mjs"],"sourcesContent":["import { BetterAuthError } from \"../error/index.mjs\";\nimport { getAuthTables } from \"./get-tables.mjs\";\n//#region src/db/schema-diff.ts\n/**\n* The tables this configuration writes, keyed the way the adapter addresses\n* them. Tables that share a physical name are merged into one entry.\n*/\nfunction getExpectedSchema(options, { usePlural = false } = {}) {\n\tconst expected = {};\n\tfor (const table of Object.values(getAuthTables(options))) {\n\t\tconst name = usePlural ? `${table.modelName}s` : table.modelName;\n\t\tconst entry = expected[name] ??= {\n\t\t\tfields: {},\n\t\t\tdisableMigrations: true\n\t\t};\n\t\tfor (const [key, field] of Object.entries(table.fields)) entry.fields[field.fieldName || key] = field;\n\t\tentry.disableMigrations = entry.disableMigrations && !!table.disableMigrations;\n\t}\n\treturn expected;\n}\n/**\n* Compares the tables Better Auth writes with what the store holds.\n*\n* A table or column Better Auth writes must exist. A column Better Auth does\n* not write must accept an insert that omits it, so it is nullable or carries\n* a default. Otherwise every insert into that table fails with a constraint\n* error that says nothing about why the schema drifted.\n*/\nfunction diffSchema(expected, actual) {\n\tconst findings = [];\n\tfor (const [tableName, table] of Object.entries(expected)) {\n\t\tif (table.disableMigrations) continue;\n\t\tconst actualTable = actual.find((candidate) => candidate.name === tableName && (table.schema === void 0 || candidate.schema === table.schema));\n\t\tif (!actualTable) {\n\t\t\tfindings.push({\n\t\t\t\tkind: \"missing-table\",\n\t\t\t\ttable: tableName\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst written = new Set([table.idColumn ?? \"id\", ...Object.keys(table.fields)]);\n\t\tfor (const column of written) if (!actualTable.columns.some((candidate) => candidate.name === column)) findings.push({\n\t\t\tkind: \"missing-column\",\n\t\t\ttable: tableName,\n\t\t\tcolumn\n\t\t});\n\t\tfor (const column of actualTable.columns) {\n\t\t\tif (written.has(column.name) || column.nullable || column.hasDefault) continue;\n\t\t\tfindings.push({\n\t\t\t\tkind: \"unexpected-required-column\",\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: column.name\n\t\t\t});\n\t\t}\n\t}\n\treturn findings;\n}\nconst applyHint = {\n\tdatabase: \"Run `npx auth migrate` to add it.\",\n\tdrizzle: \"Run `npx auth generate` to refresh the Drizzle schema, then apply it with your migration tool.\",\n\tprisma: \"Run `npx auth generate` to refresh the Prisma schema, then run `prisma migrate`.\"\n};\nconst relaxHint = {\n\tdatabase: \"Drop the column, make it nullable, or give it a database default.\",\n\tdrizzle: \"Remove it from the Drizzle schema, make it nullable, or give it a default, then apply the change with your migration tool.\",\n\tprisma: \"Remove it from the Prisma schema, make it optional, or give it a default, then run `prisma migrate`.\"\n};\nconst sourceLabel = {\n\tdatabase: \"Database\",\n\tdrizzle: \"Drizzle\",\n\tprisma: \"Prisma\"\n};\n/**\n* One finding as a sentence that names the change resolving it.\n*/\nfunction formatSchemaFinding(finding, source) {\n\tswitch (finding.kind) {\n\t\tcase \"missing-table\": return `Table \"${finding.table}\" is missing. ${applyHint[source]}`;\n\t\tcase \"missing-column\": return `Column \"${finding.column}\" is missing from table \"${finding.table}\". ${applyHint[source]}`;\n\t\tcase \"unexpected-required-column\": {\n\t\t\tconst issuer = finding.column === \"issuer\" ? \" If this column came from Better Auth 1.7.0 through 1.7.2, follow the upgrade guide before removing it: https://www.better-auth.com/docs/guides/1-7-upgrade-guide\" : \"\";\n\t\t\treturn `Column \"${finding.column}\" on table \"${finding.table}\" is required but Better Auth never writes it, so every insert into \"${finding.table}\" fails. ${relaxHint[source]}${issuer}`;\n\t\t}\n\t}\n}\nconst repairHint = {\n\tdatabase: \"Make the listed columns nullable, give them defaults, or remove them.\",\n\tdrizzle: \"Make the listed columns nullable in your Drizzle schema, give them defaults, or remove them.\",\n\tprisma: \"Make the listed fields optional in your Prisma schema, give them defaults, or remove them.\"\n};\nconst migrationHint = {\n\t...applyHint,\n\tdatabase: \"Run `npx auth migrate` to add the missing tables and columns.\"\n};\nfunction formatSchemaMismatch(findings, source) {\n\tconst tables = [];\n\tconst columns = [];\n\tconst required = [];\n\tconst affectedTables = /* @__PURE__ */ new Set();\n\tlet hasIssuer = false;\n\tfor (const finding of findings) switch (finding.kind) {\n\t\tcase \"missing-table\":\n\t\t\ttables.push(finding.table);\n\t\t\tbreak;\n\t\tcase \"missing-column\":\n\t\t\tcolumns.push(`${finding.table}.${finding.column}`);\n\t\t\tbreak;\n\t\tcase \"unexpected-required-column\":\n\t\t\trequired.push(`${finding.table}.${finding.column}`);\n\t\t\taffectedTables.add(finding.table);\n\t\t\thasIssuer ||= finding.column === \"issuer\";\n\t\t\tbreak;\n\t}\n\tconst sections = [`${sourceLabel[source]} schema mismatch`];\n\tif (tables.length) sections.push(` Missing tables\\n ${tables.join(\", \")}`);\n\tif (columns.length) sections.push(` Missing columns\\n ${columns.join(\"\\n \")}`);\n\tif (required.length) {\n\t\tsections.push(` Required columns Better Auth never writes\\n ${required.join(\"\\n \")}`);\n\t\tsections.push(` Inserts into ${[...affectedTables].join(\", \")} will fail.`);\n\t}\n\tconst help = [];\n\tif (required.length) help.push(repairHint[source]);\n\tif (tables.length || columns.length || required.length && source !== \"database\") help.push(migrationHint[source]);\n\tif (help.length) sections.push(` help: ${help.join(\"\\n \")}`);\n\tif (hasIssuer) sections.push(\" note: If this column came from Better Auth 1.7.0 through 1.7.2,\\n follow the upgrade guide before removing it:\\n https://www.better-auth.com/docs/guides/1-7-upgrade-guide\");\n\treturn sections.join(\"\\n\\n\");\n}\n/**\n* The store cannot hold what this configuration writes.\n*\n* `findings` carries every problem as data; `message` lists each one with the\n* change that resolves it. Reported during initialization and thrown when\n* requests await validation, in every environment. Also thrown by\n* `auth migrate` before it changes anything.\n*\n* @example\n* ```ts\n* try {\n* await auth.api.getSession({ headers });\n* } catch (error) {\n* if (error instanceof SchemaMismatchError) console.error(error.findings);\n* }\n* ```\n*/\nvar SchemaMismatchError = class extends BetterAuthError {\n\tcode = \"SCHEMA_MISMATCH\";\n\tconstructor(findings, source) {\n\t\tsuper(formatSchemaMismatch(findings, source));\n\t\tthis.findings = findings;\n\t\tthis.source = source;\n\t}\n};\n//#endregion\nexport { SchemaMismatchError, diffSchema, formatSchemaFinding, getExpectedSchema };\n","import { SchemaMismatchError } from \"./schema-diff.mjs\";\n//#region src/db/schema-check.ts\n/**\n* Whether the adapter validates its schema. Enabled in every environment\n* unless explicitly disabled.\n*/\nfunction checksSchema(options) {\n\treturn options.advanced?.database?.validateSchema !== false;\n}\nconst schemaChecks = /* @__PURE__ */ new WeakMap();\nconst schemaRevisions = /* @__PURE__ */ new WeakMap();\n/** Invalidates cached checks after Better Auth changes this database's schema. */\nfunction invalidateSchemaChecks(database) {\n\tconst revision = schemaRevisions.get(database);\n\tif (revision) revision.value++;\n}\n/**\n* Attaches a check to the adapter it verifies. The adapter object itself is\n* left untouched, so this works for adapters Better Auth does not own.\n*/\nfunction registerSchemaCheck(adapter, check, options = {}) {\n\tconst runtimeEnabled = options.runtimeEnabled ?? true;\n\tschemaChecks.set(adapter, {\n\t\tcheck,\n\t\truntimeEnabled\n\t});\n}\n/**\n* The registered check, regardless of whether runtime validation is enabled.\n*/\nfunction schemaCheckFor(adapter) {\n\treturn schemaChecks.get(adapter)?.check;\n}\n/**\n* The check used by runtime paths, when runtime validation is enabled.\n*/\nfunction runtimeSchemaCheckFor(adapter) {\n\tconst registration = schemaChecks.get(adapter);\n\treturn registration?.runtimeEnabled ? registration.check : void 0;\n}\n/**\n* Turns a schema comparison into a check shared by one adapter instance.\n*\n* The first call runs `find` and every concurrent call shares that promise. A\n* clean result is cached until invalidation. A mismatch is kept as one\n* {@link SchemaMismatchError} and rethrown on every later call without asking\n* the store again, until a migration invalidates it. When a database identity is supplied,\n* checks for that identity share its schema revision. Pending callers follow\n* the new check if their revision is invalidated. A failure to reach\n* the store is not kept, so the next call asks again.\n*\n* @example\n* ```ts\n* const checkSchema = createSchemaCheck(\n* () => findSchemaProblems(db, \"postgres\", expected),\n* \"database\",\n* );\n* const pending = checkSchema();\n* if (pending) await pending;\n* ```\n*/\nfunction createSchemaCheck(find, source, database) {\n\tlet revision = database ? schemaRevisions.get(database) : void 0;\n\tif (database && !revision) {\n\t\trevision = { value: 0 };\n\t\tschemaRevisions.set(database, revision);\n\t}\n\tlet checkedRevision = revision?.value;\n\tlet clean = false;\n\tlet verdict;\n\tconst checkSchema = function checkSchema() {\n\t\tconst currentRevision = revision?.value;\n\t\tif (checkedRevision !== currentRevision) {\n\t\t\tcheckedRevision = currentRevision;\n\t\t\tclean = false;\n\t\t\tverdict = void 0;\n\t\t}\n\t\tif (clean) return;\n\t\treturn verdict ??= Promise.resolve().then(find).then((findings) => {\n\t\t\tif (revision?.value !== currentRevision) return checkSchema();\n\t\t\tif (findings.length) throw new SchemaMismatchError(findings, source);\n\t\t\tif (checkedRevision === currentRevision) clean = true;\n\t\t}, (error) => {\n\t\t\tif (revision?.value !== currentRevision) return checkSchema();\n\t\t\tif (checkedRevision === currentRevision) verdict = void 0;\n\t\t\tthrow error;\n\t\t});\n\t};\n\tcheckSchema.source = source;\n\treturn checkSchema;\n}\n//#endregion\nexport { checksSchema, createSchemaCheck, invalidateSchemaChecks, registerSchemaCheck, runtimeSchemaCheckFor, schemaCheckFor };\n"],"ignoreList":[0,1],"mappings":"A,sDAOA,SAASE,EAAkB,EAAS,CAAE,YAAY,IAAU,CAAC,EAAG,CAC/D,IAAMC,EAAW,CAAC,EAClB,IAAK,IAAMC,KAAS,OAAO,OAAOJ,EAAcK,CAAO,CAAC,EAAG,CAC1D,IAAMC,EAAOC,EAAY,GAAGH,EAAM,UAAU,GAAKA,EAAM,UACjDI,EAAQ,EAASF,KAAU,CAChC,OAAQ,CAAC,EACT,kBAAmB,EACpB,EACA,IAAK,GAAM,CAACG,EAAKC,KAAU,OAAO,QAAQN,EAAM,MAAM,EAAG,EAAM,OAAOM,EAAM,WAAaD,GAAOC,EAChG,EAAM,kBAAoBF,EAAM,mBAAqB,CAAC,CAACJ,EAAM,iBAC9D,CACA,OAAOD,CACR,CASA,SAASQ,EAAW,EAAU,EAAQ,CACrC,IAAMC,EAAW,CAAC,EAClB,IAAK,GAAM,CAACC,EAAWT,KAAU,OAAO,QAAQD,CAAQ,EAAG,CAC1D,GAAIC,EAAM,kBAAmB,SAC7B,IAAMU,EAAcC,EAAO,KAAM,GAAcC,EAAU,OAASH,IAAcT,EAAM,SAAW,IAAK,IAAKY,EAAU,SAAWZ,EAAM,OAAO,EAC7I,GAAI,CAACU,EAAa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F,EAEA,MADA,GAAY,OAAShC,EACd6B,CACR,C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-BWaJ3C7D.js";import{B as t,C as n,E as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,P as p,Q as m,R as h,S as g,T as _,U as v,V as y,Z as b,_ as x,a as S,b as C,c as w,et as T,f as E,g as D,h as O,i as k,j as A,l as ee,m as te,n as j,o as M,p as ne,q as N,r as re,s as P,t as F,u as I,v as L,w as ie,x as ae,y as R,z as oe}from"./utils-C4ZXZIZW.js";var se=class extends h{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,y(e);let n=T(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),a(i)}update(e){return t(this),this.iHash.update(e),this}digestInto(e){t(this),oe(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ce=(e,t,n)=>new se(e,t).update(n).digest();ce.create=(e,t)=>new se(e,t);function le(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function ue(e,t,n){return e&t^~e&n}function de(e,t,n){return e&t^e&n^t&n}var fe=class extends h{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=c(this.buffer)}update(e){t(this),e=T(e),oe(e);let{view:n,buffer:r,blockLen:i}=this,a=e.length;for(let t=0;t<a;){let o=Math.min(i-this.pos,a-t);if(o===i){let n=c(e);for(;i<=a-t;t+=i)this.process(n,t)}else r.set(e.subarray(t,t+o),this.pos),this.pos+=o,t+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){t(this),v(e,this),this.finished=!0;let{buffer:n,view:r,blockLen:i,isLE:o}=this,{pos:s}=this;n[s++]=128,a(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)n[e]=0;le(r,i-8,BigInt(this.length*8),o),this.process(r,0);let l=c(e),u=this.outputLen;if(u%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let d=u/4,f=this.get();if(d>f.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<d;e++)l.setUint32(4*e,f[e],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},z=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),B=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),V=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),pe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),H=new Uint32Array(64),me=class extends fe{constructor(e=32){super(64,e,8,!1),this.A=z[0]|0,this.B=z[1]|0,this.C=z[2]|0,this.D=z[3]|0,this.E=z[4]|0,this.F=z[5]|0,this.G=z[6]|0,this.H=z[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)H[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=H[e-15],n=H[e-2],r=m(t,7)^m(t,18)^t>>>3,i=m(n,17)^m(n,19)^n>>>10;H[e]=i+H[e-7]+r+H[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=m(o,6)^m(o,11)^m(o,25),u=l+t+ue(o,s,c)+pe[e]+H[e]|0,d=(m(n,2)^m(n,13)^m(n,22))+de(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){a(H)}destroy(){this.set(0,0,0,0,0,0,0,0),a(this.buffer)}},he=u(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),ge=he[0],_e=he[1],U=new Uint32Array(80),W=new Uint32Array(80),ve=class extends fe{constructor(e=64){super(128,e,16,!1),this.Ah=V[0]|0,this.Al=V[1]|0,this.Bh=V[2]|0,this.Bl=V[3]|0,this.Ch=V[4]|0,this.Cl=V[5]|0,this.Dh=V[6]|0,this.Dl=V[7]|0,this.Eh=V[8]|0,this.El=V[9]|0,this.Fh=V[10]|0,this.Fl=V[11]|0,this.Gh=V[12]|0,this.Gl=V[13]|0,this.Hh=V[14]|0,this.Hl=V[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)U[n]=e.getUint32(t),W[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=U[e-15]|0,r=W[e-15]|0,a=f(t,r,1)^f(t,r,8)^i(t,r,7),o=p(t,r,1)^p(t,r,8)^s(t,r,7),c=U[e-2]|0,l=W[e-2]|0,u=f(c,l,19)^A(c,l,61)^i(c,l,6),m=p(c,l,19)^d(c,l,61)^s(c,l,6),h=ie(o,m,W[e-7],W[e-16]),g=n(h,a,u,U[e-7],U[e-16]);U[e]=g|0,W[e]=h|0}let{Ah:a,Al:o,Bh:c,Bl:l,Ch:u,Cl:m,Dh:h,Dl:v,Eh:y,El:b,Fh:x,Fl:S,Gh:w,Gl:T,Hh:E,Hl:D}=this;for(let e=0;e<80;e++){let t=f(y,b,14)^f(y,b,18)^A(y,b,41),n=p(y,b,14)^p(y,b,18)^d(y,b,41),i=y&x^~y&w,s=b&S^~b&T,O=r(D,n,s,_e[e],W[e]),k=_(O,E,t,i,ge[e],U[e]),ee=O|0,te=f(a,o,28)^A(a,o,34)^A(a,o,39),j=p(a,o,28)^d(a,o,34)^d(a,o,39),M=a&c^a&u^c&u,ne=o&l^o&m^l&m;E=w|0,D=T|0,w=x|0,T=S|0,x=y|0,S=b|0,{h:y,l:b}=C(h|0,v|0,k|0,ee|0),h=u|0,v=m|0,u=c|0,m=l|0,c=a|0,l=o|0;let N=g(ee,j,ne);a=ae(N,k,te,M),o=N|0}({h:a,l:o}=C(this.Ah|0,this.Al|0,a|0,o|0)),{h:c,l}=C(this.Bh|0,this.Bl|0,c|0,l|0),{h:u,l:m}=C(this.Ch|0,this.Cl|0,u|0,m|0),{h,l:v}=C(this.Dh|0,this.Dl|0,h|0,v|0),{h:y,l:b}=C(this.Eh|0,this.El|0,y|0,b|0),{h:x,l:S}=C(this.Fh|0,this.Fl|0,x|0,S|0),{h:w,l:T}=C(this.Gh|0,this.Gl|0,w|0,T|0),{h:E,l:D}=C(this.Hh|0,this.Hl|0,E|0,D|0),this.set(a,o,c,l,u,m,h,v,y,b,x,S,w,T,E,D)}roundClean(){a(U,W)}destroy(){a(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ye=class extends ve{constructor(){super(48),this.Ah=B[0]|0,this.Al=B[1]|0,this.Bh=B[2]|0,this.Bl=B[3]|0,this.Ch=B[4]|0,this.Cl=B[5]|0,this.Dh=B[6]|0,this.Dl=B[7]|0,this.Eh=B[8]|0,this.El=B[9]|0,this.Fh=B[10]|0,this.Fl=B[11]|0,this.Gh=B[12]|0,this.Gl=B[13]|0,this.Hh=B[14]|0,this.Hl=B[15]|0}},be=N(()=>new me),xe=N(()=>new ve),Se=N(()=>new ye),G=BigInt(0),K=BigInt(1),q=BigInt(2),Ce=BigInt(3),we=BigInt(4),Te=BigInt(5),Ee=BigInt(8);function J(e,t){let n=e%t;return n>=G?n:t+n}function Y(e,t,n){let r=e;for(;t-->G;)r*=r,r%=n;return r}function De(e,t){if(e===G)throw Error(`invert: expected non-zero number`);if(t<=G)throw Error(`invert: expected positive modulus, got `+t);let n=J(e,t),r=t,i=G,a=K,o=K,s=G;for(;n!==G;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==K)throw Error(`invert: does not exist`);return J(i,t)}function Oe(e,t){let n=(e.ORDER+K)/we,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw Error(`Cannot find square root`);return r}function ke(e,t){let n=(e.ORDER-Te)/Ee,r=e.mul(t,q),i=e.pow(r,n),a=e.mul(t,i),o=e.mul(e.mul(a,q),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),t))throw Error(`Cannot find square root`);return s}function Ae(e){if(e<BigInt(3))throw Error(`sqrt is not defined for small field`);let t=e-K,n=0;for(;t%q===G;)t/=q,n++;let r=q,i=X(e);for(;Ie(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return Oe;let a=i.pow(r,t),o=(t+K)/q;return function(e,r){if(e.is0(r))return r;if(Ie(e,r)!==1)throw Error(`Cannot find square root`);let i=n,s=e.mul(e.ONE,a),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw Error(`Cannot find square root`);let r=K<<BigInt(i-t-1),a=e.pow(s,r);i=t,s=e.sqr(a),c=e.mul(c,s),l=e.mul(l,a)}return l}}function je(e){return e%we===Ce?Oe:e%Ee===Te?ke:Ae(e)}var Me=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function Ne(e){let t=Me.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`});return R(e,t)}function Pe(e,t,n){if(n<G)throw Error(`invalid exponent, negatives unsupported`);if(n===G)return e.ONE;if(n===K)return t;let r=e.ONE,i=t;for(;n>G;)n&K&&(r=e.mul(r,i)),i=e.sqr(i),n>>=K;return r}function Fe(e,t,n=!1){let r=Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),a=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),a),r}function Ie(e,t){let n=(e.ORDER-K)/q,r=e.pow(t,n),i=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!a&&!o)throw Error(`invalid Legendre symbol result`);return i?1:a?0:-1}function Le(e,t){t!==void 0&&o(t);let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function X(e,t,n=!1,r={}){if(e<=G)throw Error(`invalid field: expected ORDER > 0, got `+e);let{nBitLength:i,nByteLength:a}=Le(e,t);if(a>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let o,s=Object.freeze({ORDER:e,isLE:n,BITS:i,BYTES:a,MASK:k(i),ZERO:G,ONE:K,create:t=>J(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return G<=t&&t<e},is0:e=>e===G,isOdd:e=>(e&K)===K,neg:t=>J(-t,e),eql:(e,t)=>e===t,sqr:t=>J(t*t,e),add:(t,n)=>J(t+n,e),sub:(t,n)=>J(t-n,e),mul:(t,n)=>J(t*n,e),pow:(e,t)=>Pe(s,e,t),div:(t,n)=>J(t*De(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>De(t,e),sqrt:r.sqrt||(t=>(o||=je(e),o(s,t))),toBytes:e=>n?x(e,a):D(e,a),fromBytes:e=>{if(e.length!==a)throw Error(`Field.fromBytes: expected `+a+` bytes, got `+e.length);return n?P(e):M(e)},invertBatch:e=>Fe(s,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(s)}function Re(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function ze(e){let t=Re(e);return t+Math.ceil(t/2)}function Be(e,t,n=!1){let r=e.length,i=Re(t),a=ze(t);if(r<16||r<a||r>1024)throw Error(`expected `+a+`-1024 bytes of input, got `+r);let o=J(n?P(e):M(e),t-K)+K;return n?x(o,i):D(o,i)}var Ve=BigInt(0),He=BigInt(1);function Ue(e,t){let n=t.negate();return e?n:t}function We(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function Ge(e,t){We(e,t);let n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e;return{windows:n,windowSize:r,mask:k(e),maxNumber:i,shiftBy:BigInt(e)}}function Ke(e,t,n){let{windowSize:r,mask:i,maxNumber:a,shiftBy:o}=n,s=Number(e&i),c=e>>o;s>r&&(s-=a,c+=He);let l=t*r,u=l+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!=0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:p,offsetF:l}}function qe(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function Je(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}var Ye=new WeakMap,Xe=new WeakMap;function Ze(e){return Xe.get(e)||1}function Qe(e,t){return{constTimeNegate:Ue,hasPrecomputes(e){return Ze(e)!==1},unsafeLadder(t,n,r=e.ZERO){let i=t;for(;n>Ve;)n&He&&(r=r.add(i)),i=i.double(),n>>=He;return r},precomputeWindow(e,n){let{windows:r,windowSize:i}=Ge(n,t),a=[],o=e,s=o;for(let e=0;e<r;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(n,r,i){let a=e.ZERO,o=e.BASE,s=Ge(n,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:n,isZero:c,isNeg:l,isNegF:u,offsetF:d}=Ke(i,e,s);i=t,c?o=o.add(Ue(u,r[d])):a=a.add(Ue(l,r[n]))}return{p:a,f:o}},wNAFUnsafe(n,r,i,a=e.ZERO){let o=Ge(n,t);for(let e=0;e<o.windows&&i!==Ve;e++){let{nextN:t,offset:n,isZero:s,isNeg:c}=Ke(i,e,o);if(i=t,!s){let e=r[n];a=a.add(c?e.negate():e)}}return a},getPrecomputes(e,t,n){let r=Ye.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&Ye.set(t,n(r))),r},wNAFCached(e,t,n){let r=Ze(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){let i=Ze(e);return i===1?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){We(n,t),Xe.set(e,n),Ye.delete(e)}}}function $e(e,t,n,r){qe(n,e),Je(r,t);let i=n.length,a=r.length;if(i!==a)throw Error(`arrays of points and scalars must have equal length`);let o=e.ZERO,s=re(BigInt(i)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let l=k(c),u=Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c,f=o;for(let e=d;e>=0;e-=c){u.fill(o);for(let t=0;t<a;t++){let i=r[t],a=Number(i>>BigInt(e)&l);u[a]=u[a].add(n[t])}let t=o;for(let e=u.length-1,n=o;e>0;e--)n=n.add(u[e]),t=t.add(n);if(f=f.add(t),e!==0)for(let e=0;e<c;e++)f=f.double()}return f}function et(e){return Ne(e.Fp),R(e,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...Le(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function tt(e){e.lowS!==void 0&&j(`lowS`,e.lowS),e.prehash!==void 0&&j(`prehash`,e.prehash)}function nt(e){let t=et(e);R(t,{a:`field`,b:`field`},{allowInfinityPoint:`boolean`,allowedPrivateKeyLengths:`array`,clearCofactor:`function`,fromBytes:`function`,isTorsionFree:`function`,toBytes:`function`,wrapPrivateKey:`boolean`});let{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw Error(`invalid endo: CURVE.a must be 0`);if(typeof n!=`object`||typeof n.beta!=`bigint`||typeof n.splitScalar!=`function`)throw Error(`invalid endo: expected "beta": bigint and "splitScalar": function`)}return Object.freeze({...t})}var Z={Err:class extends Error{constructor(e=``){super(e)}},_tlv:{encode:(e,t)=>{let{Err:n}=Z;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length&1)throw new n(`tlv.encode: unpadded data`);let r=t.length/2,i=L(r);if(i.length/2&128)throw new n(`tlv.encode: long form length too big`);let a=r>127?L(i.length/2|128):``;return L(e)+a+i+t},decode(e,t){let{Err:n}=Z,r=0;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length<2||t[r++]!==e)throw new n(`tlv.decode: wrong tlv`);let i=t[r++],a=!!(i&128),o=0;if(!a)o=i;else{let e=i&127;if(!e)throw new n(`tlv.decode(long): indefinite length not supported`);if(e>4)throw new n(`tlv.decode(long): byte length is too big`);let a=t.subarray(r,r+e);if(a.length!==e)throw new n(`tlv.decode: length bytes not complete`);if(a[0]===0)throw new n(`tlv.decode(long): zero leftmost byte`);for(let e of a)o=o<<8|e;if(r+=e,o<128)throw new n(`tlv.decode(long): not minimal encoding`)}let s=t.subarray(r,r+o);if(s.length!==o)throw new n(`tlv.decode: wrong value length`);return{v:s,l:t.subarray(r+o)}}},_int:{encode(e){let{Err:t}=Z;if(e<Q)throw new t(`integer: negative integers are not allowed`);let n=L(e);if(Number.parseInt(n[0],16)&8&&(n=`00`+n),n.length&1)throw new t(`unexpected DER parsing assertion: unpadded hex`);return n},decode(e){let{Err:t}=Z;if(e[0]&128)throw new t(`invalid signature integer: negative`);if(e[0]===0&&!(e[1]&128))throw new t(`invalid signature integer: unnecessary leading zero`);return M(e)}},toSig(e){let{Err:t,_int:n,_tlv:r}=Z,i=I(`signature`,e),{v:a,l:o}=r.decode(48,i);if(o.length)throw new t(`invalid signature: left bytes after parsing`);let{v:s,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t(`invalid signature: left bytes after parsing`);return{r:n.decode(s),s:n.decode(l)}},hexFromSig(e){let{_tlv:t,_int:n}=Z,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}};function rt(e,t){return S(D(e,t))}var Q=BigInt(0),$=BigInt(1),it=BigInt(3),at=BigInt(4);function ot(e){let t=nt(e),{Fp:n}=t,r=X(t.n,t.nBitLength),i=t.toBytes||((e,t,r)=>{let i=t.toAffine();return w(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),a=t.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){let{a:r,b:i}=t,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}function s(e,t){let r=n.sqr(t),i=o(e);return n.eql(r,i)}if(!s(t.Gx,t.Gy))throw Error(`bad curve params: generator point`);let c=n.mul(n.pow(t.a,it),at),l=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(c,l)))throw Error(`bad curve params: a or b`);function u(e){return ne(e,$,t.n)}function d(e){let{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:a}=t;if(n&&typeof e!=`bigint`){if(te(e)&&(e=S(e)),typeof e!=`string`||!n.includes(e.length))throw Error(`invalid private key`);e=e.padStart(r*2,`0`)}let o;try{o=typeof e==`bigint`?e:M(I(`private key`,e,r))}catch{throw Error(`invalid private key, expected hex or `+r+` bytes, got `+typeof e)}return i&&(o=J(o,a)),F(`private key`,o,$,a),o}function f(e){if(!(e instanceof h))throw Error(`ProjectivePoint expected`)}let p=O((e,t)=>{let{px:r,py:i,pz:a}=e;if(n.eql(a,n.ONE))return{x:r,y:i};let o=e.is0();t??=o?n.ONE:n.inv(a);let s=n.mul(r,t),c=n.mul(i,t),l=n.mul(a,t);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(l,n.ONE))throw Error(`invZ was invalid`);return{x:s,y:c}}),m=O(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.py))return;throw Error(`bad point: ZERO`)}let{x:r,y:i}=e.toAffine();if(!n.isValid(r)||!n.isValid(i))throw Error(`bad point: x or y not FE`);if(!s(r,i))throw Error(`bad point: equation left != right`);if(!e.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`);return!0});class h{constructor(e,t,r){if(e==null||!n.isValid(e))throw Error(`x required`);if(t==null||!n.isValid(t)||n.is0(t))throw Error(`y required`);if(r==null||!n.isValid(r))throw Error(`z required`);this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error(`invalid affine point`);if(e instanceof h)throw Error(`projective point not allowed`);let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?h.ZERO:new h(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=Fe(n,e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(h.fromAffine)}static fromHex(e){let t=h.fromAffine(a(I(`pointHex`,e)));return t.assertValidity(),t}static fromPrivateKey(e){return h.BASE.multiply(d(e))}static msm(e,t){return $e(h,r,e,t)}_setWindowSize(e){v.setWindowSize(this,e)}assertValidity(){m(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error(`Field doesn't support isOdd`)}equals(e){f(e);let{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,c=n.eql(n.mul(t,s),n.mul(a,i)),l=n.eql(n.mul(r,s),n.mul(o,i));return c&&l}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:r}=t,i=n.mul(r,it),{px:a,py:o,pz:s}=this,c=n.ZERO,l=n.ZERO,u=n.ZERO,d=n.mul(a,a),f=n.mul(o,o),p=n.mul(s,s),m=n.mul(a,o);return m=n.add(m,m),u=n.mul(a,s),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,p),l=n.add(c,l),c=n.sub(f,l),l=n.add(f,l),l=n.mul(c,l),c=n.mul(m,c),u=n.mul(i,u),p=n.mul(e,p),m=n.sub(d,p),m=n.mul(e,m),m=n.add(m,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,p),d=n.mul(d,m),l=n.add(l,d),p=n.mul(o,s),p=n.add(p,p),d=n.mul(p,m),c=n.sub(c,d),u=n.mul(p,f),u=n.add(u,u),u=n.add(u,u),new h(c,l,u)}add(e){f(e);let{px:r,py:i,pz:a}=this,{px:o,py:s,pz:c}=e,l=n.ZERO,u=n.ZERO,d=n.ZERO,p=t.a,m=n.mul(t.b,it),g=n.mul(r,o),_=n.mul(i,s),v=n.mul(a,c),y=n.add(r,i),b=n.add(o,s);y=n.mul(y,b),b=n.add(g,_),y=n.sub(y,b),b=n.add(r,a);let x=n.add(o,c);return b=n.mul(b,x),x=n.add(g,v),b=n.sub(b,x),x=n.add(i,a),l=n.add(s,c),x=n.mul(x,l),l=n.add(_,v),x=n.sub(x,l),d=n.mul(p,b),l=n.mul(m,v),d=n.add(l,d),l=n.sub(_,d),d=n.add(_,d),u=n.mul(l,d),_=n.add(g,g),_=n.add(_,g),v=n.mul(p,v),b=n.mul(m,b),_=n.add(_,v),v=n.sub(g,v),v=n.mul(p,v),b=n.add(b,v),g=n.mul(_,b),u=n.add(u,g),g=n.mul(x,b),l=n.mul(y,l),l=n.sub(l,g),g=n.mul(y,_),d=n.mul(x,d),d=n.add(d,g),new h(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(h.ZERO)}wNAF(e){return v.wNAFCached(this,e,h.normalizeZ)}multiplyUnsafe(e){let{endo:r,n:i}=t;F(`scalar`,e,Q,i);let a=h.ZERO;if(e===Q)return a;if(this.is0()||e===$)return this;if(!r||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,e,h.normalizeZ);let{k1neg:o,k1:s,k2neg:c,k2:l}=r.splitScalar(e),u=a,d=a,f=this;for(;s>Q||l>Q;)s&$&&(u=u.add(f)),l&$&&(d=d.add(f)),f=f.double(),s>>=$,l>>=$;return o&&(u=u.negate()),c&&(d=d.negate()),d=new h(n.mul(d.px,r.beta),d.py,d.pz),u.add(d)}multiply(e){let{endo:r,n:i}=t;F(`scalar`,e,$,i);let a,o;if(r){let{k1neg:t,k1:i,k2neg:s,k2:c}=r.splitScalar(e),{p:l,f:u}=this.wNAF(i),{p:d,f}=this.wNAF(c);l=v.constTimeNegate(t,l),d=v.constTimeNegate(s,d),d=new h(n.mul(d.px,r.beta),d.py,d.pz),a=l.add(d),o=u.add(f)}else{let{p:t,f:n}=this.wNAF(e);a=t,o=n}return h.normalizeZ([a,o])[0]}multiplyAndAddUnsafe(e,t,n){let r=h.BASE,i=(e,t)=>t===Q||t===$||!e.equals(r)?e.multiplyUnsafe(t):e.multiply(t),a=i(this,t).add(i(e,n));return a.is0()?void 0:a}toAffine(e){return p(this,e)}isTorsionFree(){let{h:e,isTorsionFree:n}=t;if(e===$)return!0;if(n)return n(h,this);throw Error(`isTorsionFree() has not been declared for the elliptic curve`)}clearCofactor(){let{h:e,clearCofactor:n}=t;return e===$?this:n?n(h,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return j(`isCompressed`,e),this.assertValidity(),i(h,this,e)}toHex(e=!0){return j(`isCompressed`,e),S(this.toRawBytes(e))}}h.BASE=new h(t.Gx,t.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);let{endo:g,nBitLength:_}=t,v=Qe(h,g?Math.ceil(_/2):_);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:d,weierstrassEquation:o,isWithinCurveOrder:u}}function st(e){let t=et(e);return R(t,{hash:`hash`,hmac:`function`,randomBytes:`function`},{bits2int:`function`,bits2int_modN:`function`,lowS:`boolean`}),Object.freeze({lowS:!0,...t})}function ct(e){let t=st(e),{Fp:n,n:r,nByteLength:i,nBitLength:a}=t,o=n.BYTES+1,s=2*n.BYTES+1;function c(e){return J(e,r)}function l(e){return De(e,r)}let{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:p}=ot({...t,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x),o=w;return j(`isCompressed`,r),r?o(Uint8Array.from([t.hasEvenY()?2:3]),a):o(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){let t=e.length,r=e[0],i=e.subarray(1);if(t===o&&(r===2||r===3)){let e=M(i);if(!ne(e,$,n.ORDER))throw Error(`Point is not on curve`);let t=f(e),a;try{a=n.sqrt(t)}catch(e){let t=e instanceof Error?`: `+e.message:``;throw Error(`Point is not on curve`+t)}let o=(a&$)===$;return(r&1)==1!==o&&(a=n.neg(a)),{x:e,y:a}}if(t===s&&r===4)return{x:n.fromBytes(i.subarray(0,n.BYTES)),y:n.fromBytes(i.subarray(n.BYTES,2*n.BYTES))};{let e=o,n=s;throw Error(`invalid Point, expected length of `+e+`, or uncompressed `+n+`, got `+t)}}});function m(e){return e>r>>$}function h(e){return m(e)?c(-e):e}let g=(e,t,n)=>M(e.slice(t,n));class _{constructor(e,t,n){F(`r`,e,$,r),F(`s`,t,$,r),this.r=e,this.s=t,n!=null&&(this.recovery=n),Object.freeze(this)}static fromCompact(e){let t=i;return e=I(`compactSignature`,e,t*2),new _(g(e,0,t),g(e,t,2*t))}static fromDER(e){let{r:t,s:n}=Z.toSig(I(`DER`,e));return new _(t,n)}assertValidity(){}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){let{r,s:i,recovery:a}=this,o=C(I(`msgHash`,e));if(a==null||![0,1,2,3].includes(a))throw Error(`recovery id invalid`);let s=a===2||a===3?r+t.n:r;if(s>=n.ORDER)throw Error(`recovery id 2 or 3 invalid`);let d=a&1?`03`:`02`,f=u.fromHex(d+rt(s,n.BYTES)),p=l(s),m=c(-o*p),h=c(i*p),g=u.BASE.multiplyAndAddUnsafe(f,m,h);if(!g)throw Error(`point at infinify`);return g.assertValidity(),g}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return E(this.toDERHex())}toDERHex(){return Z.hexFromSig(this)}toCompactRawBytes(){return E(this.toCompactHex())}toCompactHex(){let e=i;return rt(this.r,e)+rt(this.s,e)}}let v={isValidPrivateKey(e){try{return d(e),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let e=ze(t.n);return Be(t.randomBytes(e),t.n)},precompute(e=8,t=u.BASE){return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function y(e,t=!0){return u.fromPrivateKey(e).toRawBytes(t)}function b(e){if(typeof e==`bigint`)return!1;if(e instanceof u)return!0;let r=I(`key`,e).length,a=n.BYTES,o=a+1,s=2*a+1;if(!(t.allowedPrivateKeyLengths||i===o))return r===o||r===s}function x(e,t,n=!0){if(b(e)===!0)throw Error(`first arg must be private key`);if(b(t)===!1)throw Error(`second arg must be public key`);return u.fromHex(t).multiply(d(e)).toRawBytes(n)}let S=t.bits2int||function(e){if(e.length>8192)throw Error(`input is too large`);let t=M(e),n=e.length*8-a;return n>0?t>>BigInt(n):t},C=t.bits2int_modN||function(e){return c(S(e))},T=k(a);function O(e){return F(`num < 2^`+a,e,Q,T),D(e,i)}function A(e,r,i=N){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{hash:a,randomBytes:o}=t,{lowS:s,prehash:f,extraEntropy:g}=i;s??=!0,e=I(`msgHash`,e),tt(i),f&&(e=I(`prehashed msgHash`,a(e)));let v=C(e),y=d(r),b=[O(y),O(v)];if(g!=null&&g!==!1){let e=g===!0?o(n.BYTES):g;b.push(I(`extraEntropy`,e))}let x=w(...b),T=v;function E(e){let t=S(e);if(!p(t))return;let n=l(t),r=u.BASE.multiply(t).toAffine(),i=c(r.x);if(i===Q)return;let a=c(n*c(T+i*y));if(a===Q)return;let o=(r.x===i?0:2)|Number(r.y&$),d=a;return s&&m(a)&&(d=h(a),o^=1),new _(i,d,o)}return{seed:x,k2sig:E}}let N={lowS:t.lowS,prehash:!1},re={lowS:t.lowS,prehash:!1};function P(e,n,r=N){let{seed:i,k2sig:a}=A(e,n,r),o=t;return ee(o.hash.outputLen,o.nByteLength,o.hmac)(i,a)}u.BASE._setWindowSize(8);function L(e,n,r,i=re){let a=e;n=I(`msgHash`,n),r=I(`publicKey`,r);let{lowS:o,prehash:s,format:d}=i;if(tt(i),`strict`in i)throw Error(`options.strict was renamed to lowS`);if(d!==void 0&&d!==`compact`&&d!==`der`)throw Error(`format must be compact or der`);let f=typeof a==`string`||te(a),p=!f&&!d&&typeof a==`object`&&!!a&&typeof a.r==`bigint`&&typeof a.s==`bigint`;if(!f&&!p)throw Error(`invalid signature, expected Uint8Array, hex string or Signature instance`);let m,h;try{if(p&&(m=new _(a.r,a.s)),f){try{d!==`compact`&&(m=_.fromDER(a))}catch(e){if(!(e instanceof Z.Err))throw e}!m&&d!==`der`&&(m=_.fromCompact(a))}h=u.fromHex(r)}catch{return!1}if(!m||o&&m.hasHighS())return!1;s&&(n=t.hash(n));let{r:g,s:v}=m,y=C(n),b=l(v),x=c(y*b),S=c(g*b),w=u.BASE.multiplyAndAddUnsafe(h,x,S)?.toAffine();return w?c(w.x)===g:!1}return{CURVE:t,getPublicKey:y,getSharedSecret:x,sign:P,verify:L,ProjectivePoint:u,Signature:_,utils:v}}function lt(e){return{hash:e,hmac:(t,...n)=>ce(e,t,l(...n)),randomBytes:b}}function ut(e,t){let n=t=>ct({...e,...lt(t)});return{...n(t),create:n}}var dt=e({secp256k1:()=>bt}),ft=BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`),pt=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),mt=BigInt(0),ht=BigInt(1),gt=BigInt(2),_t=(e,t)=>(e+t/gt)/t;function vt(e){let t=ft,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Y(Y(Y(u,n,t)*u%t,n,t)*u%t,gt,t)*l%t,f=Y(d,i,t)*d%t,p=Y(f,a,t)*f%t,m=Y(p,s,t)*p%t,h=Y(Y(Y(Y(Y(Y(m,c,t)*m%t,s,t)*p%t,n,t)*u%t,o,t)*f%t,r,t)*l%t,gt,t);if(!yt.eql(yt.sqr(h),e))throw Error(`Cannot find square root`);return h}var yt=X(ft,void 0,void 0,{sqrt:vt}),bt=ut({a:mt,b:BigInt(7),Fp:yt,n:pt,Gx:BigInt(`55066263022277343669578718895168534326250603453777594175500187360389116729240`),Gy:BigInt(`32670510020758816978083085130507043184471273380659243275938904335757337482424`),h:BigInt(1),lowS:!0,endo:{beta:BigInt(`0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`),splitScalar:e=>{let t=pt,n=BigInt(`0x3086d221a7d46bcde86c90e49284eb15`),r=-ht*BigInt(`0xe4437ed6010e88286f547fa90abfe4c3`),i=BigInt(`0x114ca50f7a8e2f3f657c1108d9d44cfd8`),a=n,o=BigInt(`0x100000000000000000000000000000000`),s=_t(a*e,t),c=_t(-r*e,t),l=J(e-s*n-c*i,t),u=J(-s*r-c*a,t),d=l>o,f=u>o;if(d&&(l=t-l),f&&(u=t-u),l>o||u>o)throw Error(`splitScalar: Endomorphism failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},be);export{be as a,ce as c,X as i,dt as n,Se as o,ut as r,xe as s,bt as t};
|
|
2
|
+
//# sourceMappingURL=secp256k1-yg8eeIYU.js.map
|