@antseed/gateway-console 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Activity-CoD1LZfl.js → Activity-C_HO7qSL.js} +1 -1
- package/dist/assets/{Audit-CNmmoaeN.js → Audit-CPbMBpcn.js} +1 -1
- package/dist/assets/{ChainGate-CeDu6YYJ.js → ChainGate-XojWG6ik.js} +1 -1
- package/dist/assets/{ChannelClose-C_SM1g28.js → ChannelClose-DoIyd3cZ.js} +1 -1
- package/dist/assets/{Charts-Dm9j6cVy.js → Charts-BskMsr_y.js} +1 -1
- package/dist/assets/{Chat-D1yVH5Y-.js → Chat-D0VwXSTJ.js} +3 -3
- package/dist/assets/{ConnectWallet-phY-Bf7w.js → ConnectWallet-bv1j8xJR.js} +1 -1
- package/dist/assets/{DataTable-D65CSQpj.js → DataTable-D-JhP6Cu.js} +1 -1
- package/dist/assets/{Disclosure-DrGE-NkF.js → Disclosure-2Zc4btXj.js} +1 -1
- package/dist/assets/{KeyHolder-CmffMcZD.js → KeyHolder-D2dEBiu4.js} +1 -1
- package/dist/assets/{Keys-BovEuhch.js → Keys-C8eP--Dj.js} +1 -1
- package/dist/assets/{Logs-B-T-V-pM.js → Logs-CkyveD5I.js} +1 -1
- package/dist/assets/{Members-tWNaQdIJ.js → Members-CstL7rtd.js} +1 -1
- package/dist/assets/{Migrate-IZJLx1xU.js → Migrate-DWKWE9N-.js} +1 -1
- package/dist/assets/Models-WCJJM5l5.js +1 -0
- package/dist/assets/{OperatorActions-DfjEKPUD.js → OperatorActions-C13p8Mup.js} +1 -1
- package/dist/assets/{OperatorGateAlert-Bq1ilVp6.js → OperatorGateAlert-CQtV_buR.js} +1 -1
- package/dist/assets/{Overview-CAxieiTF.js → Overview-DTWHu-uz.js} +1 -1
- package/dist/assets/PeerPicker-DrpM2w08.js +1 -0
- package/dist/assets/{PolicyEditor-BLo1sheV.js → PolicyEditor-DNb3bKbN.js} +1 -1
- package/dist/assets/{PolicyField-CNEZju4W.js → PolicyField-CfklGeps.js} +1 -1
- package/dist/assets/{Presets-DBRoMTo4.js → Presets-CHEpKMLB.js} +2 -2
- package/dist/assets/Providers-CT_U_xku.js +1 -0
- package/dist/assets/RequestLog-aPr3ty82.js +1 -0
- package/dist/assets/{Rewards-CRiw-wXO.js → Rewards-DLmqivnL.js} +2 -2
- package/dist/assets/{RewardsClaim-D6P8go-K.js → RewardsClaim-CcLsyzPs.js} +1 -1
- package/dist/assets/{Routing-YpzgjNx_.js → Routing-D7AS9ogG.js} +1 -1
- package/dist/assets/{Segmented-YOSVapPh.js → Segmented-BJMfyrv9.js} +1 -1
- package/dist/assets/{SelectField-Cog9tKMb.js → SelectField-Yrfi46XZ.js} +1 -1
- package/dist/assets/{Settings-CSXJvDLz.js → Settings-DYAb7Idr.js} +3 -3
- package/dist/assets/{Switch-CGhLd0Ay.js → Switch-DQFMOyMT.js} +1 -1
- package/dist/assets/{Tabs-DuL015VX.js → Tabs-0IMgC9uU.js} +1 -1
- package/dist/assets/{TextAreaField-Cxpnr6YH.js → TextAreaField-CKrBh0oZ.js} +1 -1
- package/dist/assets/{UsageByModel-5QuGhD1d.js → UsageByModel-D-xMV8ke.js} +1 -1
- package/dist/assets/{Wallet-BOMYI48H.js → Wallet-eX5k-E9r.js} +4 -4
- package/dist/assets/{WalletConfirm-Dc0AMNYH.js → WalletConfirm-D_hppAfp.js} +1 -1
- package/dist/assets/{WalletFunding-CsUmR_iR.js → WalletFunding-Cd8311aj.js} +1 -1
- package/dist/assets/{WalletSignIn-_VjhsjCt.js → WalletSignIn-Dml1bE7_.js} +1 -1
- package/dist/assets/{Workspaces-Da-rLWlz.js → Workspaces-Dc7lPxxi.js} +1 -1
- package/dist/assets/{add-Btpjkoo6.js → add-DhKjYYaW.js} +1 -1
- package/dist/assets/{all-wallets-BfrjmkEM.js → all-wallets-B1SSU1TF.js} +1 -1
- package/dist/assets/{app-store-CjAKxMNO.js → app-store-fOZ_23bX.js} +1 -1
- package/dist/assets/{apple-BcO7LcJZ.js → apple-_8Zbl9Z_.js} +1 -1
- package/dist/assets/{arrow-bottom-DYhsTHhV.js → arrow-bottom-DPc1Zc38.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-DH3-k8Pr.js → arrow-bottom-circle-B0tSexI5.js} +1 -1
- package/dist/assets/{arrow-left-i-RgLGSY.js → arrow-left-BRvgjm8f.js} +1 -1
- package/dist/assets/{arrow-right-Byrj5OIH.js → arrow-right-0-kK_2Ru.js} +1 -1
- package/dist/assets/{arrow-top-BvEWR8S0.js → arrow-top-Bxpi_NOR.js} +1 -1
- package/dist/assets/{bank-CqGqrPxl.js → bank-CDSQYgdF.js} +1 -1
- package/dist/assets/{basic-DWDkRcdy.js → basic-75Z8JR0c.js} +1 -1
- package/dist/assets/{browser-CQNym1bY.js → browser-BdywFN9y.js} +1 -1
- package/dist/assets/{bundle-full-C55tgBr2.js → bundle-full-zTuzz_v7.js} +1 -1
- package/dist/assets/{card-D2zVsWGG.js → card-GqsikqTj.js} +1 -1
- package/dist/assets/{ccip-2-SkbDQO.js → ccip-CGkS6Jyg.js} +1 -1
- package/dist/assets/{checkmark-FRmQx2A8.js → checkmark-Bq0DRPd3.js} +1 -1
- package/dist/assets/{checkmark-bold-BQmDzpHv.js → checkmark-bold-BbhqFFvY.js} +1 -1
- package/dist/assets/{chevron-bottom-iNshLmUE.js → chevron-bottom-LkblkfKl.js} +1 -1
- package/dist/assets/{chevron-left-DZ-hTSFy.js → chevron-left-D5ZHrKz6.js} +1 -1
- package/dist/assets/{chevron-right-ftn9B4r7.js → chevron-right-CZEpGP_Y.js} +1 -1
- package/dist/assets/{chevron-top-nKnnD3BB.js → chevron-top-D081n7MO.js} +1 -1
- package/dist/assets/{chrome-store-Jvo-YJCr.js → chrome-store-DD4b3pix.js} +1 -1
- package/dist/assets/{clock-J68M1oCn.js → clock-CIkNUdlW.js} +1 -1
- package/dist/assets/{close-Bb5jO3su.js → close-MjqlUFnr.js} +1 -1
- package/dist/assets/{code-block-6bmX2qDf.js → code-block-BDV3hPqW.js} +1 -1
- package/dist/assets/{coinPlaceholder-BzR2PaE2.js → coinPlaceholder-CQSfO1WN.js} +1 -1
- package/dist/assets/{compass-_xiCm8H2.js → compass-C5kD2161.js} +1 -1
- package/dist/assets/{copy-Cn8HQUQ0.js → copy-Zrz0R86f.js} +1 -1
- package/dist/assets/{core-z96MxYDt.js → core-CH8pl6He.js} +3 -3
- package/dist/assets/cursor-BkEr5_-X.js +3 -0
- package/dist/assets/{cursor-transparent-BtLB_SMp.js → cursor-transparent-DsWWbUhZ.js} +1 -1
- package/dist/assets/{desktop-BbxKfMA_.js → desktop-C0-agZjr.js} +1 -1
- package/dist/assets/{disconnect-BLztvIUd.js → disconnect-DMDC_Xs6.js} +1 -1
- package/dist/assets/{discord-CHUWozPc.js → discord-C3cOERbi.js} +1 -1
- package/dist/assets/{en_US-Y4ZOVFV4-CAcvlKBB.js → en_US-Y4ZOVFV4-D2zZwqC_.js} +4 -4
- package/dist/assets/{etherscan-D5vLd5La.js → etherscan-m6ykHpsX.js} +1 -1
- package/dist/assets/{exclamation-triangle-qrQeSTv8.js → exclamation-triangle-Ndf0Nf0N.js} +1 -1
- package/dist/assets/{extension-4gVUPN7H.js → extension-nQAe1Vqe.js} +1 -1
- package/dist/assets/{external-link-B14WJWrF.js → external-link-Ct2elSIz.js} +1 -1
- package/dist/assets/{facebook-CIMBt82S.js → facebook-BcEQkgXt.js} +1 -1
- package/dist/assets/{farcaster-c2htRu7g.js → farcaster-Bm-SoK56.js} +1 -1
- package/dist/assets/{filters-Bv71E2AR.js → filters-DkNOeYpX.js} +1 -1
- package/dist/assets/{github-UYR2U4eW.js → github-CLUyT4GZ.js} +1 -1
- package/dist/assets/{google-n2NyY3Dw.js → google-Bzb8d8aw.js} +1 -1
- package/dist/assets/{help-circle-BLFRE_d4.js → help-circle-C5S7GK9d.js} +1 -1
- package/dist/assets/{highlighted-body-KQOG7T2V-BPvcfizq.js → highlighted-body-KQOG7T2V-4RHbDcyq.js} +1 -1
- package/dist/assets/{id-Bx-RYygz.js → id-CjwfmICa.js} +1 -1
- package/dist/assets/{image-BOkMzreg.js → image-CZAX7pOB.js} +1 -1
- package/dist/assets/{index-RORHmLec.js → index-B8VMfX86.js} +1 -1
- package/dist/assets/{index-DzFVk9QK.js → index-BGpZJvqT.js} +1 -1
- package/dist/assets/{index-BG30WuBG.js → index-BadBPNlq.js} +5 -5
- package/dist/assets/{index-DUGIknuZ.js → index-CZ-EHDzh.js} +1 -1
- package/dist/assets/{index-FSpcDkTF.js → index-k_E0JTj8.js} +3 -3
- package/dist/assets/{index.es-CA2ape1X.js → index.es-CQ9CIS6P.js} +4 -4
- package/dist/assets/{info-Cn0tJEtZ.js → info-CRdyUurs.js} +1 -1
- package/dist/assets/{info-circle-Bu4Zfbo-.js → info-circle-Bulr5-X0.js} +1 -1
- package/dist/assets/{lightbulb-CEuGFxl3.js → lightbulb-BccTnGBf.js} +1 -1
- package/dist/assets/{limits-Cv54gck6.js → limits-DnXi8KYO.js} +1 -1
- package/dist/assets/{mail-DTJ1wl6n.js → mail-J1p7aEAL.js} +1 -1
- package/dist/assets/{mermaid-MCJ5UELQ-BedJEojm.js → mermaid-MCJ5UELQ-DS0t3vui.js} +3 -3
- package/dist/assets/{metamask-sdk-CQV3kKmz.js → metamask-sdk-DIbH7ulQ.js} +1 -1
- package/dist/assets/{mobile-D5XkpStI.js → mobile-DweZDHJs.js} +1 -1
- package/dist/assets/{models-DMYWCgsM.js → models-KtwCOBAB.js} +1 -1
- package/dist/assets/{more-DdrXAXX1.js → more-ftCZ78Ri.js} +1 -1
- package/dist/assets/{network-placeholder-DYxULQKf.js → network-placeholder-C56vppZF.js} +1 -1
- package/dist/assets/{nftPlaceholder-DNCBtU2V.js → nftPlaceholder-VVSPOtjy.js} +1 -1
- package/dist/assets/{off-x6tIm6IU.js → off-CB6AUEcL.js} +1 -1
- package/dist/assets/{play-store-DH_0xG8x.js → play-store-Cbt8S4Fy.js} +1 -1
- package/dist/assets/{plus-D6bTrOQ5.js → plus-D4MGLM7H.js} +1 -1
- package/dist/assets/{qr-code-nZ-ywovk.js → qr-code-BcnaLoHb.js} +1 -1
- package/dist/assets/{recycle-horizontal-Dfef9bS8.js → recycle-horizontal-CbXg23Et.js} +1 -1
- package/dist/assets/{refresh-DjaTupr6.js → refresh-DIF_EhZz.js} +1 -1
- package/dist/assets/{reown-logo-8xfPxyEW.js → reown-logo-C6kx1Dpz.js} +1 -1
- package/dist/assets/{search-CTyg9yLr.js → search-DuCbGgsb.js} +1 -1
- package/dist/assets/{secp256k1-C3GZOk0r.js → secp256k1-qeEbqQxX.js} +1 -1
- package/dist/assets/{send-BRCwXyYl.js → send-DkMK92qb.js} +1 -1
- package/dist/assets/{swapHorizontal-DQysA-xv.js → swapHorizontal-m5CpC7Qf.js} +1 -1
- package/dist/assets/{swapHorizontalBold-CfvpnhxX.js → swapHorizontalBold-15eicY1d.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-Ei15IdQU.js → swapHorizontalMedium-Dgs4j9qs.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-BrdyV7V9.js → swapHorizontalRoundedBold-C9M5muAI.js} +1 -1
- package/dist/assets/{swapVertical-Chu7IZEN.js → swapVertical-Drjd1fn6.js} +1 -1
- package/dist/assets/{telegram-WX2YRbPh.js → telegram-BgkRAeS_.js} +1 -1
- package/dist/assets/{three-dots-DxlCOrsx.js → three-dots-C5xkxl8k.js} +1 -1
- package/dist/assets/{twitch-DnDwl6Wp.js → twitch-CQfDaj1f.js} +1 -1
- package/dist/assets/{twitterIcon-BRzgYnIv.js → twitterIcon-XiikTDVV.js} +1 -1
- package/dist/assets/{usage-CSmvbieU.js → usage-E97PY8Eg.js} +1 -1
- package/dist/assets/{useInfiniteQuery-Dd787Fyg.js → useInfiniteQuery-D4a4EjtW.js} +1 -1
- package/dist/assets/{useTx-BMOzJPjG.js → useTx-sWvJMTA4.js} +1 -1
- package/dist/assets/{verify-BDEQw6N7.js → verify-B_XwiCO4.js} +1 -1
- package/dist/assets/{verify-filled-4pi90YF-.js → verify-filled-o6LejTdA.js} +1 -1
- package/dist/assets/{w3m-modal-0lsUnIxD.js → w3m-modal-BmGCQizE.js} +1 -1
- package/dist/assets/{wallet-Cdj3wKM9.js → wallet-2tmSJ8kt.js} +1 -1
- package/dist/assets/{wallet-placeholder-9WrqEYA6.js → wallet-placeholder-BEYpeK2m.js} +1 -1
- package/dist/assets/{walletconnect-Dxw2wfHl.js → walletconnect-COxaZlsg.js} +1 -1
- package/dist/assets/{warning-circle-BS-8TEUR.js → warning-circle-CF-y1g4G.js} +1 -1
- package/dist/assets/{x-BuEdoHYI.js → x-YfU_qc_f.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Models-gJrRx-QV.js +0 -1
- package/dist/assets/PeerPicker-JK4q0ZO9.js +0 -1
- package/dist/assets/Providers-B3qO68z-.js +0 -1
- package/dist/assets/RequestLog-vl46fVIZ.js +0 -1
- package/dist/assets/cursor-AmgDWaYf.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as Xt,c as At,a as Et,t as Qt,b as de,w as he,r as P,d as ge,e as we,f as pe,g as be}from"./index.es-CA2ape1X.js";import"./index-BG30WuBG.js";import"./events-DQ172AOg.js";function ye(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const o=BigInt(32),s=BigInt(4294967295),c=Number(t>>o&s),f=Number(t&s),i=r?4:0,u=r?0:4;n.setUint32(e+i,c,r),n.setUint32(e+u,f,r)}function me(n,e,t){return n&e^~n&t}function xe(n,e,t){return n&e^n&t^e&t}class Ee extends Xt{constructor(e,t,r,o){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=At(this.buffer)}update(e){Et(this);const{view:t,buffer:r,blockLen:o}=this;e=Qt(e);const s=e.length;for(let c=0;c<s;){const f=Math.min(o-this.pos,s-c);if(f===o){const i=At(e);for(;o<=s-c;c+=o)this.process(i,c);continue}r.set(e.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Et(this),de(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:s}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(r,0),c=0);for(let h=c;h<o;h++)t[h]=0;ye(r,o-8,BigInt(this.length*8),s),this.process(r,0);const f=At(e),i=this.outputLen;if(i%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=i/4,y=this.get();if(u>y.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)f.setUint32(4*h,y[h],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:o,finished:s,destroyed:c,pos:f}=this;return e.length=o,e.pos=f,e.finished=s,e.destroyed=c,o%t&&e.buffer.set(r),e}}const Be=new Uint32Array([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]),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),J=new Uint32Array(64);class ve extends Ee{constructor(){super(64,32,8,!1),this.A=Q[0]|0,this.B=Q[1]|0,this.C=Q[2]|0,this.D=Q[3]|0,this.E=Q[4]|0,this.F=Q[5]|0,this.G=Q[6]|0,this.H=Q[7]|0}get(){const{A:e,B:t,C:r,D:o,E:s,F:c,G:f,H:i}=this;return[e,t,r,o,s,c,f,i]}set(e,t,r,o,s,c,f,i){this.A=e|0,this.B=t|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=c|0,this.G=f|0,this.H=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)J[h]=e.getUint32(t,!1);for(let h=16;h<64;h++){const l=J[h-15],m=J[h-2],N=P(l,7)^P(l,18)^l>>>3,b=P(m,17)^P(m,19)^m>>>10;J[h]=b+J[h-7]+N+J[h-16]|0}let{A:r,B:o,C:s,D:c,E:f,F:i,G:u,H:y}=this;for(let h=0;h<64;h++){const l=P(f,6)^P(f,11)^P(f,25),m=y+l+me(f,i,u)+Be[h]+J[h]|0,b=(P(r,2)^P(r,13)^P(r,22))+xe(r,o,s)|0;y=u,u=i,i=f,f=c+m|0,c=s,s=o,o=r,r=m+b|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,c=c+this.D|0,f=f+this.E|0,i=i+this.F|0,u=u+this.G|0,y=y+this.H|0,this.set(r,o,s,c,f,i,u,y)}roundClean(){J.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Se=he(()=>new ve);class Jt extends Xt{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ge(e);const r=Qt(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?e.create().update(r).digest():r);for(let c=0;c<s.length;c++)s[c]^=54;this.iHash.update(s),this.oHash=e.create();for(let c=0;c<s.length;c++)s[c]^=106;this.oHash.update(s),s.fill(0)}update(e){return Et(this),this.iHash.update(e),this}digestInto(e){Et(this),we(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:o,destroyed:s,blockLen:c,outputLen:f}=this;return e=e,e.finished=o,e.destroyed=s,e.blockLen=c,e.outputLen=f,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const te=(n,e,t)=>new Jt(n,e).update(t).digest();te.create=(n,e)=>new Jt(n,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ct=BigInt(0),ee=BigInt(1),Ae=BigInt(2);function it(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function yt(n){if(!it(n))throw new Error("Uint8Array expected")}function at(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}const Ie=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function ut(n){yt(n);let e="";for(let t=0;t<n.length;t++)e+=Ie[n[t]];return e}function wt(n){const e=n.toString(16);return e.length&1?"0"+e:e}function Zt(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?Ct:BigInt("0x"+n)}const D={_0:48,_9:57,A:65,F:70,a:97,f:102};function jt(n){if(n>=D._0&&n<=D._9)return n-D._0;if(n>=D.A&&n<=D.F)return n-(D.A-10);if(n>=D.a&&n<=D.f)return n-(D.a-10)}function pt(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let o=0,s=0;o<t;o++,s+=2){const c=jt(n.charCodeAt(s)),f=jt(n.charCodeAt(s+1));if(c===void 0||f===void 0){const i=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+i+'" at index '+s)}r[o]=c*16+f}return r}function rt(n){return Zt(ut(n))}function Rt(n){return yt(n),Zt(ut(Uint8Array.from(n).reverse()))}function lt(n,e){return pt(n.toString(16).padStart(e*2,"0"))}function Mt(n,e){return lt(n,e).reverse()}function K(n,e,t){let r;if(typeof e=="string")try{r=pt(e)}catch(s){throw new Error(n+" must be hex string or Uint8Array, cause: "+s)}else if(it(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const o=r.length;if(typeof t=="number"&&o!==t)throw new Error(n+" of length "+t+" expected, got "+o);return r}function bt(...n){let e=0;for(let r=0;r<n.length;r++){const o=n[r];yt(o),e+=o.length}const t=new Uint8Array(e);for(let r=0,o=0;r<n.length;r++){const s=n[r];t.set(s,o),o+=s.length}return t}const It=n=>typeof n=="bigint"&&Ct<=n;function Bt(n,e,t){return It(n)&&It(e)&&It(t)&&e<=n&&n<t}function ot(n,e,t,r){if(!Bt(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function ne(n){let e;for(e=0;n>Ct;n>>=ee,e+=1);return e}const Vt=n=>(Ae<<BigInt(n-1))-ee,Nt=n=>new Uint8Array(n),Yt=n=>Uint8Array.from(n);function re(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=Nt(n),o=Nt(n),s=0;const c=()=>{r.fill(1),o.fill(0),s=0},f=(...h)=>t(o,r,...h),i=(h=Nt())=>{o=f(Yt([0]),h),r=f(),h.length!==0&&(o=f(Yt([1]),h),r=f())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const l=[];for(;h<e;){r=f();const m=r.slice();l.push(m),h+=r.length}return bt(...l)};return(h,l)=>{c(),i(h);let m;for(;!(m=l(u()));)i();return c(),m}}const Ne={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||it(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function mt(n,e,t={}){const r=(o,s,c)=>{const f=Ne[s];if(typeof f!="function")throw new Error("invalid validator function");const i=n[o];if(!(c&&i===void 0)&&!f(i,n))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+i)};for(const[o,s]of Object.entries(e))r(o,s,!1);for(const[o,s]of Object.entries(t))r(o,s,!0);return n}function Ut(n){const e=new WeakMap;return(t,...r)=>{const o=e.get(t);if(o!==void 0)return o;const s=n(t,...r);return e.set(t,s),s}}const qe=Object.freeze(Object.defineProperty({__proto__:null,aInRange:ot,abool:at,abytes:yt,bitLen:ne,bitMask:Vt,bytesToHex:ut,bytesToNumberBE:rt,bytesToNumberLE:Rt,concatBytes:bt,createHmacDrbg:re,ensureBytes:K,hexToBytes:pt,hexToNumber:Zt,inRange:Bt,isBytes:it,memoized:Ut,numberToBytesBE:lt,numberToBytesLE:Mt,numberToHexUnpadded:wt,validateObject:mt},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const z=BigInt(0),_=BigInt(1),nt=BigInt(2),Oe=BigInt(3),_t=BigInt(4),Ft=BigInt(5),Kt=BigInt(8);function V(n,e){const t=n%e;return t>=z?t:e+t}function Le(n,e,t){if(e<z)throw new Error("invalid exponent, negatives unsupported");if(t<=z)throw new Error("invalid modulus");if(t===_)return z;let r=_;for(;e>z;)e&_&&(r=r*n%t),n=n*n%t,e>>=_;return r}function Y(n,e,t){let r=n;for(;e-- >z;)r*=r,r%=t;return r}function Tt(n,e){if(n===z)throw new Error("invert: expected non-zero number");if(e<=z)throw new Error("invert: expected positive modulus, got "+e);let t=V(n,e),r=e,o=z,s=_;for(;t!==z;){const f=r/t,i=r%t,u=o-s*f;r=t,t=i,o=s,s=u}if(r!==_)throw new Error("invert: does not exist");return V(o,e)}function He(n){const e=(n-_)/nt;let t,r,o;for(t=n-_,r=0;t%nt===z;t/=nt,r++);for(o=nt;o<n&&Le(o,e,n)!==n-_;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const c=(n+_)/_t;return function(i,u){const y=i.pow(u,c);if(!i.eql(i.sqr(y),u))throw new Error("Cannot find square root");return y}}const s=(t+_)/nt;return function(f,i){if(f.pow(i,e)===f.neg(f.ONE))throw new Error("Cannot find square root");let u=r,y=f.pow(f.mul(f.ONE,o),t),h=f.pow(i,s),l=f.pow(i,t);for(;!f.eql(l,f.ONE);){if(f.eql(l,f.ZERO))return f.ZERO;let m=1;for(let b=f.sqr(l);m<u&&!f.eql(b,f.ONE);m++)b=f.sqr(b);const N=f.pow(y,_<<BigInt(u-m-1));y=f.sqr(N),h=f.mul(h,N),l=f.mul(l,y),u=m}return h}}function Ue(n){if(n%_t===Oe){const e=(n+_)/_t;return function(r,o){const s=r.pow(o,e);if(!r.eql(r.sqr(s),o))throw new Error("Cannot find square root");return s}}if(n%Kt===Ft){const e=(n-Ft)/Kt;return function(r,o){const s=r.mul(o,nt),c=r.pow(s,e),f=r.mul(o,c),i=r.mul(r.mul(f,nt),c),u=r.mul(f,r.sub(i,r.ONE));if(!r.eql(r.sqr(u),o))throw new Error("Cannot find square root");return u}}return He(n)}const _e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Te(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=_e.reduce((r,o)=>(r[o]="function",r),e);return mt(n,t)}function ke(n,e,t){if(t<z)throw new Error("invalid exponent, negatives unsupported");if(t===z)return n.ONE;if(t===_)return e;let r=n.ONE,o=e;for(;t>z;)t&_&&(r=n.mul(r,o)),o=n.sqr(o),t>>=_;return r}function ze(n,e){const t=new Array(e.length),r=e.reduce((s,c,f)=>n.is0(c)?s:(t[f]=s,n.mul(s,c)),n.ONE),o=n.inv(r);return e.reduceRight((s,c,f)=>n.is0(c)?s:(t[f]=n.mul(s,t[f]),n.mul(s,c)),o),t}function oe(n,e){const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function ie(n,e,t=!1,r={}){if(n<=z)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:o,nByteLength:s}=oe(n,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:n,isLE:t,BITS:o,BYTES:s,MASK:Vt(o),ZERO:z,ONE:_,create:i=>V(i,n),isValid:i=>{if(typeof i!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof i);return z<=i&&i<n},is0:i=>i===z,isOdd:i=>(i&_)===_,neg:i=>V(-i,n),eql:(i,u)=>i===u,sqr:i=>V(i*i,n),add:(i,u)=>V(i+u,n),sub:(i,u)=>V(i-u,n),mul:(i,u)=>V(i*u,n),pow:(i,u)=>ke(f,i,u),div:(i,u)=>V(i*Tt(u,n),n),sqrN:i=>i*i,addN:(i,u)=>i+u,subN:(i,u)=>i-u,mulN:(i,u)=>i*u,inv:i=>Tt(i,n),sqrt:r.sqrt||(i=>(c||(c=Ue(n)),c(f,i))),invertBatch:i=>ze(f,i),cmov:(i,u,y)=>y?u:i,toBytes:i=>t?Mt(i,s):lt(i,s),fromBytes:i=>{if(i.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+i.length);return t?Rt(i):rt(i)}});return Object.freeze(f)}function se(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function ce(n){const e=se(n);return e+Math.ceil(e/2)}function Ce(n,e,t=!1){const r=n.length,o=se(e),s=ce(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const c=t?Rt(n):rt(n),f=V(c,e-_)+_;return t?Mt(f,o):lt(f,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pt=BigInt(0),xt=BigInt(1);function qt(n,e){const t=e.negate();return n?t:e}function fe(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function Ot(n,e){fe(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1);return{windows:t,windowSize:r}}function Ze(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function Re(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const Lt=new WeakMap,ae=new WeakMap;function Ht(n){return ae.get(n)||1}function Me(n,e){return{constTimeNegate:qt,hasPrecomputes(t){return Ht(t)!==1},unsafeLadder(t,r,o=n.ZERO){let s=t;for(;r>Pt;)r&xt&&(o=o.add(s)),s=s.double(),r>>=xt;return o},precomputeWindow(t,r){const{windows:o,windowSize:s}=Ot(r,e),c=[];let f=t,i=f;for(let u=0;u<o;u++){i=f,c.push(i);for(let y=1;y<s;y++)i=i.add(f),c.push(i);f=i.double()}return c},wNAF(t,r,o){const{windows:s,windowSize:c}=Ot(t,e);let f=n.ZERO,i=n.BASE;const u=BigInt(2**t-1),y=2**t,h=BigInt(t);for(let l=0;l<s;l++){const m=l*c;let N=Number(o&u);o>>=h,N>c&&(N-=y,o+=xt);const b=m,a=m+Math.abs(N)-1,g=l%2!==0,x=N<0;N===0?i=i.add(qt(g,r[b])):f=f.add(qt(x,r[a]))}return{p:f,f:i}},wNAFUnsafe(t,r,o,s=n.ZERO){const{windows:c,windowSize:f}=Ot(t,e),i=BigInt(2**t-1),u=2**t,y=BigInt(t);for(let h=0;h<c;h++){const l=h*f;if(o===Pt)break;let m=Number(o&i);if(o>>=y,m>f&&(m-=u,o+=xt),m===0)continue;let N=r[l+Math.abs(m)-1];m<0&&(N=N.negate()),s=s.add(N)}return s},getPrecomputes(t,r,o){let s=Lt.get(r);return s||(s=this.precomputeWindow(r,t),t!==1&&Lt.set(r,o(s))),s},wNAFCached(t,r,o){const s=Ht(t);return this.wNAF(s,this.getPrecomputes(s,t,o),r)},wNAFCachedUnsafe(t,r,o,s){const c=Ht(t);return c===1?this.unsafeLadder(t,r,s):this.wNAFUnsafe(c,this.getPrecomputes(c,t,o),r,s)},setWindowSize(t,r){fe(r,e),ae.set(t,r),Lt.delete(t)}}}function Ve(n,e,t,r){if(Ze(t,n),Re(r,e),t.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=n.ZERO,s=ne(BigInt(t.length)),c=s>12?s-3:s>4?s-2:s?2:1,f=(1<<c)-1,i=new Array(f+1).fill(o),u=Math.floor((e.BITS-1)/c)*c;let y=o;for(let h=u;h>=0;h-=c){i.fill(o);for(let m=0;m<r.length;m++){const N=r[m],b=Number(N>>BigInt(h)&BigInt(f));i[b]=i[b].add(t[m])}let l=o;for(let m=i.length-1,N=o;m>0;m--)N=N.add(i[m]),l=l.add(N);if(y=y.add(l),h!==0)for(let m=0;m<c;m++)y=y.double()}return y}function ue(n){return Te(n.Fp),mt(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...oe(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Gt(n){n.lowS!==void 0&&at("lowS",n.lowS),n.prehash!==void 0&&at("prehash",n.prehash)}function je(n){const e=ue(n);mt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:o}=e;if(t){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Ye,hexToBytes:Fe}=qe;class Ke extends Error{constructor(e=""){super(e)}}const $={Err:Ke,_tlv:{encode:(n,e)=>{const{Err:t}=$;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,o=wt(r);if(o.length/2&128)throw new t("tlv.encode: long form length too big");const s=r>127?wt(o.length/2|128):"";return wt(n)+s+o+e},decode(n,e){const{Err:t}=$;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const o=e[r++],s=!!(o&128);let c=0;if(!s)c=o;else{const i=o&127;if(!i)throw new t("tlv.decode(long): indefinite length not supported");if(i>4)throw new t("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+i);if(u.length!==i)throw new t("tlv.decode: length bytes not complete");if(u[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const y of u)c=c<<8|y;if(r+=i,c<128)throw new t("tlv.decode(long): not minimal encoding")}const f=e.subarray(r,r+c);if(f.length!==c)throw new t("tlv.decode: wrong value length");return{v:f,l:e.subarray(r+c)}}},_int:{encode(n){const{Err:e}=$;if(n<W)throw new e("integer: negative integers are not allowed");let t=wt(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=$;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Ye(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=$,o=typeof n=="string"?Fe(n):n;yt(o);const{v:s,l:c}=r.decode(48,o);if(c.length)throw new e("invalid signature: left bytes after parsing");const{v:f,l:i}=r.decode(2,s),{v:u,l:y}=r.decode(2,i);if(y.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(f),s:t.decode(u)}},hexFromSig(n){const{_tlv:e,_int:t}=$,r=e.encode(2,t.encode(n.r)),o=e.encode(2,t.encode(n.s)),s=r+o;return e.encode(48,s)}},W=BigInt(0),k=BigInt(1);BigInt(2);const Dt=BigInt(3);BigInt(4);function Pe(n){const e=je(n),{Fp:t}=e,r=ie(e.n,e.nBitLength),o=e.toBytes||((b,a,g)=>{const x=a.toAffine();return bt(Uint8Array.from([4]),t.toBytes(x.x),t.toBytes(x.y))}),s=e.fromBytes||(b=>{const a=b.subarray(1),g=t.fromBytes(a.subarray(0,t.BYTES)),x=t.fromBytes(a.subarray(t.BYTES,2*t.BYTES));return{x:g,y:x}});function c(b){const{a,b:g}=e,x=t.sqr(b),E=t.mul(x,b);return t.add(t.add(E,t.mul(b,a)),g)}if(!t.eql(t.sqr(e.Gy),c(e.Gx)))throw new Error("bad generator point: equation left != right");function f(b){return Bt(b,k,e.n)}function i(b){const{allowedPrivateKeyLengths:a,nByteLength:g,wrapPrivateKey:x,n:E}=e;if(a&&typeof b!="bigint"){if(it(b)&&(b=ut(b)),typeof b!="string"||!a.includes(b.length))throw new Error("invalid private key");b=b.padStart(g*2,"0")}let q;try{q=typeof b=="bigint"?b:rt(K("private key",b,g))}catch{throw new Error("invalid private key, expected hex or "+g+" bytes, got "+typeof b)}return x&&(q=V(q,E)),ot("private key",q,k,E),q}function u(b){if(!(b instanceof l))throw new Error("ProjectivePoint expected")}const y=Ut((b,a)=>{const{px:g,py:x,pz:E}=b;if(t.eql(E,t.ONE))return{x:g,y:x};const q=b.is0();a==null&&(a=q?t.ONE:t.inv(E));const L=t.mul(g,a),I=t.mul(x,a),B=t.mul(E,a);if(q)return{x:t.ZERO,y:t.ZERO};if(!t.eql(B,t.ONE))throw new Error("invZ was invalid");return{x:L,y:I}}),h=Ut(b=>{if(b.is0()){if(e.allowInfinityPoint&&!t.is0(b.py))return;throw new Error("bad point: ZERO")}const{x:a,y:g}=b.toAffine();if(!t.isValid(a)||!t.isValid(g))throw new Error("bad point: x or y not FE");const x=t.sqr(g),E=c(a);if(!t.eql(x,E))throw new Error("bad point: equation left != right");if(!b.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class l{constructor(a,g,x){if(this.px=a,this.py=g,this.pz=x,a==null||!t.isValid(a))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(x==null||!t.isValid(x))throw new Error("z required");Object.freeze(this)}static fromAffine(a){const{x:g,y:x}=a||{};if(!a||!t.isValid(g)||!t.isValid(x))throw new Error("invalid affine point");if(a instanceof l)throw new Error("projective point not allowed");const E=q=>t.eql(q,t.ZERO);return E(g)&&E(x)?l.ZERO:new l(g,x,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(a){const g=t.invertBatch(a.map(x=>x.pz));return a.map((x,E)=>x.toAffine(g[E])).map(l.fromAffine)}static fromHex(a){const g=l.fromAffine(s(K("pointHex",a)));return g.assertValidity(),g}static fromPrivateKey(a){return l.BASE.multiply(i(a))}static msm(a,g){return Ve(l,r,a,g)}_setWindowSize(a){N.setWindowSize(this,a)}assertValidity(){h(this)}hasEvenY(){const{y:a}=this.toAffine();if(t.isOdd)return!t.isOdd(a);throw new Error("Field doesn't support isOdd")}equals(a){u(a);const{px:g,py:x,pz:E}=this,{px:q,py:L,pz:I}=a,B=t.eql(t.mul(g,I),t.mul(q,E)),A=t.eql(t.mul(x,I),t.mul(L,E));return B&&A}negate(){return new l(this.px,t.neg(this.py),this.pz)}double(){const{a,b:g}=e,x=t.mul(g,Dt),{px:E,py:q,pz:L}=this;let I=t.ZERO,B=t.ZERO,A=t.ZERO,v=t.mul(E,E),C=t.mul(q,q),U=t.mul(L,L),H=t.mul(E,q);return H=t.add(H,H),A=t.mul(E,L),A=t.add(A,A),I=t.mul(a,A),B=t.mul(x,U),B=t.add(I,B),I=t.sub(C,B),B=t.add(C,B),B=t.mul(I,B),I=t.mul(H,I),A=t.mul(x,A),U=t.mul(a,U),H=t.sub(v,U),H=t.mul(a,H),H=t.add(H,A),A=t.add(v,v),v=t.add(A,v),v=t.add(v,U),v=t.mul(v,H),B=t.add(B,v),U=t.mul(q,L),U=t.add(U,U),v=t.mul(U,H),I=t.sub(I,v),A=t.mul(U,C),A=t.add(A,A),A=t.add(A,A),new l(I,B,A)}add(a){u(a);const{px:g,py:x,pz:E}=this,{px:q,py:L,pz:I}=a;let B=t.ZERO,A=t.ZERO,v=t.ZERO;const C=e.a,U=t.mul(e.b,Dt);let H=t.mul(g,q),j=t.mul(x,L),d=t.mul(E,I),w=t.add(g,x),p=t.add(q,L);w=t.mul(w,p),p=t.add(H,j),w=t.sub(w,p),p=t.add(g,E);let S=t.add(q,I);return p=t.mul(p,S),S=t.add(H,d),p=t.sub(p,S),S=t.add(x,E),B=t.add(L,I),S=t.mul(S,B),B=t.add(j,d),S=t.sub(S,B),v=t.mul(C,p),B=t.mul(U,d),v=t.add(B,v),B=t.sub(j,v),v=t.add(j,v),A=t.mul(B,v),j=t.add(H,H),j=t.add(j,H),d=t.mul(C,d),p=t.mul(U,p),j=t.add(j,d),d=t.sub(H,d),d=t.mul(C,d),p=t.add(p,d),H=t.mul(j,p),A=t.add(A,H),H=t.mul(S,p),B=t.mul(w,B),B=t.sub(B,H),H=t.mul(w,j),v=t.mul(S,v),v=t.add(v,H),new l(B,A,v)}subtract(a){return this.add(a.negate())}is0(){return this.equals(l.ZERO)}wNAF(a){return N.wNAFCached(this,a,l.normalizeZ)}multiplyUnsafe(a){const{endo:g,n:x}=e;ot("scalar",a,W,x);const E=l.ZERO;if(a===W)return E;if(this.is0()||a===k)return this;if(!g||N.hasPrecomputes(this))return N.wNAFCachedUnsafe(this,a,l.normalizeZ);let{k1neg:q,k1:L,k2neg:I,k2:B}=g.splitScalar(a),A=E,v=E,C=this;for(;L>W||B>W;)L&k&&(A=A.add(C)),B&k&&(v=v.add(C)),C=C.double(),L>>=k,B>>=k;return q&&(A=A.negate()),I&&(v=v.negate()),v=new l(t.mul(v.px,g.beta),v.py,v.pz),A.add(v)}multiply(a){const{endo:g,n:x}=e;ot("scalar",a,k,x);let E,q;if(g){const{k1neg:L,k1:I,k2neg:B,k2:A}=g.splitScalar(a);let{p:v,f:C}=this.wNAF(I),{p:U,f:H}=this.wNAF(A);v=N.constTimeNegate(L,v),U=N.constTimeNegate(B,U),U=new l(t.mul(U.px,g.beta),U.py,U.pz),E=v.add(U),q=C.add(H)}else{const{p:L,f:I}=this.wNAF(a);E=L,q=I}return l.normalizeZ([E,q])[0]}multiplyAndAddUnsafe(a,g,x){const E=l.BASE,q=(I,B)=>B===W||B===k||!I.equals(E)?I.multiplyUnsafe(B):I.multiply(B),L=q(this,g).add(q(a,x));return L.is0()?void 0:L}toAffine(a){return y(this,a)}isTorsionFree(){const{h:a,isTorsionFree:g}=e;if(a===k)return!0;if(g)return g(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:a,clearCofactor:g}=e;return a===k?this:g?g(l,this):this.multiplyUnsafe(e.h)}toRawBytes(a=!0){return at("isCompressed",a),this.assertValidity(),o(l,this,a)}toHex(a=!0){return at("isCompressed",a),ut(this.toRawBytes(a))}}l.BASE=new l(e.Gx,e.Gy,t.ONE),l.ZERO=new l(t.ZERO,t.ONE,t.ZERO);const m=e.nBitLength,N=Me(l,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:i,weierstrassEquation:c,isWithinCurveOrder:f}}function Ge(n){const e=ue(n);return mt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function De(n){const e=Ge(n),{Fp:t,n:r}=e,o=t.BYTES+1,s=2*t.BYTES+1;function c(d){return V(d,r)}function f(d){return Tt(d,r)}const{ProjectivePoint:i,normPrivateKeyToScalar:u,weierstrassEquation:y,isWithinCurveOrder:h}=Pe({...e,toBytes(d,w,p){const S=w.toAffine(),O=t.toBytes(S.x),T=bt;return at("isCompressed",p),p?T(Uint8Array.from([w.hasEvenY()?2:3]),O):T(Uint8Array.from([4]),O,t.toBytes(S.y))},fromBytes(d){const w=d.length,p=d[0],S=d.subarray(1);if(w===o&&(p===2||p===3)){const O=rt(S);if(!Bt(O,k,t.ORDER))throw new Error("Point is not on curve");const T=y(O);let R;try{R=t.sqrt(T)}catch(F){const M=F instanceof Error?": "+F.message:"";throw new Error("Point is not on curve"+M)}const Z=(R&k)===k;return(p&1)===1!==Z&&(R=t.neg(R)),{x:O,y:R}}else if(w===s&&p===4){const O=t.fromBytes(S.subarray(0,t.BYTES)),T=t.fromBytes(S.subarray(t.BYTES,2*t.BYTES));return{x:O,y:T}}else{const O=o,T=s;throw new Error("invalid Point, expected length of "+O+", or uncompressed "+T+", got "+w)}}}),l=d=>ut(lt(d,e.nByteLength));function m(d){const w=r>>k;return d>w}function N(d){return m(d)?c(-d):d}const b=(d,w,p)=>rt(d.slice(w,p));class a{constructor(w,p,S){this.r=w,this.s=p,this.recovery=S,this.assertValidity()}static fromCompact(w){const p=e.nByteLength;return w=K("compactSignature",w,p*2),new a(b(w,0,p),b(w,p,2*p))}static fromDER(w){const{r:p,s:S}=$.toSig(K("DER",w));return new a(p,S)}assertValidity(){ot("r",this.r,k,r),ot("s",this.s,k,r)}addRecoveryBit(w){return new a(this.r,this.s,w)}recoverPublicKey(w){const{r:p,s:S,recovery:O}=this,T=I(K("msgHash",w));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const R=O===2||O===3?p+e.n:p;if(R>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const Z=(O&1)===0?"02":"03",G=i.fromHex(Z+l(R)),F=f(R),M=c(-T*F),st=c(S*F),X=i.BASE.multiplyAndAddUnsafe(G,M,st);if(!X)throw new Error("point at infinify");return X.assertValidity(),X}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new a(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return pt(this.toDERHex())}toDERHex(){return $.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return pt(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const g={isValidPrivateKey(d){try{return u(d),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const d=ce(e.n);return Ce(e.randomBytes(d),e.n)},precompute(d=8,w=i.BASE){return w._setWindowSize(d),w.multiply(BigInt(3)),w}};function x(d,w=!0){return i.fromPrivateKey(d).toRawBytes(w)}function E(d){const w=it(d),p=typeof d=="string",S=(w||p)&&d.length;return w?S===o||S===s:p?S===2*o||S===2*s:d instanceof i}function q(d,w,p=!0){if(E(d))throw new Error("first arg must be private key");if(!E(w))throw new Error("second arg must be public key");return i.fromHex(w).multiply(u(d)).toRawBytes(p)}const L=e.bits2int||function(d){if(d.length>8192)throw new Error("input is too large");const w=rt(d),p=d.length*8-e.nBitLength;return p>0?w>>BigInt(p):w},I=e.bits2int_modN||function(d){return c(L(d))},B=Vt(e.nBitLength);function A(d){return ot("num < 2^"+e.nBitLength,d,W,B),lt(d,e.nByteLength)}function v(d,w,p=C){if(["recovered","canonical"].some(tt=>tt in p))throw new Error("sign() legacy options not supported");const{hash:S,randomBytes:O}=e;let{lowS:T,prehash:R,extraEntropy:Z}=p;T==null&&(T=!0),d=K("msgHash",d),Gt(p),R&&(d=K("prehashed msgHash",S(d)));const G=I(d),F=u(w),M=[A(F),A(G)];if(Z!=null&&Z!==!1){const tt=Z===!0?O(t.BYTES):Z;M.push(K("extraEntropy",tt))}const st=bt(...M),X=G;function vt(tt){const ct=L(tt);if(!h(ct))return;const St=f(ct),dt=i.BASE.multiply(ct).toAffine(),et=c(dt.x);if(et===W)return;const ht=c(St*c(X+et*F));if(ht===W)return;let gt=(dt.x===et?0:2)|Number(dt.y&k),ft=ht;return T&&m(ht)&&(ft=N(ht),gt^=1),new a(et,ft,gt)}return{seed:st,k2sig:vt}}const C={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function H(d,w,p=C){const{seed:S,k2sig:O}=v(d,w,p),T=e;return re(T.hash.outputLen,T.nByteLength,T.hmac)(S,O)}i.BASE._setWindowSize(8);function j(d,w,p,S=U){var gt;const O=d;w=K("msgHash",w),p=K("publicKey",p);const{lowS:T,prehash:R,format:Z}=S;if(Gt(S),"strict"in S)throw new Error("options.strict was renamed to lowS");if(Z!==void 0&&Z!=="compact"&&Z!=="der")throw new Error("format must be compact or der");const G=typeof O=="string"||it(O),F=!G&&!Z&&typeof O=="object"&&O!==null&&typeof O.r=="bigint"&&typeof O.s=="bigint";if(!G&&!F)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let M,st;try{if(F&&(M=new a(O.r,O.s)),G){try{Z!=="compact"&&(M=a.fromDER(O))}catch(ft){if(!(ft instanceof $.Err))throw ft}!M&&Z!=="der"&&(M=a.fromCompact(O))}st=i.fromHex(p)}catch{return!1}if(!M||T&&M.hasHighS())return!1;R&&(w=e.hash(w));const{r:X,s:vt}=M,tt=I(w),ct=f(vt),St=c(tt*ct),dt=c(X*ct),et=(gt=i.BASE.multiplyAndAddUnsafe(st,St,dt))==null?void 0:gt.toAffine();return et?c(et.x)===X:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:q,sign:H,verify:j,ProjectivePoint:i,Signature:a,utils:g}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $e(n){return{hash:n,hmac:(e,...t)=>te(n,e,be(...t)),randomBytes:pe}}function We(n,e){const t=r=>De({...n,...$e(r)});return{...t(e),create:t}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const le=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),$t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Xe=BigInt(1),kt=BigInt(2),Wt=(n,e)=>(n+e/kt)/e;function Qe(n){const e=le,t=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),c=BigInt(23),f=BigInt(44),i=BigInt(88),u=n*n*n%e,y=u*u*n%e,h=Y(y,t,e)*y%e,l=Y(h,t,e)*y%e,m=Y(l,kt,e)*u%e,N=Y(m,o,e)*m%e,b=Y(N,s,e)*N%e,a=Y(b,f,e)*b%e,g=Y(a,i,e)*a%e,x=Y(g,f,e)*b%e,E=Y(x,t,e)*y%e,q=Y(E,c,e)*N%e,L=Y(q,r,e)*u%e,I=Y(L,kt,e);if(!zt.eql(zt.sqr(I),n))throw new Error("Cannot find square root");return I}const zt=ie(le,void 0,void 0,{sqrt:Qe}),Je=We({a:BigInt(0),b:BigInt(7),Fp:zt,n:$t,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=$t,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Xe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,c=BigInt("0x100000000000000000000000000000000"),f=Wt(s*n,e),i=Wt(-r*n,e);let u=V(n-f*t-i*o,e),y=V(-f*r-i*s,e);const h=u>c,l=y>c;if(h&&(u=e-u),l&&(y=e-y),u>c||y>c)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:h,k1:u,k2neg:l,k2:y}}}},Se);BigInt(0);Je.ProjectivePoint;export{Je as secp256k1};
|
|
1
|
+
import{H as Xt,c as At,a as Et,t as Qt,b as de,w as he,r as P,d as ge,e as we,f as pe,g as be}from"./index.es-CQ9CIS6P.js";import"./index-BadBPNlq.js";import"./events-DQ172AOg.js";function ye(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const o=BigInt(32),s=BigInt(4294967295),c=Number(t>>o&s),f=Number(t&s),i=r?4:0,u=r?0:4;n.setUint32(e+i,c,r),n.setUint32(e+u,f,r)}function me(n,e,t){return n&e^~n&t}function xe(n,e,t){return n&e^n&t^e&t}class Ee extends Xt{constructor(e,t,r,o){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=At(this.buffer)}update(e){Et(this);const{view:t,buffer:r,blockLen:o}=this;e=Qt(e);const s=e.length;for(let c=0;c<s;){const f=Math.min(o-this.pos,s-c);if(f===o){const i=At(e);for(;o<=s-c;c+=o)this.process(i,c);continue}r.set(e.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Et(this),de(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:s}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(r,0),c=0);for(let h=c;h<o;h++)t[h]=0;ye(r,o-8,BigInt(this.length*8),s),this.process(r,0);const f=At(e),i=this.outputLen;if(i%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=i/4,y=this.get();if(u>y.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)f.setUint32(4*h,y[h],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:o,finished:s,destroyed:c,pos:f}=this;return e.length=o,e.pos=f,e.finished=s,e.destroyed=c,o%t&&e.buffer.set(r),e}}const Be=new Uint32Array([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]),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),J=new Uint32Array(64);class ve extends Ee{constructor(){super(64,32,8,!1),this.A=Q[0]|0,this.B=Q[1]|0,this.C=Q[2]|0,this.D=Q[3]|0,this.E=Q[4]|0,this.F=Q[5]|0,this.G=Q[6]|0,this.H=Q[7]|0}get(){const{A:e,B:t,C:r,D:o,E:s,F:c,G:f,H:i}=this;return[e,t,r,o,s,c,f,i]}set(e,t,r,o,s,c,f,i){this.A=e|0,this.B=t|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=c|0,this.G=f|0,this.H=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)J[h]=e.getUint32(t,!1);for(let h=16;h<64;h++){const l=J[h-15],m=J[h-2],N=P(l,7)^P(l,18)^l>>>3,b=P(m,17)^P(m,19)^m>>>10;J[h]=b+J[h-7]+N+J[h-16]|0}let{A:r,B:o,C:s,D:c,E:f,F:i,G:u,H:y}=this;for(let h=0;h<64;h++){const l=P(f,6)^P(f,11)^P(f,25),m=y+l+me(f,i,u)+Be[h]+J[h]|0,b=(P(r,2)^P(r,13)^P(r,22))+xe(r,o,s)|0;y=u,u=i,i=f,f=c+m|0,c=s,s=o,o=r,r=m+b|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,c=c+this.D|0,f=f+this.E|0,i=i+this.F|0,u=u+this.G|0,y=y+this.H|0,this.set(r,o,s,c,f,i,u,y)}roundClean(){J.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Se=he(()=>new ve);class Jt extends Xt{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ge(e);const r=Qt(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?e.create().update(r).digest():r);for(let c=0;c<s.length;c++)s[c]^=54;this.iHash.update(s),this.oHash=e.create();for(let c=0;c<s.length;c++)s[c]^=106;this.oHash.update(s),s.fill(0)}update(e){return Et(this),this.iHash.update(e),this}digestInto(e){Et(this),we(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:o,destroyed:s,blockLen:c,outputLen:f}=this;return e=e,e.finished=o,e.destroyed=s,e.blockLen=c,e.outputLen=f,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const te=(n,e,t)=>new Jt(n,e).update(t).digest();te.create=(n,e)=>new Jt(n,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ct=BigInt(0),ee=BigInt(1),Ae=BigInt(2);function it(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function yt(n){if(!it(n))throw new Error("Uint8Array expected")}function at(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}const Ie=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function ut(n){yt(n);let e="";for(let t=0;t<n.length;t++)e+=Ie[n[t]];return e}function wt(n){const e=n.toString(16);return e.length&1?"0"+e:e}function Zt(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?Ct:BigInt("0x"+n)}const D={_0:48,_9:57,A:65,F:70,a:97,f:102};function jt(n){if(n>=D._0&&n<=D._9)return n-D._0;if(n>=D.A&&n<=D.F)return n-(D.A-10);if(n>=D.a&&n<=D.f)return n-(D.a-10)}function pt(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let o=0,s=0;o<t;o++,s+=2){const c=jt(n.charCodeAt(s)),f=jt(n.charCodeAt(s+1));if(c===void 0||f===void 0){const i=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+i+'" at index '+s)}r[o]=c*16+f}return r}function rt(n){return Zt(ut(n))}function Rt(n){return yt(n),Zt(ut(Uint8Array.from(n).reverse()))}function lt(n,e){return pt(n.toString(16).padStart(e*2,"0"))}function Mt(n,e){return lt(n,e).reverse()}function K(n,e,t){let r;if(typeof e=="string")try{r=pt(e)}catch(s){throw new Error(n+" must be hex string or Uint8Array, cause: "+s)}else if(it(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const o=r.length;if(typeof t=="number"&&o!==t)throw new Error(n+" of length "+t+" expected, got "+o);return r}function bt(...n){let e=0;for(let r=0;r<n.length;r++){const o=n[r];yt(o),e+=o.length}const t=new Uint8Array(e);for(let r=0,o=0;r<n.length;r++){const s=n[r];t.set(s,o),o+=s.length}return t}const It=n=>typeof n=="bigint"&&Ct<=n;function Bt(n,e,t){return It(n)&&It(e)&&It(t)&&e<=n&&n<t}function ot(n,e,t,r){if(!Bt(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function ne(n){let e;for(e=0;n>Ct;n>>=ee,e+=1);return e}const Vt=n=>(Ae<<BigInt(n-1))-ee,Nt=n=>new Uint8Array(n),Yt=n=>Uint8Array.from(n);function re(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=Nt(n),o=Nt(n),s=0;const c=()=>{r.fill(1),o.fill(0),s=0},f=(...h)=>t(o,r,...h),i=(h=Nt())=>{o=f(Yt([0]),h),r=f(),h.length!==0&&(o=f(Yt([1]),h),r=f())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const l=[];for(;h<e;){r=f();const m=r.slice();l.push(m),h+=r.length}return bt(...l)};return(h,l)=>{c(),i(h);let m;for(;!(m=l(u()));)i();return c(),m}}const Ne={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||it(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function mt(n,e,t={}){const r=(o,s,c)=>{const f=Ne[s];if(typeof f!="function")throw new Error("invalid validator function");const i=n[o];if(!(c&&i===void 0)&&!f(i,n))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+i)};for(const[o,s]of Object.entries(e))r(o,s,!1);for(const[o,s]of Object.entries(t))r(o,s,!0);return n}function Ut(n){const e=new WeakMap;return(t,...r)=>{const o=e.get(t);if(o!==void 0)return o;const s=n(t,...r);return e.set(t,s),s}}const qe=Object.freeze(Object.defineProperty({__proto__:null,aInRange:ot,abool:at,abytes:yt,bitLen:ne,bitMask:Vt,bytesToHex:ut,bytesToNumberBE:rt,bytesToNumberLE:Rt,concatBytes:bt,createHmacDrbg:re,ensureBytes:K,hexToBytes:pt,hexToNumber:Zt,inRange:Bt,isBytes:it,memoized:Ut,numberToBytesBE:lt,numberToBytesLE:Mt,numberToHexUnpadded:wt,validateObject:mt},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const z=BigInt(0),_=BigInt(1),nt=BigInt(2),Oe=BigInt(3),_t=BigInt(4),Ft=BigInt(5),Kt=BigInt(8);function V(n,e){const t=n%e;return t>=z?t:e+t}function Le(n,e,t){if(e<z)throw new Error("invalid exponent, negatives unsupported");if(t<=z)throw new Error("invalid modulus");if(t===_)return z;let r=_;for(;e>z;)e&_&&(r=r*n%t),n=n*n%t,e>>=_;return r}function Y(n,e,t){let r=n;for(;e-- >z;)r*=r,r%=t;return r}function Tt(n,e){if(n===z)throw new Error("invert: expected non-zero number");if(e<=z)throw new Error("invert: expected positive modulus, got "+e);let t=V(n,e),r=e,o=z,s=_;for(;t!==z;){const f=r/t,i=r%t,u=o-s*f;r=t,t=i,o=s,s=u}if(r!==_)throw new Error("invert: does not exist");return V(o,e)}function He(n){const e=(n-_)/nt;let t,r,o;for(t=n-_,r=0;t%nt===z;t/=nt,r++);for(o=nt;o<n&&Le(o,e,n)!==n-_;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const c=(n+_)/_t;return function(i,u){const y=i.pow(u,c);if(!i.eql(i.sqr(y),u))throw new Error("Cannot find square root");return y}}const s=(t+_)/nt;return function(f,i){if(f.pow(i,e)===f.neg(f.ONE))throw new Error("Cannot find square root");let u=r,y=f.pow(f.mul(f.ONE,o),t),h=f.pow(i,s),l=f.pow(i,t);for(;!f.eql(l,f.ONE);){if(f.eql(l,f.ZERO))return f.ZERO;let m=1;for(let b=f.sqr(l);m<u&&!f.eql(b,f.ONE);m++)b=f.sqr(b);const N=f.pow(y,_<<BigInt(u-m-1));y=f.sqr(N),h=f.mul(h,N),l=f.mul(l,y),u=m}return h}}function Ue(n){if(n%_t===Oe){const e=(n+_)/_t;return function(r,o){const s=r.pow(o,e);if(!r.eql(r.sqr(s),o))throw new Error("Cannot find square root");return s}}if(n%Kt===Ft){const e=(n-Ft)/Kt;return function(r,o){const s=r.mul(o,nt),c=r.pow(s,e),f=r.mul(o,c),i=r.mul(r.mul(f,nt),c),u=r.mul(f,r.sub(i,r.ONE));if(!r.eql(r.sqr(u),o))throw new Error("Cannot find square root");return u}}return He(n)}const _e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Te(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=_e.reduce((r,o)=>(r[o]="function",r),e);return mt(n,t)}function ke(n,e,t){if(t<z)throw new Error("invalid exponent, negatives unsupported");if(t===z)return n.ONE;if(t===_)return e;let r=n.ONE,o=e;for(;t>z;)t&_&&(r=n.mul(r,o)),o=n.sqr(o),t>>=_;return r}function ze(n,e){const t=new Array(e.length),r=e.reduce((s,c,f)=>n.is0(c)?s:(t[f]=s,n.mul(s,c)),n.ONE),o=n.inv(r);return e.reduceRight((s,c,f)=>n.is0(c)?s:(t[f]=n.mul(s,t[f]),n.mul(s,c)),o),t}function oe(n,e){const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function ie(n,e,t=!1,r={}){if(n<=z)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:o,nByteLength:s}=oe(n,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:n,isLE:t,BITS:o,BYTES:s,MASK:Vt(o),ZERO:z,ONE:_,create:i=>V(i,n),isValid:i=>{if(typeof i!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof i);return z<=i&&i<n},is0:i=>i===z,isOdd:i=>(i&_)===_,neg:i=>V(-i,n),eql:(i,u)=>i===u,sqr:i=>V(i*i,n),add:(i,u)=>V(i+u,n),sub:(i,u)=>V(i-u,n),mul:(i,u)=>V(i*u,n),pow:(i,u)=>ke(f,i,u),div:(i,u)=>V(i*Tt(u,n),n),sqrN:i=>i*i,addN:(i,u)=>i+u,subN:(i,u)=>i-u,mulN:(i,u)=>i*u,inv:i=>Tt(i,n),sqrt:r.sqrt||(i=>(c||(c=Ue(n)),c(f,i))),invertBatch:i=>ze(f,i),cmov:(i,u,y)=>y?u:i,toBytes:i=>t?Mt(i,s):lt(i,s),fromBytes:i=>{if(i.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+i.length);return t?Rt(i):rt(i)}});return Object.freeze(f)}function se(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function ce(n){const e=se(n);return e+Math.ceil(e/2)}function Ce(n,e,t=!1){const r=n.length,o=se(e),s=ce(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const c=t?Rt(n):rt(n),f=V(c,e-_)+_;return t?Mt(f,o):lt(f,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pt=BigInt(0),xt=BigInt(1);function qt(n,e){const t=e.negate();return n?t:e}function fe(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function Ot(n,e){fe(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1);return{windows:t,windowSize:r}}function Ze(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function Re(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const Lt=new WeakMap,ae=new WeakMap;function Ht(n){return ae.get(n)||1}function Me(n,e){return{constTimeNegate:qt,hasPrecomputes(t){return Ht(t)!==1},unsafeLadder(t,r,o=n.ZERO){let s=t;for(;r>Pt;)r&xt&&(o=o.add(s)),s=s.double(),r>>=xt;return o},precomputeWindow(t,r){const{windows:o,windowSize:s}=Ot(r,e),c=[];let f=t,i=f;for(let u=0;u<o;u++){i=f,c.push(i);for(let y=1;y<s;y++)i=i.add(f),c.push(i);f=i.double()}return c},wNAF(t,r,o){const{windows:s,windowSize:c}=Ot(t,e);let f=n.ZERO,i=n.BASE;const u=BigInt(2**t-1),y=2**t,h=BigInt(t);for(let l=0;l<s;l++){const m=l*c;let N=Number(o&u);o>>=h,N>c&&(N-=y,o+=xt);const b=m,a=m+Math.abs(N)-1,g=l%2!==0,x=N<0;N===0?i=i.add(qt(g,r[b])):f=f.add(qt(x,r[a]))}return{p:f,f:i}},wNAFUnsafe(t,r,o,s=n.ZERO){const{windows:c,windowSize:f}=Ot(t,e),i=BigInt(2**t-1),u=2**t,y=BigInt(t);for(let h=0;h<c;h++){const l=h*f;if(o===Pt)break;let m=Number(o&i);if(o>>=y,m>f&&(m-=u,o+=xt),m===0)continue;let N=r[l+Math.abs(m)-1];m<0&&(N=N.negate()),s=s.add(N)}return s},getPrecomputes(t,r,o){let s=Lt.get(r);return s||(s=this.precomputeWindow(r,t),t!==1&&Lt.set(r,o(s))),s},wNAFCached(t,r,o){const s=Ht(t);return this.wNAF(s,this.getPrecomputes(s,t,o),r)},wNAFCachedUnsafe(t,r,o,s){const c=Ht(t);return c===1?this.unsafeLadder(t,r,s):this.wNAFUnsafe(c,this.getPrecomputes(c,t,o),r,s)},setWindowSize(t,r){fe(r,e),ae.set(t,r),Lt.delete(t)}}}function Ve(n,e,t,r){if(Ze(t,n),Re(r,e),t.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=n.ZERO,s=ne(BigInt(t.length)),c=s>12?s-3:s>4?s-2:s?2:1,f=(1<<c)-1,i=new Array(f+1).fill(o),u=Math.floor((e.BITS-1)/c)*c;let y=o;for(let h=u;h>=0;h-=c){i.fill(o);for(let m=0;m<r.length;m++){const N=r[m],b=Number(N>>BigInt(h)&BigInt(f));i[b]=i[b].add(t[m])}let l=o;for(let m=i.length-1,N=o;m>0;m--)N=N.add(i[m]),l=l.add(N);if(y=y.add(l),h!==0)for(let m=0;m<c;m++)y=y.double()}return y}function ue(n){return Te(n.Fp),mt(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...oe(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Gt(n){n.lowS!==void 0&&at("lowS",n.lowS),n.prehash!==void 0&&at("prehash",n.prehash)}function je(n){const e=ue(n);mt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:o}=e;if(t){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Ye,hexToBytes:Fe}=qe;class Ke extends Error{constructor(e=""){super(e)}}const $={Err:Ke,_tlv:{encode:(n,e)=>{const{Err:t}=$;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,o=wt(r);if(o.length/2&128)throw new t("tlv.encode: long form length too big");const s=r>127?wt(o.length/2|128):"";return wt(n)+s+o+e},decode(n,e){const{Err:t}=$;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const o=e[r++],s=!!(o&128);let c=0;if(!s)c=o;else{const i=o&127;if(!i)throw new t("tlv.decode(long): indefinite length not supported");if(i>4)throw new t("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+i);if(u.length!==i)throw new t("tlv.decode: length bytes not complete");if(u[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const y of u)c=c<<8|y;if(r+=i,c<128)throw new t("tlv.decode(long): not minimal encoding")}const f=e.subarray(r,r+c);if(f.length!==c)throw new t("tlv.decode: wrong value length");return{v:f,l:e.subarray(r+c)}}},_int:{encode(n){const{Err:e}=$;if(n<W)throw new e("integer: negative integers are not allowed");let t=wt(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=$;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Ye(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=$,o=typeof n=="string"?Fe(n):n;yt(o);const{v:s,l:c}=r.decode(48,o);if(c.length)throw new e("invalid signature: left bytes after parsing");const{v:f,l:i}=r.decode(2,s),{v:u,l:y}=r.decode(2,i);if(y.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(f),s:t.decode(u)}},hexFromSig(n){const{_tlv:e,_int:t}=$,r=e.encode(2,t.encode(n.r)),o=e.encode(2,t.encode(n.s)),s=r+o;return e.encode(48,s)}},W=BigInt(0),k=BigInt(1);BigInt(2);const Dt=BigInt(3);BigInt(4);function Pe(n){const e=je(n),{Fp:t}=e,r=ie(e.n,e.nBitLength),o=e.toBytes||((b,a,g)=>{const x=a.toAffine();return bt(Uint8Array.from([4]),t.toBytes(x.x),t.toBytes(x.y))}),s=e.fromBytes||(b=>{const a=b.subarray(1),g=t.fromBytes(a.subarray(0,t.BYTES)),x=t.fromBytes(a.subarray(t.BYTES,2*t.BYTES));return{x:g,y:x}});function c(b){const{a,b:g}=e,x=t.sqr(b),E=t.mul(x,b);return t.add(t.add(E,t.mul(b,a)),g)}if(!t.eql(t.sqr(e.Gy),c(e.Gx)))throw new Error("bad generator point: equation left != right");function f(b){return Bt(b,k,e.n)}function i(b){const{allowedPrivateKeyLengths:a,nByteLength:g,wrapPrivateKey:x,n:E}=e;if(a&&typeof b!="bigint"){if(it(b)&&(b=ut(b)),typeof b!="string"||!a.includes(b.length))throw new Error("invalid private key");b=b.padStart(g*2,"0")}let q;try{q=typeof b=="bigint"?b:rt(K("private key",b,g))}catch{throw new Error("invalid private key, expected hex or "+g+" bytes, got "+typeof b)}return x&&(q=V(q,E)),ot("private key",q,k,E),q}function u(b){if(!(b instanceof l))throw new Error("ProjectivePoint expected")}const y=Ut((b,a)=>{const{px:g,py:x,pz:E}=b;if(t.eql(E,t.ONE))return{x:g,y:x};const q=b.is0();a==null&&(a=q?t.ONE:t.inv(E));const L=t.mul(g,a),I=t.mul(x,a),B=t.mul(E,a);if(q)return{x:t.ZERO,y:t.ZERO};if(!t.eql(B,t.ONE))throw new Error("invZ was invalid");return{x:L,y:I}}),h=Ut(b=>{if(b.is0()){if(e.allowInfinityPoint&&!t.is0(b.py))return;throw new Error("bad point: ZERO")}const{x:a,y:g}=b.toAffine();if(!t.isValid(a)||!t.isValid(g))throw new Error("bad point: x or y not FE");const x=t.sqr(g),E=c(a);if(!t.eql(x,E))throw new Error("bad point: equation left != right");if(!b.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class l{constructor(a,g,x){if(this.px=a,this.py=g,this.pz=x,a==null||!t.isValid(a))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(x==null||!t.isValid(x))throw new Error("z required");Object.freeze(this)}static fromAffine(a){const{x:g,y:x}=a||{};if(!a||!t.isValid(g)||!t.isValid(x))throw new Error("invalid affine point");if(a instanceof l)throw new Error("projective point not allowed");const E=q=>t.eql(q,t.ZERO);return E(g)&&E(x)?l.ZERO:new l(g,x,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(a){const g=t.invertBatch(a.map(x=>x.pz));return a.map((x,E)=>x.toAffine(g[E])).map(l.fromAffine)}static fromHex(a){const g=l.fromAffine(s(K("pointHex",a)));return g.assertValidity(),g}static fromPrivateKey(a){return l.BASE.multiply(i(a))}static msm(a,g){return Ve(l,r,a,g)}_setWindowSize(a){N.setWindowSize(this,a)}assertValidity(){h(this)}hasEvenY(){const{y:a}=this.toAffine();if(t.isOdd)return!t.isOdd(a);throw new Error("Field doesn't support isOdd")}equals(a){u(a);const{px:g,py:x,pz:E}=this,{px:q,py:L,pz:I}=a,B=t.eql(t.mul(g,I),t.mul(q,E)),A=t.eql(t.mul(x,I),t.mul(L,E));return B&&A}negate(){return new l(this.px,t.neg(this.py),this.pz)}double(){const{a,b:g}=e,x=t.mul(g,Dt),{px:E,py:q,pz:L}=this;let I=t.ZERO,B=t.ZERO,A=t.ZERO,v=t.mul(E,E),C=t.mul(q,q),U=t.mul(L,L),H=t.mul(E,q);return H=t.add(H,H),A=t.mul(E,L),A=t.add(A,A),I=t.mul(a,A),B=t.mul(x,U),B=t.add(I,B),I=t.sub(C,B),B=t.add(C,B),B=t.mul(I,B),I=t.mul(H,I),A=t.mul(x,A),U=t.mul(a,U),H=t.sub(v,U),H=t.mul(a,H),H=t.add(H,A),A=t.add(v,v),v=t.add(A,v),v=t.add(v,U),v=t.mul(v,H),B=t.add(B,v),U=t.mul(q,L),U=t.add(U,U),v=t.mul(U,H),I=t.sub(I,v),A=t.mul(U,C),A=t.add(A,A),A=t.add(A,A),new l(I,B,A)}add(a){u(a);const{px:g,py:x,pz:E}=this,{px:q,py:L,pz:I}=a;let B=t.ZERO,A=t.ZERO,v=t.ZERO;const C=e.a,U=t.mul(e.b,Dt);let H=t.mul(g,q),j=t.mul(x,L),d=t.mul(E,I),w=t.add(g,x),p=t.add(q,L);w=t.mul(w,p),p=t.add(H,j),w=t.sub(w,p),p=t.add(g,E);let S=t.add(q,I);return p=t.mul(p,S),S=t.add(H,d),p=t.sub(p,S),S=t.add(x,E),B=t.add(L,I),S=t.mul(S,B),B=t.add(j,d),S=t.sub(S,B),v=t.mul(C,p),B=t.mul(U,d),v=t.add(B,v),B=t.sub(j,v),v=t.add(j,v),A=t.mul(B,v),j=t.add(H,H),j=t.add(j,H),d=t.mul(C,d),p=t.mul(U,p),j=t.add(j,d),d=t.sub(H,d),d=t.mul(C,d),p=t.add(p,d),H=t.mul(j,p),A=t.add(A,H),H=t.mul(S,p),B=t.mul(w,B),B=t.sub(B,H),H=t.mul(w,j),v=t.mul(S,v),v=t.add(v,H),new l(B,A,v)}subtract(a){return this.add(a.negate())}is0(){return this.equals(l.ZERO)}wNAF(a){return N.wNAFCached(this,a,l.normalizeZ)}multiplyUnsafe(a){const{endo:g,n:x}=e;ot("scalar",a,W,x);const E=l.ZERO;if(a===W)return E;if(this.is0()||a===k)return this;if(!g||N.hasPrecomputes(this))return N.wNAFCachedUnsafe(this,a,l.normalizeZ);let{k1neg:q,k1:L,k2neg:I,k2:B}=g.splitScalar(a),A=E,v=E,C=this;for(;L>W||B>W;)L&k&&(A=A.add(C)),B&k&&(v=v.add(C)),C=C.double(),L>>=k,B>>=k;return q&&(A=A.negate()),I&&(v=v.negate()),v=new l(t.mul(v.px,g.beta),v.py,v.pz),A.add(v)}multiply(a){const{endo:g,n:x}=e;ot("scalar",a,k,x);let E,q;if(g){const{k1neg:L,k1:I,k2neg:B,k2:A}=g.splitScalar(a);let{p:v,f:C}=this.wNAF(I),{p:U,f:H}=this.wNAF(A);v=N.constTimeNegate(L,v),U=N.constTimeNegate(B,U),U=new l(t.mul(U.px,g.beta),U.py,U.pz),E=v.add(U),q=C.add(H)}else{const{p:L,f:I}=this.wNAF(a);E=L,q=I}return l.normalizeZ([E,q])[0]}multiplyAndAddUnsafe(a,g,x){const E=l.BASE,q=(I,B)=>B===W||B===k||!I.equals(E)?I.multiplyUnsafe(B):I.multiply(B),L=q(this,g).add(q(a,x));return L.is0()?void 0:L}toAffine(a){return y(this,a)}isTorsionFree(){const{h:a,isTorsionFree:g}=e;if(a===k)return!0;if(g)return g(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:a,clearCofactor:g}=e;return a===k?this:g?g(l,this):this.multiplyUnsafe(e.h)}toRawBytes(a=!0){return at("isCompressed",a),this.assertValidity(),o(l,this,a)}toHex(a=!0){return at("isCompressed",a),ut(this.toRawBytes(a))}}l.BASE=new l(e.Gx,e.Gy,t.ONE),l.ZERO=new l(t.ZERO,t.ONE,t.ZERO);const m=e.nBitLength,N=Me(l,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:i,weierstrassEquation:c,isWithinCurveOrder:f}}function Ge(n){const e=ue(n);return mt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function De(n){const e=Ge(n),{Fp:t,n:r}=e,o=t.BYTES+1,s=2*t.BYTES+1;function c(d){return V(d,r)}function f(d){return Tt(d,r)}const{ProjectivePoint:i,normPrivateKeyToScalar:u,weierstrassEquation:y,isWithinCurveOrder:h}=Pe({...e,toBytes(d,w,p){const S=w.toAffine(),O=t.toBytes(S.x),T=bt;return at("isCompressed",p),p?T(Uint8Array.from([w.hasEvenY()?2:3]),O):T(Uint8Array.from([4]),O,t.toBytes(S.y))},fromBytes(d){const w=d.length,p=d[0],S=d.subarray(1);if(w===o&&(p===2||p===3)){const O=rt(S);if(!Bt(O,k,t.ORDER))throw new Error("Point is not on curve");const T=y(O);let R;try{R=t.sqrt(T)}catch(F){const M=F instanceof Error?": "+F.message:"";throw new Error("Point is not on curve"+M)}const Z=(R&k)===k;return(p&1)===1!==Z&&(R=t.neg(R)),{x:O,y:R}}else if(w===s&&p===4){const O=t.fromBytes(S.subarray(0,t.BYTES)),T=t.fromBytes(S.subarray(t.BYTES,2*t.BYTES));return{x:O,y:T}}else{const O=o,T=s;throw new Error("invalid Point, expected length of "+O+", or uncompressed "+T+", got "+w)}}}),l=d=>ut(lt(d,e.nByteLength));function m(d){const w=r>>k;return d>w}function N(d){return m(d)?c(-d):d}const b=(d,w,p)=>rt(d.slice(w,p));class a{constructor(w,p,S){this.r=w,this.s=p,this.recovery=S,this.assertValidity()}static fromCompact(w){const p=e.nByteLength;return w=K("compactSignature",w,p*2),new a(b(w,0,p),b(w,p,2*p))}static fromDER(w){const{r:p,s:S}=$.toSig(K("DER",w));return new a(p,S)}assertValidity(){ot("r",this.r,k,r),ot("s",this.s,k,r)}addRecoveryBit(w){return new a(this.r,this.s,w)}recoverPublicKey(w){const{r:p,s:S,recovery:O}=this,T=I(K("msgHash",w));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const R=O===2||O===3?p+e.n:p;if(R>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const Z=(O&1)===0?"02":"03",G=i.fromHex(Z+l(R)),F=f(R),M=c(-T*F),st=c(S*F),X=i.BASE.multiplyAndAddUnsafe(G,M,st);if(!X)throw new Error("point at infinify");return X.assertValidity(),X}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new a(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return pt(this.toDERHex())}toDERHex(){return $.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return pt(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const g={isValidPrivateKey(d){try{return u(d),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const d=ce(e.n);return Ce(e.randomBytes(d),e.n)},precompute(d=8,w=i.BASE){return w._setWindowSize(d),w.multiply(BigInt(3)),w}};function x(d,w=!0){return i.fromPrivateKey(d).toRawBytes(w)}function E(d){const w=it(d),p=typeof d=="string",S=(w||p)&&d.length;return w?S===o||S===s:p?S===2*o||S===2*s:d instanceof i}function q(d,w,p=!0){if(E(d))throw new Error("first arg must be private key");if(!E(w))throw new Error("second arg must be public key");return i.fromHex(w).multiply(u(d)).toRawBytes(p)}const L=e.bits2int||function(d){if(d.length>8192)throw new Error("input is too large");const w=rt(d),p=d.length*8-e.nBitLength;return p>0?w>>BigInt(p):w},I=e.bits2int_modN||function(d){return c(L(d))},B=Vt(e.nBitLength);function A(d){return ot("num < 2^"+e.nBitLength,d,W,B),lt(d,e.nByteLength)}function v(d,w,p=C){if(["recovered","canonical"].some(tt=>tt in p))throw new Error("sign() legacy options not supported");const{hash:S,randomBytes:O}=e;let{lowS:T,prehash:R,extraEntropy:Z}=p;T==null&&(T=!0),d=K("msgHash",d),Gt(p),R&&(d=K("prehashed msgHash",S(d)));const G=I(d),F=u(w),M=[A(F),A(G)];if(Z!=null&&Z!==!1){const tt=Z===!0?O(t.BYTES):Z;M.push(K("extraEntropy",tt))}const st=bt(...M),X=G;function vt(tt){const ct=L(tt);if(!h(ct))return;const St=f(ct),dt=i.BASE.multiply(ct).toAffine(),et=c(dt.x);if(et===W)return;const ht=c(St*c(X+et*F));if(ht===W)return;let gt=(dt.x===et?0:2)|Number(dt.y&k),ft=ht;return T&&m(ht)&&(ft=N(ht),gt^=1),new a(et,ft,gt)}return{seed:st,k2sig:vt}}const C={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function H(d,w,p=C){const{seed:S,k2sig:O}=v(d,w,p),T=e;return re(T.hash.outputLen,T.nByteLength,T.hmac)(S,O)}i.BASE._setWindowSize(8);function j(d,w,p,S=U){var gt;const O=d;w=K("msgHash",w),p=K("publicKey",p);const{lowS:T,prehash:R,format:Z}=S;if(Gt(S),"strict"in S)throw new Error("options.strict was renamed to lowS");if(Z!==void 0&&Z!=="compact"&&Z!=="der")throw new Error("format must be compact or der");const G=typeof O=="string"||it(O),F=!G&&!Z&&typeof O=="object"&&O!==null&&typeof O.r=="bigint"&&typeof O.s=="bigint";if(!G&&!F)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let M,st;try{if(F&&(M=new a(O.r,O.s)),G){try{Z!=="compact"&&(M=a.fromDER(O))}catch(ft){if(!(ft instanceof $.Err))throw ft}!M&&Z!=="der"&&(M=a.fromCompact(O))}st=i.fromHex(p)}catch{return!1}if(!M||T&&M.hasHighS())return!1;R&&(w=e.hash(w));const{r:X,s:vt}=M,tt=I(w),ct=f(vt),St=c(tt*ct),dt=c(X*ct),et=(gt=i.BASE.multiplyAndAddUnsafe(st,St,dt))==null?void 0:gt.toAffine();return et?c(et.x)===X:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:q,sign:H,verify:j,ProjectivePoint:i,Signature:a,utils:g}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $e(n){return{hash:n,hmac:(e,...t)=>te(n,e,be(...t)),randomBytes:pe}}function We(n,e){const t=r=>De({...n,...$e(r)});return{...t(e),create:t}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const le=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),$t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Xe=BigInt(1),kt=BigInt(2),Wt=(n,e)=>(n+e/kt)/e;function Qe(n){const e=le,t=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),c=BigInt(23),f=BigInt(44),i=BigInt(88),u=n*n*n%e,y=u*u*n%e,h=Y(y,t,e)*y%e,l=Y(h,t,e)*y%e,m=Y(l,kt,e)*u%e,N=Y(m,o,e)*m%e,b=Y(N,s,e)*N%e,a=Y(b,f,e)*b%e,g=Y(a,i,e)*a%e,x=Y(g,f,e)*b%e,E=Y(x,t,e)*y%e,q=Y(E,c,e)*N%e,L=Y(q,r,e)*u%e,I=Y(L,kt,e);if(!zt.eql(zt.sqr(I),n))throw new Error("Cannot find square root");return I}const zt=ie(le,void 0,void 0,{sqrt:Qe}),Je=We({a:BigInt(0),b:BigInt(7),Fp:zt,n:$t,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=$t,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Xe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,c=BigInt("0x100000000000000000000000000000000"),f=Wt(s*n,e),i=Wt(-r*n,e);let u=V(n-f*t-i*o,e),y=V(-f*r-i*s,e);const h=u>c,l=y>c;if(h&&(u=e-u),l&&(y=e-y),u>c||y>c)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:h,k1:u,k2neg:l,k2:y}}}},Se);BigInt(0);Je.ProjectivePoint;export{Je as secp256k1};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as C}from"./core-
|
|
1
|
+
import{w as C}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const n=C`<svg fill="none" viewBox="0 0 21 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const m=o`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const L=o`<svg width="10" height="10" viewBox="0 0 10 10">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const L=o`<svg
|
|
2
2
|
width="14"
|
|
3
3
|
height="14"
|
|
4
4
|
viewBox="0 0 14 14"
|
package/dist/assets/{swapHorizontalRoundedBold-BrdyV7V9.js → swapHorizontalRoundedBold-C9M5muAI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const p=o`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as l}from"./core-
|
|
1
|
+
import{w as l}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const m=l`<svg fill="none" viewBox="0 0 14 14">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as t}from"./core-
|
|
1
|
+
import{w as t}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const a=t`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
2
2
|
<g clip-path="url(#a)">
|
|
3
3
|
<path fill="url(#b)" d="M0 0h32v32H0z"/>
|
|
4
4
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as t}from"./core-
|
|
1
|
+
import{w as t}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const h=t`<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M7 3.71875C6.0335 3.71875 5.25 2.93525 5.25 1.96875C5.25 1.00225 6.0335 0.21875 7 0.21875C7.9665 0.21875 8.75 1.00225 8.75 1.96875C8.75 2.93525 7.9665 3.71875 7 3.71875Z" fill="#949E9E"/>
|
|
3
3
|
<path d="M7 8.96875C6.0335 8.96875 5.25 8.18525 5.25 7.21875C5.25 6.25225 6.0335 5.46875 7 5.46875C7.9665 5.46875 8.75 6.25225 8.75 7.21875C8.75 8.18525 7.9665 8.96875 7 8.96875Z" fill="#949E9E"/>
|
|
4
4
|
<path d="M5.25 12.4688C5.25 13.4352 6.0335 14.2187 7 14.2187C7.9665 14.2187 8.75 13.4352 8.75 12.4688C8.75 11.5023 7.9665 10.7188 7 10.7188C6.0335 10.7188 5.25 11.5023 5.25 12.4688Z" fill="#949E9E"/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as i}from"./core-
|
|
1
|
+
import{w as i}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const a=i`<svg fill="none" viewBox="0 0 40 40">
|
|
2
2
|
<g clip-path="url(#a)">
|
|
3
3
|
<g clip-path="url(#b)">
|
|
4
4
|
<circle cx="20" cy="19.89" r="20" fill="#5A3E85" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const l=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
d="m14.36 4.74.01.42c0 4.34-3.3 9.34-9.34 9.34A9.3 9.3 0 0 1 0 13.03a6.6 6.6 0 0 0 4.86-1.36 3.29 3.29 0 0 1-3.07-2.28c.5.1 1 .07 1.48-.06A3.28 3.28 0 0 1 .64 6.11v-.04c.46.26.97.4 1.49.41A3.29 3.29 0 0 1 1.11 2.1a9.32 9.32 0 0 0 6.77 3.43 3.28 3.28 0 0 1 5.6-3 6.59 6.59 0 0 0 2.08-.8 3.3 3.3 0 0 1-1.45 1.82A6.53 6.53 0 0 0 16 3.04c-.44.66-1 1.23-1.64 1.7Z"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as h}from"./index-
|
|
1
|
+
import{m as h}from"./index-BadBPNlq.js";const p=864e5;function k(t){const e=new Date(t);return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}function b(t){return new Date(t).toISOString().slice(0,10)}const D="\0others";function U(t){return t.group!==D?t.label||t.group:t.others===void 0?"Other users":`${t.others} other ${t.others===1?"user":"users"}`}function E(t,e,u){const n=new Map;for(const s of(t==null?void 0:t.groups)??[])n.set(s.group.slice(0,10),{spent:h(s.spent),requests:s.requests});const a=[];for(let s=k(e);s<=u;s+=p){const i=b(s),o=n.get(i),l=new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"});a.push({label:l,value:(o==null?void 0:o.spent)??0,sub:`${(o==null?void 0:o.requests)??0} requests`})}return a}const q=[{id:"24h",label:"24 hours",ms:p},{id:"7d",label:"7 days",ms:7*p},{id:"30d",label:"30 days",ms:30*p},{id:"90d",label:"90 days",ms:90*p}];function O(t,e=Date.now()){const u=q.find(n=>n.id===t);return t==="24h"?e-u.ms:k(e-u.ms+p)}const d=36e5;function M(t,e=Date.now()){const u=[];if(t==="24h"){const s=Math.floor(e/d)*d+d;for(let i=s-24*d;i<s;i+=d){const o=new Date(i).toLocaleTimeString("en-US",{hour:"numeric",timeZone:"UTC"});u.push({from:i,to:Math.min(i+d,e+1),label:o})}return u}const n=t==="90d"?7*p:p,a=O(t,e);for(let s=a;s<=e;s+=n){const i=new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"});u.push({from:s,to:Math.min(s+n,e+1),label:i})}return u}function m(t,e){return e==="spend"?h(t.spent):e==="requests"?t.requests:t.inputTokens+t.outputTokens}const T="__other__";function _(t,e,u=6){const n=new Map;for(const r of t)for(const c of(r==null?void 0:r.groups)??[]){const f=n.get(c.group)??{label:U(c),total:0};f.total+=m(c,e),n.set(c.group,f)}const a=[...n.entries()].filter(([,r])=>r.total>0).sort((r,c)=>c[1].total-r[1].total),s=a.slice(0,u),i=new Set(s.map(([r])=>r)),o=a.slice(u).reduce((r,[,c])=>r+c.total,0),l=s.map(([r,c])=>({key:r,label:c.label,total:c.total}));o>0&&l.push({key:T,label:"Other",total:o});const S=t.map(r=>{const c={};for(const f of(r==null?void 0:r.groups)??[]){const g=i.has(f.group)?f.group:T;c[g]=(c[g]??0)+m(f,e)}return c});return{series:l,columns:S}}function N(t){return t==="24h"?"hour":"day"}function R(t){return/^\d{4}-\d{2}-\d{2}T\d{2}$/.test(t)?Date.parse(`${t}:00:00Z`):/^\d{4}-\d{2}-\d{2}$/.test(t)?Date.parse(`${t}T00:00:00Z`):Number.NaN}function $(t,e){const u=e.map(()=>new Map);for(const n of(t==null?void 0:t.groups)??[]){const a=R(n.group),s=e.findIndex(o=>a>=o.from&&a<o.to);if(s===-1)continue;const i=u[s];for(const o of n.splits??[]){const l=i.get(o.group);if(!l){i.set(o.group,{...o});continue}l.requests+=o.requests,l.failedRequests+=o.failedRequests,l.spent=(h(l.spent)+h(o.spent)).toFixed(6),l.inputTokens+=o.inputTokens,l.cachedInputTokens+=o.cachedInputTokens,l.outputTokens+=o.outputTokens}}return u.map(n=>({groups:[...n.values()]}))}const y=[{key:"input",label:"Input"},{key:"cached",label:"Cached input"},{key:"output",label:"Output"}];function w(t){const e={input:0,cached:0,output:0},u=t.map(n=>{const a={input:0,cached:0,output:0};for(const s of(n==null?void 0:n.groups)??[])a.cached+=s.cachedInputTokens,a.input+=Math.max(0,s.inputTokens-s.cachedInputTokens),a.output+=s.outputTokens;return e.input+=a.input,e.cached+=a.cached,e.output+=a.output,a});return{series:y.map(n=>({...n,total:e[n.key]})),columns:u}}function v(t){return t.reduce((e,u)=>e+((u==null?void 0:u.groups)??[]).reduce((n,a)=>n+a.requests,0),0)}const I=600*1e3;function x(t,e){return t.spent!==null?"spent":t.servedFree?"free":t.costPending?e-(t.finishedAt??t.startedAt)<I?"pending":"not-recorded":null}export{T as O,q as R,M as a,$ as b,v as c,N as d,E as e,x as f,U as g,O as r,_ as s,w as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{by as v,bz as g,bA as x,bB as l,bC as p}from"./index-BadBPNlq.js";var N=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:g()})}getOptimisticResult(e){return e.behavior=g(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:d,isError:c,isRefetchError:b}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:l(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:b&&!h&&!n,isRefetching:d&&!o&&!u}}};function w(e,t){return p(e,N)}export{w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as J,y as Q,A as D,z as X,D as Z,B as tt,E as F,F as et,G as at,h as U,I as nt,L as rt,J as st,K as ot,M as it,N as z,O as ct,P as W,Q as ut,R as dt,S as Y,T as I,U as lt,V as ft,X as ht,f as wt,Y as pt,c as K,q as _,u as mt,Z as yt,w as gt}from"./en_US-Y4ZOVFV4-
|
|
1
|
+
import{x as J,y as Q,A as D,z as X,D as Z,B as tt,E as F,F as et,G as at,h as U,I as nt,L as rt,J as st,K as ot,M as it,N as z,O as ct,P as W,Q as ut,R as dt,S as Y,T as I,U as lt,V as ft,X as ht,f as wt,Y as pt,c as K,q as _,u as mt,Z as yt,w as gt}from"./en_US-Y4ZOVFV4-D2zZwqC_.js";import{bx as Ct,c1 as At,j as R,ag as B,r as b,c2 as Et,aN as Rt}from"./index-BadBPNlq.js";function xt({chain:t,currentChainId:e}){if(!t)throw new J;if(e!==t.id)throw new Q({chain:t,currentChainId:e})}const G=new rt(128);async function St(t,e){var S,d,p,q,L;const{account:a=t.account,assertChainId:s=!0,chain:r=t.chain,accessList:n,authorizationList:o,blobs:c,data:l,dataSuffix:f=typeof t.dataSuffix=="string"?t.dataSuffix:(S=t.dataSuffix)==null?void 0:S.value,gas:u,gasPrice:m,maxFeePerBlobGas:h,maxFeePerGas:y,maxPriorityFeePerGas:C,nonce:N,type:w,value:g,...x}=e;if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransaction"});const i=a?W(a):null;try{X(e);const A=await(async()=>{if(e.to)return e.to;if(e.to!==null&&o&&o.length>0)return await Z({authorization:o[0]}).catch(()=>{throw new tt("`to` is required. Could not infer from `authorizationList`.")})})();if((i==null?void 0:i.type)==="json-rpc"||i===null){let T;r!==null&&(T=await F(t,et,"getChainId")({}),s&&xt({currentChainId:T,chain:r}));const P=(q=(p=(d=t.chain)==null?void 0:d.formatters)==null?void 0:p.transactionRequest)==null?void 0:q.format,k=(P||at)({...nt(x,{format:P}),accessList:n,account:i,authorizationList:o,blobs:c,chainId:T,data:f?U([l??"0x",f]):l,gas:u,gasPrice:m,maxFeePerBlobGas:h,maxFeePerGas:y,maxPriorityFeePerGas:C,nonce:N,to:A,type:w,value:g},"sendTransaction"),$=G.get(t.uid),V=$?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:V,params:[k]},{retryCount:0})}catch(H){if($===!1)throw H;const E=H;if(E.name==="InvalidInputRpcError"||E.name==="InvalidParamsRpcError"||E.name==="MethodNotFoundRpcError"||E.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[k]},{retryCount:0}).then(v=>(G.set(t.uid,!0),v)).catch(v=>{const M=v;throw M.name==="MethodNotFoundRpcError"||M.name==="MethodNotSupportedRpcError"?(G.set(t.uid,!1),E):M});throw E}}if((i==null?void 0:i.type)==="local"){const T=await F(t,st,"prepareTransactionRequest")({account:i,accessList:n,authorizationList:o,blobs:c,chain:r,data:f?U([l??"0x",f]):l,gas:u,gasPrice:m,maxFeePerBlobGas:h,maxFeePerGas:y,maxPriorityFeePerGas:C,nonce:N,nonceManager:i.nonceManager,parameters:[...ot,"sidecars"],type:w,value:g,...x,to:A}),P=(L=r==null?void 0:r.serializers)==null?void 0:L.transaction,j=await i.signTransaction(T,{serializer:P});return await F(t,it,"sendRawTransaction")({serializedTransaction:j})}throw(i==null?void 0:i.type)==="smart"?new z({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new z({docsPath:"/docs/actions/wallet/sendTransaction",type:i==null?void 0:i.type})}catch(A){throw A instanceof z?A:ct(A,{...e,account:i,chain:e.chain||void 0})}}async function O(t,e){return O.internal(t,St,"sendTransaction",e)}(function(t){async function e(a,s,r,n){const{abi:o,account:c=a.account,address:l,args:f,functionName:u,...m}=n;if(typeof c>"u")throw new D({docsPath:"/docs/contract/writeContract"});const h=c?W(c):null,y=ut({abi:o,args:f,functionName:u});try{return await F(a,s,r)({data:y,to:l,account:h,...m})}catch(C){throw dt(C,{abi:o,address:l,args:f,docsPath:"/docs/contract/writeContract",functionName:u,sender:h==null?void 0:h.address})}}t.internal=e})(O||(O={}));async function Ft(t,e){const{abi:a,chainId:s,connector:r,...n}=e;let o;e.account?o=e.account:o=(await Y(t,{assertChainId:!1,chainId:s,connector:r})).account;const c=t.getClient({chainId:s}),l=I(c,lt,"simulateContract"),{result:f,request:u}=await l({...n,abi:a,account:o});return{chainId:c.chain.id,result:f,request:{...u,chainId:s}}}async function Tt(t,e){const{chainId:a,timeout:s=0,...r}=e,n=t.getClient({chainId:a}),c=await I(n,ft,"waitForTransactionReceipt")({...r,timeout:s});if(c.status==="reverted"){const l=I(n,ht,"getTransaction"),{from:f,...u}=await l({hash:c.transactionHash}),h=await I(n,wt,"call")({...u,account:f,data:u.input,gasPrice:u.type!=="eip1559"?u.gasPrice:void 0,maxFeePerGas:u.type==="eip1559"?u.maxFeePerGas:void 0,maxPriorityFeePerGas:u.type==="eip1559"?u.maxPriorityFeePerGas:void 0}),y=h!=null&&h.data?pt(`0x${h.data.substring(138)}`):"unknown reason";throw new Error(y)}return{...c,chainId:n.chain.id}}async function bt(t,e){const{account:a,chainId:s,connector:r,...n}=e;let o;return typeof a=="object"&&(a==null?void 0:a.type)==="local"?o=t.getClient({chainId:s}):o=await Y(t,{account:a??void 0,assertChainId:!1,chainId:s,connector:r}),await I(o,O,"writeContract")({...n,...a?{account:a}:{},chain:s?{id:s}:null})}function It(t){return{mutationFn(e){return bt(t,e)},mutationKey:["writeContract"]}}function Ot(t={}){const{mutation:e}=t,a=K(t),s=It(a),{mutate:r,mutateAsync:n,...o}=Ct({...e,...s});return{...o,writeContract:r,writeContractAsync:n}}const _t=_(["function getOperator(address buyer) view returns (address)","function getOperatorNonce(address buyer) view returns (uint256)","function setOperator(address buyer, address operator, uint256 nonce, bytes buyerSig)","function transferOperator(address buyer, address newOperator)","function withdraw(address buyer, uint256 amount)","error NotAuthorized()","error InvalidAmount()","error InvalidAddress()","error InsufficientBalance()","error InvalidSignature()","error InvalidNonce()","error OperatorAlreadySet()"]),qt=_(["function claimBuyerReward(address buyer, uint256 epoch)","error NotRewardRecipient()","error RewardRecipientUnavailable()"]),vt=_(["function channels(bytes32 channelId) view returns (address buyer, address seller, uint128 deposit, uint128 settled, bytes32 metadataHash, uint256 deadline, uint256 settledAt, uint256 closeRequestedAt, uint8 status)","function requestClose(bytes32 channelId)","function withdraw(bytes32 channelId)","error ChannelNotActive()","error NotAuthorized()","error CloseAlreadyRequested()","error CloseNotReady()"]),Mt=_(["function claimBuyerEmissions(address buyer, uint256[] epochs)","error NotAuthorized()","error EpochNotFinalized()"]);function zt({chain:t,runner:e,done:a="Confirmed on chain."}){const s=e.lastHash?At(t,e.lastHash):null,r=s&&R.jsx("a",{className:"gc-link",href:s,target:"_blank",rel:"noopener noreferrer",children:"View transaction"});return R.jsxs(R.Fragment,{children:[e.status&&R.jsxs(B,{tone:"info",children:[e.status," ",e.running&&e.lastHash&&r]}),e.error&&R.jsxs(B,{tone:"danger",children:[e.error," ",!e.running&&r]}),!e.running&&!e.error&&e.confirmed&&R.jsxs(B,{tone:"success",children:[a," ",r]})]})}function Bt(t){const e=K(),{chainId:a}=mt(),{switchChainAsync:s}=yt(),[r,n]=b.useState(null),[o,c]=b.useState(null),[l,f]=b.useState(null),[u,m]=b.useState(null),[h,y]=b.useState(!1);async function C(N,w={}){var x,i,S;let g=null;y(!0),c(null),m(null),f(null);try{a!==t&&(n("Switch network in your wallet…"),await s({chainId:t}));for(const d of N){d.check&&(n(`${d.label}: checking…`),await d.check()),n(`${d.label}: confirm in your wallet…`);const p=await d.send();if(g=p,f(p),n(`${d.label}: waiting for confirmation…`),(await Tt(e,{hash:p,chainId:t})).status!=="success")throw new Error(`${d.label} reverted on chain.`)}return n(null),m(g),g}catch(d){n(null);const p=Et(d);return p?(c(p.message),p.refresh&&((x=w.onStale)==null||x.call(w))):d instanceof Rt?(c(d.message),d.refresh&&((i=w.onStale)==null||i.call(w))):(c(gt(d)),g&&((S=w.onStale)==null||S.call(w))),null}finally{y(!1)}}return{run:C,running:h,status:r,setStatus:n,error:o,lastHash:l,confirmed:u,wrongChain:a!==void 0&&a!==t,setError:c}}export{vt as C,_t as D,Mt as L,zt as T,qt as U,Ot as a,Ft as s,Bt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as l}from"./core-
|
|
1
|
+
import{w as l}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const p=l`<svg fill="none" viewBox="0 0 28 28">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as l}from"./core-
|
|
1
|
+
import{w as l}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const c=l`<svg fill="none" viewBox="0 0 14 14">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ve,s as fe,b as ge,p as be,M as g,S as se,R as l,i as v,r as P,c as f,d as a,A as K,e as ce,f as le,C as m,g as Y,h as ye,j as S,E as ie,O as E,k as q,l as oe,m as T,n as H,T as xe,o as Ce,q as ke,t as Se}from"./core-
|
|
1
|
+
import{a as ve,s as fe,b as ge,p as be,M as g,S as se,R as l,i as v,r as P,c as f,d as a,A as K,e as ce,f as le,C as m,g as Y,h as ye,j as S,E as ie,O as E,k as q,l as oe,m as T,n as H,T as xe,o as Ce,q as ke,t as Se}from"./core-CH8pl6He.js";import{c as u,n as w,r as d,o as F,U as We}from"./index-k_E0JTj8.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const p=be({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),Re={state:p,subscribe(r){return ge(p,()=>r(p))},subscribeKey(r,e){return fe(p,r,e)},showTooltip({message:r,triggerRect:e,variant:t}){p.open=!0,p.message=r,p.triggerRect=e,p.variant=t},hide(){p.open=!1,p.message="",p.triggerRect={width:0,height:0,top:0,left:0}}},O=ve(Re),de={isUnsupportedChainView(){return l.state.view==="UnsupportedChain"||l.state.view==="SwitchNetwork"&&l.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){g.shake();return}if(await se.isSIWXCloseDisabled()){g.shake();return}g.close()}},$e=v`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const m=o`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as a}from"./core-
|
|
1
|
+
import{w as a}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const c=a`
|
|
2
2
|
<svg fill="none" viewBox="0 0 48 44">
|
|
3
3
|
<path
|
|
4
4
|
style="fill: var(--wui-color-bg-300);"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as l}from"./core-
|
|
1
|
+
import{w as l}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const r=l`<svg fill="none" viewBox="0 0 96 67">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
d="M25.32 18.8a32.56 32.56 0 0 1 45.36 0l1.5 1.47c.63.62.63 1.61 0 2.22l-5.15 5.05c-.31.3-.82.3-1.14 0l-2.07-2.03a22.71 22.71 0 0 0-31.64 0l-2.22 2.18c-.31.3-.82.3-1.14 0l-5.15-5.05a1.55 1.55 0 0 1 0-2.22l1.65-1.62Zm56.02 10.44 4.59 4.5c.63.6.63 1.6 0 2.21l-20.7 20.26c-.62.61-1.63.61-2.26 0L48.28 41.83a.4.4 0 0 0-.56 0L33.03 56.21c-.63.61-1.64.61-2.27 0L10.07 35.95a1.55 1.55 0 0 1 0-2.22l4.59-4.5a1.63 1.63 0 0 1 2.27 0L31.6 43.63a.4.4 0 0 0 .57 0l14.69-14.38a1.63 1.63 0 0 1 2.26 0l14.69 14.38a.4.4 0 0 0 .57 0l14.68-14.38a1.63 1.63 0 0 1 2.27 0Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as r}from"./core-
|
|
1
|
+
import{w as r}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const n=r`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
d="M11 6.67a1 1 0 1 0-2 0v2.66a1 1 0 0 0 2 0V6.67ZM10 14.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as l}from"./core-
|
|
1
|
+
import{w as l}from"./core-CH8pl6He.js";import"./index-BadBPNlq.js";import"./index.es-CQ9CIS6P.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-D2zZwqC_.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const r=l`<svg fill="none" viewBox="0 0 41 40">
|
|
2
2
|
<g clip-path="url(#a)">
|
|
3
3
|
<path fill="#000" d="M.8 0h40v40H.8z" />
|
|
4
4
|
<path
|
package/dist/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<meta name="referrer" content="no-referrer" />
|
|
8
8
|
<title>Antseed Console</title>
|
|
9
9
|
<link rel="icon" type="image/svg+xml" href="/console/assets/antseed-mark-3TDLhfuw.svg" />
|
|
10
|
-
<script type="module" crossorigin src="/console/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/console/assets/index-BadBPNlq.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/console/assets/index-D8vXwUTI.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bc as A,r as m,j as e,bd as F,X as B,be as V,O as w,bf as $,bg as U,bh as R,bi as O,L as _,E as f,I as k,P as z,T as D,y as M,l as K,Q as Y,bj as q,M as b,h as Q,bk as v,bl as S,bm as I,bn as G,aL as C,v as u,W as H,B as W,av as X,w as L,k as J}from"./index-BG30WuBG.js";import{T as Z,a as ee}from"./Tabs-DuL015VX.js";import{m as se,f as te,M as P,S as ae,a as ne,C as ie,P as N,b as le,V as re,p as oe}from"./models-DMYWCgsM.js";import{S as T}from"./SelectField-Cog9tKMb.js";import{S as ce}from"./Switch-CGhLd0Ay.js";import{D as de}from"./DataTable-D65CSQpj.js";import"./roving-DkptacxO.js";function ue({model:s,format:i,id:o="gc-api-call",unsupported:l}){const p=A(),[g,r]=m.useState("curl");if(!i)return e.jsx("p",{className:"gc-fineprint",children:l??"The gateway does not serve this model through its API."});const a=F(p,s,i),d=a.find(c=>c.id===g)??a[0];return e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsx(Z,{id:o,label:"Request examples",value:d.id,onChange:r,className:"gc-connect-tabs",tabs:a.map(c=>({id:c.id,label:c.label}))}),e.jsx(ee,{tabsId:o,tab:d.id,children:e.jsx(B,{code:d.code,label:d.label})}),e.jsxs("p",{className:"gc-fineprint",children:["Set ",e.jsx("code",{children:V})," to one of your API keys first. ",e.jsx(w,{to:"keys",children:"API keys"})]})]})}function he(s){return s===null?"—":String(Math.round(s))}function E(s){return s===null?"—":J(s)}function pe({model:s}){return e.jsxs("div",{className:"gc-badges",children:[s.free&&e.jsx(u,{tone:"success",children:"Free"}),s.teeSellers>0&&e.jsx(u,{tone:"info",children:"TEE"})]})}function y(s){return s.displayName??L(s.peerId,8,4)}function fe(){const s=$(),i=U(s.rest),o=R(),[l,p]=m.useState({search:"",type:"",free:!1}),g=m.useMemo(()=>se(o.data),[o.data]),r=m.useMemo(()=>i?te(o.data,i):null,[o.data,i]),a=O(),d=(n,t)=>p(h=>({...h,[n]:t})),c=i===null?null:{eyebrow:"Model",title:(r==null?void 0:r.name)??i,body:o.isLoading?e.jsx(_,{rows:6}):r?e.jsx(ge,{model:r},r.id):e.jsx(f,{icon:e.jsx(k.models,{size:18}),title:"Model not found",body:`No provider on the network offers ${i} right now.`})},j=e.jsx(K,{flush:!0,children:e.jsx(Y,{query:o,rows:8,children:n=>e.jsx(de,{label:"Models",rows:ne(n,l),rowKey:t=>t.id,selectedKey:(r==null?void 0:r.id)??null,onRowClick:t=>M(S("models",t.id)),rowLabel:t=>t.name,actions:t=>[{label:"Copy model id",onSelect:()=>void a(t.id)}],initialSort:{key:"sellers",direction:"desc"},empty:e.jsx(f,{icon:e.jsx(k.models,{size:18}),title:n.length?"No models match these filters":"No models found yet",body:n.length?void 0:"The buyer is still discovering the network. Check back in a minute."}),columns:[{key:"model",header:"Model",sortValue:t=>t.name.toLowerCase(),render:t=>e.jsxs("div",{className:"gc-cell-lines",children:[e.jsx("div",{className:"gc-strong gc-ellipsis",title:t.id,children:t.name}),t.name!==t.id&&e.jsx("div",{className:"gc-muted gc-ellipsis",children:e.jsx(b,{children:t.id})}),e.jsx(pe,{model:t})]}),after:t=>e.jsx(q,{value:t.id,label:`Copy model id ${t.id}`})},{key:"type",header:"Type",secondary:!0,sortValue:t=>t.type,render:t=>e.jsx("span",{className:"gc-muted",children:P[t.type]})},{key:"sellers",header:"Providers",align:"right",sortValue:t=>t.sellers,render:t=>Q(t.sellers)},{key:"input",header:"Input $/M",align:"right",sortValue:t=>{var h;return((h=t.inputUsdPerMillion)==null?void 0:h.min)??null},render:t=>v(t.inputUsdPerMillion)},{key:"output",header:"Output $/M",align:"right",secondary:!0,sortValue:t=>{var h;return((h=t.outputUsdPerMillion)==null?void 0:h.min)??null},render:t=>v(t.outputUsdPerMillion)},{key:"context",header:"Context",align:"right",secondary:!0,optional:!0,sortValue:t=>t.contextLength,render:t=>E(t.contextLength)}]})})});return e.jsxs("div",{className:"gc-page",children:[e.jsx(z,{title:"Models",description:"Every model on the network. Open one to see its providers, copy a model id and get a ready-to-run API call."}),e.jsxs("div",{className:"gc-toolbar",children:[e.jsx(D,{size:"sm",type:"search","aria-label":"Search models",placeholder:"Search model or alias",value:l.search,onChange:n=>d("search",n.target.value)}),g.length>1&&e.jsx(T,{size:"sm","aria-label":"Filter by type",value:l.type,onChange:n=>d("type",n),options:[{value:"",label:"All types"},...g.map(n=>({value:n,label:P[n]}))]}),e.jsx(ce,{checked:l.free,onChange:n=>d("free",n),label:"Free"})]}),e.jsx(ae,{list:j,panel:c,onClose:()=>M("models"),closeLabel:"Close model"})]})}function x(s){return`${s.peerId}:${s.serviceId}`}function ge({model:s}){const[i,o]=m.useState(""),l=s.offers.find(a=>x(a)===i)??null,p=l?I(l.peerId,l.serviceId):s.id,g=G(s.type,l),r=s.offers.some(a=>a.usdPerImage!==null);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsxs("span",{className:"gc-seller__meta",children:[e.jsxs("span",{className:"gc-peer-id",children:[e.jsx(b,{title:s.id,children:s.id}),e.jsx(C,{iconOnly:!0,value:s.id,label:"Copy model id"})]}),e.jsx(u,{children:P[s.type]}),s.free&&e.jsx(u,{tone:"success",children:"Free"}),s.teeSellers>0&&e.jsx(u,{tone:"info",children:"TEE"})]}),e.jsx(H,{items:[["Context",E(s.contextLength)],["Capabilities",s.capabilities.length?e.jsx("span",{className:"gc-badges",children:s.capabilities.map(a=>e.jsx(u,{children:ie[a]},a))}):"—"],["Aliases",s.aliases.length?e.jsx(b,{children:s.aliases.join(", ")}):"—"],...r?[]:[["Input $/M",v(s.inputUsdPerMillion)],["Output $/M",v(s.outputUsdPerMillion)]]]})]}),e.jsx(N,{title:`Providers (${s.offers.length})`,children:s.offers.length===0?e.jsx("p",{className:"gc-fineprint",children:"No provider offers this model right now."}):e.jsx("ul",{className:"gc-panel-rows","aria-label":"Providers offering this model",children:s.offers.map(a=>{var j;const d=I(a.peerId,a.serviceId),c=i===x(a);return e.jsx(le,{selected:c,title:e.jsx(w,{to:S("providers",a.peerId),children:y(a)}),meta:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:oe(a)}),e.jsxs("span",{children:["Trust ",he(a.trustScore)]}),a.latencyMsP50!==null&&e.jsx("span",{children:X(a.latencyMsP50)}),a.serviceId!==s.id&&e.jsx(b,{children:a.serviceId})]}),badges:(((j=a.verificationLinks)==null?void 0:j.length)||a.tee||a.free)&&e.jsxs("div",{className:"gc-badges",children:[e.jsx(re,{links:a.verificationLinks}),a.tee&&e.jsx(u,{tone:"info",children:"TEE"}),a.free&&e.jsx(u,{tone:"success",children:"Free"})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(C,{iconOnly:!0,value:d,label:`Copy ${y(a)}'s model id (peer@model)`}),e.jsx(W,{size:"sm",variant:c?"outline":"ghost","aria-pressed":c,title:"Use this provider in the API call below",onClick:()=>o(c?"":x(a)),children:c?"Pinned":"Pin"})]})},x(a))})})}),e.jsxs(N,{title:"API call",actions:s.offers.length>0&&e.jsx(T,{size:"sm","aria-label":"Route the call",value:i,onChange:o,options:[{value:"",label:"Best provider (automatic)"},...s.offers.map(a=>({value:x(a),label:y(a)}))]}),children:[e.jsx("p",{className:"gc-fineprint",children:l?e.jsxs(e.Fragment,{children:["Pinned to ",y(l)," with ",e.jsx("code",{children:L(p,10,12)}),"."]}):e.jsxs(e.Fragment,{children:["The gateway picks the best provider for ",e.jsx("code",{children:s.id})," under your routing policy."]})}),e.jsx(ue,{id:"gc-model-call",model:p,format:g,unsupported:`${P[s.type]} models are not served through the gateway's /v1 API.`})]})]})}export{fe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aw as C,w,r as o,j as s,ax as N,I as _,ay as b,B as k}from"./index-BG30WuBG.js";function f(l,e){const c=l==null?void 0:l.find(n=>C(n.peerId,e));return(c==null?void 0:c.displayName)??w(e,8,4)}function z({value:l,onChange:e,peers:c,label:n,ordered:r,placeholder:m="Search sellers or paste a peer id"}){const[d,x]=o.useState(""),h=o.useId(),j=o.useId();function a(){const i=d.trim();if(!i)return;const t=c==null?void 0:c.find(p=>{var I;return((I=p.displayName)==null?void 0:I.toLowerCase())===i.toLowerCase()||p.peerId.toLowerCase()===i.toLowerCase()}),u=(t==null?void 0:t.peerId)??i;l.some(p=>p.toLowerCase()===u.toLowerCase())||e([...l,u]),x("")}return s.jsxs("div",{className:"gc-picker",children:[s.jsx("label",{className:"as-field__label",htmlFor:j,children:n}),l.length>0&&s.jsx("ol",{className:r?"gc-chips gc-chips--ordered":"gc-chips",children:l.map((i,t)=>s.jsxs("li",{className:"gc-chip",children:[r&&s.jsx("span",{className:"gc-chip__index",children:t+1}),s.jsx("span",{className:"gc-chip__label",title:i,children:f(c,i)}),r&&s.jsxs(s.Fragment,{children:[s.jsx(N,{label:`Move ${f(c,i)} up`,size:"sm",disabled:t===0,onClick:()=>e(b(l,t,-1)),children:s.jsx(_.up,{size:12})}),s.jsx(N,{label:`Move ${f(c,i)} down`,size:"sm",disabled:t===l.length-1,onClick:()=>e(b(l,t,1)),children:s.jsx(_.down,{size:12})})]}),s.jsx(N,{label:`Remove ${f(c,i)}`,size:"sm",onClick:()=>e(l.filter(u=>u!==i)),children:s.jsx(_.x,{size:12})})]},i))}),s.jsxs("div",{className:"gc-inline",children:[s.jsx("input",{id:j,className:"as-field__input gc-picker__input",list:h,value:d,placeholder:m,onChange:i=>x(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),a())}}),s.jsx("datalist",{id:h,children:c==null?void 0:c.map(i=>s.jsx("option",{value:i.peerId,children:i.displayName??w(i.peerId)},i.peerId))}),s.jsx(k,{variant:"outline",size:"sm",onClick:a,disabled:!d.trim(),children:"Add"})]})]})}function y({value:l,onChange:e,label:c,suggestions:n,placeholder:r}){const[m,d]=o.useState(""),x=o.useId(),h=o.useId();function j(){const a=m.trim();a&&!l.includes(a)&&e([...l,a]),d("")}return s.jsxs("div",{className:"gc-picker",children:[s.jsx("label",{className:"as-field__label",htmlFor:h,children:c}),l.length>0&&s.jsx("ul",{className:"gc-chips",children:l.map(a=>s.jsxs("li",{className:"gc-chip",children:[s.jsx("span",{className:"gc-chip__label",children:a}),s.jsx(N,{label:`Remove ${a}`,size:"sm",onClick:()=>e(l.filter(i=>i!==a)),children:s.jsx(_.x,{size:12})})]},a))}),s.jsxs("div",{className:"gc-inline",children:[s.jsx("input",{id:h,className:"as-field__input gc-picker__input",list:x,value:m,placeholder:r,onChange:a=>d(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),j())}}),s.jsx("datalist",{id:x,children:n==null?void 0:n.map(a=>s.jsx("option",{value:a},a))}),s.jsx(k,{variant:"outline",size:"sm",onClick:j,disabled:!m.trim(),children:"Add"})]})]})}export{y as C,z as P,f as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bW as _e,aw as pe,b2 as Ve,u as X,a as fe,F as Ke,G as Ge,n as we,i as ye,r as p,R as Qe,c as be,e as Ye,bX as He,bw as Je,Z as q,bY as We,bZ as Xe,f as L,aD as Ze,j as s,C as Z,ag as Q,o as ee,B as x,L as ve,A as es,br as ss,t as xe,q as ke,l as je,Q as Pe,E as W,I as U,D as ts,T as _,w as F,M as Ce,aL as Se,v as N,as as ns,bU as $,av as Ie,h as Ne,Y as rs,bm as $e,b_ as Ae,bc as as,bo as os,b$ as ls,X as is,be as cs,O as ds,bf as us,bg as ms,b as hs,a2 as gs,a9 as ps,bi as fs,bj as ws,bk as ce,bp as ys,y as de,bl as bs,P as vs}from"./index-BG30WuBG.js";import{p as Y,P as xs}from"./PeerPicker-JK4q0ZO9.js";import{S as A}from"./SelectField-Cog9tKMb.js";import{D as Le}from"./DataTable-D65CSQpj.js";import{V as Fe,P as Me,b as ks,p as js,S as Ps}from"./models-DMYWCgsM.js";import{f as Cs}from"./ants-B38m9Phv.js";import{PresetForm as Ss}from"./Presets-DBRoMTo4.js";import{T as Is,a as Ns}from"./Tabs-DuL015VX.js";import{S as H}from"./Switch-CGhLd0Ay.js";import"./PolicyField-CNEZju4W.js";import"./PolicyEditor-BLo1sheV.js";import"./Segmented-YOSVapPh.js";import"./roving-DkptacxO.js";import"./Disclosure-DrGE-NkF.js";import"./TextAreaField-Cxpnr6YH.js";function Te(e,t="admin"){return t==="owner"&&Ve(e)?"ownerRoutingPolicy":"routingPolicy"}async function De(e,t){const n=(await e.keys.list({workspace:t.workspaceId})).find(a=>a.id===t.keyId);if(!n)throw new Error("That key no longer exists.");return n}async function Ee(e,t){switch(t.kind){case"gateway":return e.network.gatewayPolicy();case"workspace-org":return(await e.workspaces.get(t.workspaceId)).orgRoutingPolicy;case"workspace":return(await e.workspaces.get(t.workspaceId)).routingPolicy;case"member":{const n=(await e.members.list()).find(a=>a.id===t.memberId);if(!n)throw new Error("That member no longer exists.");return n.routingPolicy}case"key":{const n=await De(e,t);return n[Te(n,t.layer)]??null}}}async function $s(e,t,n,a){const o=a!=null&&a.confirmEmpty||a!=null&&a.acceptNarrowed?[a]:[];switch(t.kind){case"gateway":await e.network.setGatewayPolicy(n??{},...o);return;case"workspace-org":await e.workspaces.update(t.workspaceId,{orgRoutingPolicy:n},...o);return;case"workspace":await e.workspaces.update(t.workspaceId,{routingPolicy:n},...o);return;case"member":await e.members.update(t.memberId,{routingPolicy:n},...o);return;case"key":{const i=t.layer==="owner"?Te(await De(e,t),"owner"):"routingPolicy";await e.keys.update(t.keyId,{[i]:n},...o);return}}}const ue=e=>JSON.stringify(e??{},Object.keys(e??{}).sort());async function As(e,t,n,a,o,i){const m=await Ee(e,t),c=_e(m,n,a,o),g=ue(m)!==ue(c)||JSON.stringify(m??{})!==JSON.stringify(c);return g&&await $s(e,t,c,i),{before:m,after:c,changed:g}}function Ls(e,t,n){return e.kind==="key"?{model:t,key:e.keyId,workspace:e.workspaceId}:e.kind==="member"?{model:t,member:e.memberId,workspace:n}:e.kind==="gateway"?{model:t,workspace:n}:{model:t,workspace:e.workspaceId}}const Fs={allow:"Allowed",block:"Blocked",prefer:"Preferred"};function Ms(e){const{action:t,name:n,scopeLabel:a,changed:o,model:i,preview:m,peerId:c}=e,g=Fs[t],f=t==="prefer"?`already first for ${i}`:`already ${g.toLowerCase()}`,l=o?`${g} ${n} ${t==="prefer"?`for ${i} `:""}on ${a}`:`${n} was ${f} on ${a}; nothing changed`;if(!m)return t==="block"?{tone:o?"success":"info",text:`${l}.`}:{tone:"info",text:`${l}. ${e.previewError?`Could not check whether it can serve: ${e.previewError}`:"Could not check whether it can serve."}`};const u=m.candidates.find(b=>pe(b.peerId,c));if(t==="block")return u!=null&&u.eligible?{tone:"warning",text:`${l}, but the route preview still lists it as eligible for ${i}. Reload and check the policy.`}:{tone:o?"success":"info",text:`${l}.`};if(!m.modelAllowed)return{tone:"warning",text:`${l}, but ${i} is not an allowed model here, so it still cannot serve it.`};if(!u)return{tone:"info",text:`${l}. It does not offer ${i} right now, so the preview cannot show its rank.`};if(!u.eligible){const b=u.reasons.length?u.reasons.join("; "):"another level excludes it";return{tone:"warning",text:`${l}, but it still cannot serve ${i} here: ${b}.`}}return t==="prefer"&&u.rank!==null&&u.rank>1?{tone:"warning",text:`${l}, but it ranks #${u.rank} for ${i}: a fallback chain on another level comes first.`}:{tone:o?"success":"info",text:`${l}.${u.rank?` It ranks #${u.rank} for ${i}.`:""}`}}function Ts(e,t,n,a){return e==="gateway"?{kind:e}:e==="workspace"||e==="workspace-org"?{kind:e,workspaceId:n}:t?e==="member"?{kind:e,memberId:t}:{kind:"key",keyId:t,workspaceId:n,layer:a?"admin":"owner"}:null}function Ds(e){return e.canForce?"Not allowed above":e.tone==="warning"?"Check the result":"Done"}function Es({fetching:e,error:t,ready:n,policy:a}){return e?s.jsx(ve,{rows:1}):t?s.jsx(ee,{error:t,title:"Could not load this scope's policy"}):n?s.jsxs("p",{className:"gc-muted",children:["Current policy: ",es(a)]}):null}const me={allow:{title:"Allow seller",verb:"Allow"},block:{title:"Block seller",verb:"Block"},prefer:{title:"Prefer seller",verb:"Prefer"}};function Oe({peer:e,action:t,onClose:n,peers:a}){var te,ne,re,ae;const{viewer:o,workspace:i,me:m}=X(),c=fe(),g=Ke(),f=Ge(),l=we(o),u=ye(o),b=[...l?[{value:"gateway",label:"Gateway default (everyone)"}]:[],...l?[{value:"workspace-org",label:`${i.name}: organization policy`}]:[],...u?[{value:"workspace",label:`${i.name}: workspace policy`}]:[],...l?[{value:"member",label:"A member"}]:[],{value:"key",label:"An API key"}],[y,h]=p.useState(b[0].value),[r,v]=p.useState(""),[k,E]=p.useState(""),O=Qe(y==="member"),R=be(c,y==="key");p.useEffect(()=>{v("")},[y]),p.useEffect(()=>{var d;E(((d=e==null?void 0:e.services[0])==null?void 0:d.service)??"")},[e]);const w=(R.data??[]).filter(d=>d.status==="active"&&(u||d.ownerMemberId===m.member.id)),j=Ts(y,r,i.id,u),[S,T]=p.useState(null);p.useEffect(()=>{T(null)},[y,r,e]);const B=Ye({queryKey:["routing","scope-policy",j],queryFn:()=>Ee(L,j),enabled:j!==null&&e!==null,staleTime:0}),z=j!==null&&B.isSuccess&&(t!=="prefer"||k!==""),I=B.data??null,ze=t==="allow"&&z&&!(I!=null&&I.allowedPeerIds)&&!(I!=null&&I.allowedPeerLists),qe=t==="block"&&z&&e!==null&&He(I,e.peerId);let D=((te=b.find(d=>d.value===y))==null?void 0:te.label.replace(/^A[n]? /,"the "))??"this scope";y==="key"&&(D=`key “${((ne=w.find(d=>d.id===r))==null?void 0:ne.label)??r}”`),y==="member"&&(D=`member “${((ae=(re=O.data)==null?void 0:re.find(d=>d.id===r))==null?void 0:ae.label)??r}”`);const P=Je({mutationFn:async(d={})=>{var ie;if(!e||!j)return null;const C=k||((ie=e.services[0])==null?void 0:ie.service)||"",{changed:G}=await As(L,j,t,e.peerId,k||void 0,d);let oe=null,le=null;if(C)try{oe=await L.network.routePreview(Ls(j,C,i.id))}catch(Ue){le=Ze(Ue)}return Ms({action:t,name:Y(a,e.peerId),scopeLabel:D,changed:G,model:C,preview:oe,peerId:e.peerId,previewError:le})},onSuccess:d=>{for(const C of Xe)g.invalidateQueries({queryKey:[C]});d&&(d.tone==="success"?(f(d.text),n()):T(d))},onError:d=>{const C=e?Y(a,e.peerId):"this seller";if(q(d,"narrowed"))T({tone:"warning",canForce:!0,text:`Nothing changed yet. The levels above ${D} do not allow ${C}, so saving this would not let it serve. ${We(d.details).join(" ")}`.trim()});else if(q(d,"empty_allow_list")){const G=t==="block"?`Blocking ${C}`:`Allowing only ${C}`;T({tone:"warning",text:`Nothing changed. ${G} on ${D} would leave no seller that the levels above allow, so requests would fail. Change the policy on the Routing page if you really want that.`})}}}),K=e?Y(a,e.peerId):"";return s.jsx(Z,{isOpen:e!==null,onClose:n,title:me[t].title,subtitle:K,children:s.jsxs("div",{className:"gc-stack",children:[s.jsx(A,{label:"Apply to",value:y,onChange:d=>h(d),options:b}),y==="member"&&s.jsx(A,{label:"Member",value:r,onChange:v,options:[{value:"",label:"Choose a member"},...(O.data??[]).filter(d=>d.status!=="disabled").map(d=>({value:d.id,label:d.label}))]}),y==="key"&&s.jsx(A,{label:"Key",value:r,onChange:v,options:[{value:"",label:w.length?"Choose a key":"No keys you can edit"},...w.map(d=>({value:d.id,label:d.label}))]}),t==="prefer"&&e&&s.jsx(A,{label:"For model",value:k,onChange:E,options:e.services.map(d=>({value:d.service,label:d.service})),hint:"The seller goes first in this model's fallback chain."}),s.jsx(Es,{fetching:B.isFetching,error:B.error,ready:z,policy:I}),ze&&s.jsxs(Q,{tone:"warning",children:["This scope has no allow list yet. Allowing ",K," creates one, so only allowed sellers can serve it."]}),qe&&s.jsxs(Q,{tone:"warning",title:"This is the only allowed seller",children:["Blocking ",K," empties this scope's allow list, so the allow list is removed: any seller that is not blocked may serve it again."]}),t==="block"&&s.jsx("p",{className:"gc-muted",children:"Blocked sellers never serve this scope or anything under it."}),y==="key"&&!u&&s.jsx("p",{className:"gc-muted",children:"This changes your own restrictions on the key. Restrictions a workspace admin set still apply."}),P.error&&!q(P.error,"narrowed")&&!q(P.error,"empty_allow_list")?s.jsx(ee,{error:P.error,title:"Could not update the policy"}):null,S?s.jsxs(s.Fragment,{children:[s.jsx(Q,{tone:S.tone,title:Ds(S),children:S.text}),s.jsxs("div",{className:"gc-actions",children:[S.canForce&&s.jsx(x,{variant:"ghost",disabled:P.isPending,onClick:()=>{T(null),P.mutate({acceptNarrowed:!0})},children:"Save it anyway"}),s.jsx(x,{onClick:n,children:S.canForce?"Cancel":"Done"})]})]}):s.jsxs("div",{className:"gc-actions",children:[s.jsx(x,{variant:"ghost",onClick:n,children:"Cancel"}),s.jsx(x,{variant:t==="block"?"danger":"primary",disabled:!z||P.isPending,onClick:()=>P.mutate({}),children:P.isPending?"Saving…":me[t].verb})]})]})})}function Os({initial:e,peers:t,onDone:n}){const[a,o]=p.useState((e==null?void 0:e.name)??""),[i,m]=p.useState((e==null?void 0:e.description)??""),[c,g]=p.useState((e==null?void 0:e.peerIds)??[]),f=xe({mutationFn:()=>{const l={name:a.trim(),description:i.trim()||null,peerIds:c};return e?L.network.updatePeerList(e.id,l):L.network.createPeerList(l)},onSuccess:n,invalidate:[ke.peerLists]});return s.jsxs("form",{className:"gc-stack",onSubmit:l=>{l.preventDefault(),f.mutate()},children:[s.jsx(_,{label:"Name",required:!0,placeholder:"e.g. Our own sellers",value:a,onChange:l=>o(l.target.value)}),s.jsx(_,{label:"Description",value:i,onChange:l=>m(l.target.value)}),s.jsx(xs,{label:"Sellers",value:c,onChange:g,peers:t}),s.jsx("p",{className:"gc-fineprint",children:"Policies refer to a list by name, so editing it changes every policy that uses it."}),f.error?s.jsx(ee,{error:f.error,title:"Could not save the list"}):null,s.jsxs("div",{className:"gc-actions",children:[s.jsx(x,{variant:"ghost",onClick:n,children:"Cancel"}),s.jsx(x,{type:"submit",disabled:f.isPending||!a.trim(),children:f.isPending?"Saving…":"Save list"})]})]})}function Rs({peers:e}){const{viewer:t}=X(),n=we(t),a=ss(),[o,i]=p.useState(null),[m,c]=p.useState(null),g=xe({mutationFn:f=>L.network.removePeerList(f.id),onSuccess:()=>c(null),invalidate:[ke.peerLists]});return s.jsxs(je,{flush:!0,title:"Peer lists",description:"Named groups of sellers to allow or block in one step.",actions:n&&s.jsx(x,{size:"sm",variant:"outline",leadingIcon:s.jsx(U.plus,{size:14}),onClick:()=>i("new"),children:"New list"}),children:[s.jsx(Pe,{query:a,children:f=>s.jsx(Le,{label:"Peer lists",rows:f,rowKey:l=>l.id,rowLabel:l=>l.name,actions:l=>n?[{label:"Edit",onSelect:()=>i(l)},{label:"Delete",tone:"danger",onSelect:()=>c(l)}]:[],empty:s.jsx(W,{icon:s.jsx(U.network,{size:18}),title:"No peer lists",body:"Group sellers you trust, or ones you run yourself."}),columns:[{key:"name",header:"Name",render:l=>s.jsx("span",{className:"gc-strong",children:l.name})},{key:"desc",header:"Description",secondary:!0,render:l=>s.jsx("span",{className:"gc-muted",children:l.description??"—"})},{key:"count",header:"Sellers",align:"right",render:l=>l.peerIds.length}]})}),s.jsx(Z,{isOpen:o!==null,onClose:()=>i(null),title:o==="new"?"New peer list":"Edit peer list",size:"lg",children:o!==null&&s.jsx(Os,{initial:o==="new"?null:o,peers:e,onDone:()=>i(null)})}),s.jsx(ts,{isOpen:m!==null,busy:g.isPending,error:g.error,onClose:()=>c(null),onConfirm:()=>m&&g.mutate(m),title:"Delete this list?",confirmLabel:"Delete",body:"Policies refer to lists by reference: once deleted, the list adds no sellers to them. An allow list made only of deleted lists lets no seller serve."})]})}function Re(e,t){return t?e.services.filter(n=>n.service===t):e.services}function V(e,t,n=""){const a=Re(e,n).map(o=>o[t]).filter(o=>o!==null);return a.length?{min:Math.min(...a),max:Math.max(...a)}:null}function Bs(e,t=""){var n;return((n=V(e,"inputUsdPerMillion",t))==null?void 0:n.min)??null}function zs(e,t=""){var n;return((n=V(e,"outputUsdPerMillion",t))==null?void 0:n.min)??null}function se(e,t=""){return Re(e,t).some(n=>n.inputUsdPerMillion===0&&(n.outputUsdPerMillion??0)===0)}function qs(e,t){const n=t.search.trim().toLowerCase();return e.filter(a=>{var o;return!(n&&!a.peerId.toLowerCase().includes(n)&&!(a.displayName??"").toLowerCase().includes(n)&&!a.services.some(i=>i.service.toLowerCase().includes(n))||t.model&&!a.services.some(i=>i.service===t.model)||t.tee&&!a.tee||t.linked&&!((o=a.verificationLinks)!=null&&o.length)||t.free&&!se(a,t.model))})}const Be={"openai-chat-completions":"Chat completions","openai-responses":"Responses","anthropic-messages":"Messages","openai-images":"Images"};function he(e){return e===null?"—":String(Math.round(e))}function J(e){return e.displayName??F(e.peerId,8,4)}function M(e){return`${e.provider}:${e.service}`}function Us({peer:e}){const t=(e.health.coolingDownUntil??0)>Date.now();return s.jsxs("span",{className:"gc-seller__meta",children:[s.jsxs("span",{className:"gc-peer-id",children:[s.jsx(Ce,{title:e.peerId,children:F(e.peerId,6,4)}),s.jsx(Se,{iconOnly:!0,value:e.peerId,label:"Copy peer id"})]}),s.jsx(Fe,{links:e.verificationLinks}),e.tee&&s.jsx(N,{tone:"info",children:"TEE"}),se(e,"")&&s.jsx(N,{tone:"success",children:"Free"}),e.washFlagged&&s.jsx(N,{tone:"danger",children:"Flagged"}),t&&s.jsx(N,{tone:"warning",children:"Cooling down"}),s.jsxs("span",{className:"gc-muted",children:["Last seen ",ns(e.lastSeen)]})]})}function _s({peer:e,showReputation:t}){const n=(e.health.coolingDownUntil??0)>Date.now();return s.jsxs("div",{className:"gc-grid gc-grid--2 gc-figures gc-panel-figures",children:[s.jsx($,{label:"Trust score",value:he(e.trustScore)}),t&&s.jsx($,{label:"Reputation",value:he(e.reputationScore)}),s.jsx($,{label:"Stake",value:e.stakeAnts?Cs(e.stakeAnts):"—"}),s.jsx($,{label:"Network usage share",value:e.usageShareBps===null?"—":`${(e.usageShareBps/100).toFixed(2)}%`}),s.jsx($,{label:"Latency p50 (this gateway)",value:Ie(e.latencyMsP50)}),s.jsx($,{label:"Requests, 24h (this gateway)",value:Ne(e.requests24h)}),s.jsx($,{label:"Failure streak",value:n?`${e.health.failureStreak}, cooling down until ${rs(e.health.coolingDownUntil)}`:String(e.health.failureStreak)})]})}function Vs({peer:e,selected:t,onSelect:n}){const[a,o]=p.useState(""),i=a.trim().toLowerCase(),m=e.services.filter(c=>!i||c.service.toLowerCase().includes(i));return s.jsx(Me,{title:`Models (${e.services.length})`,actions:e.services.length>6&&s.jsx(_,{size:"sm",type:"search","aria-label":"Search this provider's models",placeholder:"Search models",value:a,onChange:c=>o(c.target.value)}),children:m.length===0?s.jsx("p",{className:"gc-fineprint",children:i?"No models match.":"This provider lists no models."}):s.jsx("ul",{className:"gc-panel-rows","aria-label":"Models and prices",children:m.map(c=>{const g=t!==null&&M(t)===M(c);return s.jsx(ks,{selected:g,title:s.jsx("span",{className:"gc-strong",children:c.service}),meta:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:js(c)}),s.jsx("span",{children:Be[Ae(c)]})]}),actions:s.jsxs(s.Fragment,{children:[s.jsx(Se,{iconOnly:!0,value:$e(e.peerId,c.service),label:`Copy ${c.service} pinned to this provider (peer@model)`}),s.jsx(x,{size:"sm",variant:g?"outline":"ghost","aria-pressed":g,title:"Show the API call for this model",onClick:()=>n(c),children:"API call"})]})},M(c))})})})}function Ks({peer:e,service:t,onSelect:n}){var R;const{workspace:a,viewer:o}=X(),i=fe(),m=as(),c=be(i),g=os(a.id),[f,l]=p.useState("curl"),[u,b]=p.useState(!1),y=Ae(t),h=$e(e.peerId,t.service),r=((R=g.data)==null?void 0:R.find(w=>w.model===h))??null,v=ls(m,e.peerId,t.service,y,r?`@preset/${r.slug}`:null),k=v.find(w=>w.id===f)??v[0],E=(c.data??[]).some(w=>w.status==="active"),O=ye(o);return s.jsxs(Me,{title:"API call",actions:e.services.length>1&&s.jsx(A,{size:"sm","aria-label":"Model",value:M(t),onChange:w=>{const j=e.services.find(S=>M(S)===w);j&&n(j)},options:e.services.map(w=>({value:M(w),label:w.service}))}),children:[s.jsxs("p",{className:"gc-fineprint",children:["Pinned to this provider with ",s.jsx("code",{children:F(h,10,12)}),"."]}),s.jsx(Is,{id:"gc-connect",label:"Ways to connect",value:k.id,onChange:l,className:"gc-connect-tabs",tabs:v.map(w=>({id:w.id,label:w.label}))}),s.jsxs(Ns,{tabsId:"gc-connect",tab:k.id,className:"gc-stack",children:[k.id==="codex"&&s.jsxs("div",{className:"gc-summary-row",children:[s.jsx("p",{className:"gc-fineprint gc-summary-row__text",children:r?s.jsxs(s.Fragment,{children:["Uses the preset ",s.jsxs("code",{children:["@preset/",r.slug]})," for this model. Codex needs a preset: with a raw GPT model name it switches to a tool format some sellers drop."]}):s.jsx(s.Fragment,{children:"Codex needs a preset, not a raw model name: with a GPT model name it switches to a tool format some sellers drop. Create one for this model, then use its slug."})}),!r&&O&&s.jsx(x,{size:"sm",variant:"outline",onClick:()=>b(!0),children:"Create preset for this model"})]}),k.id==="claude-code"&&y!=="anthropic-messages"&&s.jsxs("p",{className:"gc-fineprint",children:["This model speaks ",Be[y],"; the gateway translates Claude Code's requests for it."]}),s.jsx(is,{code:k.code,label:`${t.service} · ${k.label}`})]}),s.jsxs("p",{className:"gc-fineprint",children:["Set ",s.jsx("code",{children:cs})," to one of your API keys first."," ",c.data&&!E&&s.jsx(ds,{to:"keys",children:"Create an API key"})]}),s.jsx(Z,{isOpen:u,onClose:()=>b(!1),size:"lg",title:"New preset",children:u&&s.jsx(Ss,{initial:null,prefill:{name:t.service,model:h},onDone:w=>{b(!1),w&&l("codex")}})})]})}function Gs({peer:e,peers:t,showReputation:n}){const[a,o]=p.useState(null),[i,m]=p.useState(null),c=p.useRef(null),g=i??e.services[0]??null,f=l=>{var u;m(l),(u=c.current)==null||u.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gc-stack",children:[s.jsx(Us,{peer:e}),s.jsxs("div",{className:"gc-panel-actions",children:[s.jsx(x,{size:"sm",variant:"outline",onClick:()=>o("allow"),children:"Allow"}),s.jsx(x,{size:"sm",variant:"outline",onClick:()=>o("prefer"),children:"Prefer"}),s.jsx(x,{size:"sm",variant:"danger",onClick:()=>o("block"),children:"Block"})]}),s.jsx(_s,{peer:e,showReputation:n})]}),s.jsx(Vs,{peer:e,selected:g,onSelect:f}),g&&s.jsx("div",{ref:c,className:"gc-scroll-target",children:s.jsx(Ks,{peer:e,service:g,onSelect:m})}),a&&s.jsx(Oe,{peer:e,action:a,peers:t,onClose:()=>o(null)})]})}function ge(e){return e===null?"—":String(Math.round(e))}function Qs({peer:e,model:t}){const n=(e.health.coolingDownUntil??0)>Date.now();return s.jsxs("div",{className:"gc-badges",children:[e.tee&&s.jsx(N,{tone:"info",children:"TEE"}),se(e,t)&&s.jsx(N,{tone:"success",children:"Free"}),e.washFlagged&&s.jsx(N,{tone:"danger",children:"Flagged"}),n&&s.jsx(N,{tone:"warning",children:"Cooling down"})]})}function ct(){const e=us(),t=ms(e.rest),n=hs(),a=p.useMemo(()=>{var h;return t?((h=n.data)==null?void 0:h.find(r=>pe(r.peerId,t)))??null:null},[n.data,t]),[o,i]=p.useState({search:"",model:"",tee:!1,linked:!1,free:!1}),[m,c]=p.useState(null),g=p.useMemo(()=>gs(n.data),[n.data]),f=ps(n.data),l=fs(),u=(h,r)=>i(v=>({...v,[h]:r})),b=t===null?null:{eyebrow:"Provider",title:a?J(a):F(t,8,6),body:n.isLoading?s.jsx(ve,{rows:6}):a?s.jsx(Gs,{peer:a,peers:n.data,showReputation:f},a.peerId):s.jsx(W,{icon:s.jsx(U.providers,{size:18}),title:"Provider not found",body:`This gateway does not see ${F(t,8,6)} right now.`})},y=s.jsxs("div",{className:"gc-page",children:[s.jsx(je,{flush:!0,children:s.jsx(Pe,{query:n,rows:8,children:h=>s.jsx(Le,{label:"Providers",rows:qs(h,o),rowKey:r=>r.peerId,selectedKey:(a==null?void 0:a.peerId)??null,onRowClick:r=>de(bs("providers",r.peerId)),rowLabel:r=>J(r),actions:r=>[o.model!==""&&ys(l,r.peerId,o.model),{label:"Allow…",onSelect:()=>c({peer:r,kind:"allow"})},{label:"Prefer…",onSelect:()=>c({peer:r,kind:"prefer"})},{label:"Block…",tone:"danger",onSelect:()=>c({peer:r,kind:"block"})}],initialSort:{key:"trust",direction:"desc"},empty:s.jsx(W,{icon:s.jsx(U.providers,{size:18}),title:h.length?"No providers match these filters":"No providers found yet",body:h.length?void 0:"The buyer is still discovering the network. Check back in a minute."}),columns:[{key:"name",header:"Provider",sortValue:r=>r.displayName??r.peerId,render:r=>s.jsxs("div",{className:"gc-cell-lines",children:[s.jsx("div",{className:"gc-strong gc-ellipsis",title:r.displayName??r.peerId,children:J(r)}),r.displayName&&s.jsx("div",{className:"gc-muted gc-ellipsis",children:s.jsx(Ce,{title:r.peerId,children:F(r.peerId,6,4)})}),s.jsx(Qs,{peer:r,model:o.model})]}),after:r=>s.jsx(ws,{value:r.peerId,label:`Copy peer id ${r.peerId}`})},{key:"identity",header:"Domain / GitHub",secondary:!0,render:r=>{var v;return(v=r.verificationLinks)!=null&&v.length?s.jsx(Fe,{links:r.verificationLinks}):s.jsx("span",{className:"gc-muted",children:"—"})}},{key:"models",header:"Models",secondary:!0,optional:!0,render:r=>s.jsx("span",{className:"gc-muted",children:r.services.length})},{key:"input",header:"Input $/M",align:"right",sortValue:r=>Bs(r,o.model),render:r=>ce(V(r,"inputUsdPerMillion",o.model))},{key:"output",header:"Output $/M",align:"right",secondary:!0,sortValue:r=>zs(r,o.model),render:r=>ce(V(r,"outputUsdPerMillion",o.model))},{key:"trust",header:"Trust",align:"right",sortValue:r=>r.trustScore,render:r=>ge(r.trustScore)},...f?[{key:"reputation",header:"Reputation",align:"right",secondary:!0,optional:!0,sortValue:r=>r.reputationScore,render:r=>ge(r.reputationScore)}]:[],{key:"latency",header:"Latency",align:"right",secondary:!0,optional:!0,sortValue:r=>r.latencyMsP50,render:r=>Ie(r.latencyMsP50)},{key:"usage",header:"Your 24h",align:"right",secondary:!0,sortValue:r=>r.requests24h,render:r=>Ne(r.requests24h)}]})})}),s.jsx(Rs,{peers:n.data})]});return s.jsxs("div",{className:"gc-page",children:[s.jsx(vs,{title:"Providers",description:"Providers on the network this gateway can route to. Open one to copy its models and an API call, or allow, block or prefer it for any scope."}),s.jsxs("div",{className:"gc-toolbar",children:[s.jsx(_,{size:"sm",type:"search","aria-label":"Search providers",placeholder:"Search name, peer id or model",value:o.search,onChange:h=>u("search",h.target.value)}),s.jsx(A,{size:"sm","aria-label":"Filter by model",value:o.model,onChange:h=>u("model",h),options:[{value:"",label:"All models"},...g.map(h=>({value:h,label:h}))]}),s.jsx(H,{checked:o.linked,onChange:h=>u("linked",h),label:"Domain or GitHub"}),s.jsx(H,{checked:o.tee,onChange:h=>u("tee",h),label:"TEE"}),s.jsx(H,{checked:o.free,onChange:h=>u("free",h),label:"Free"})]}),s.jsx(Ps,{list:y,panel:b,onClose:()=>de("providers"),closeLabel:"Close provider"}),m&&s.jsx(Oe,{peer:m.peer,action:m.kind,peers:n.data,onClose:()=>c(null)})]})}export{ct as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,j as e,L as y,o as x,Y as m,av as d,h as i,E as L,I as P,B as S,V as T,f,q as j,v as l,b as C,M as u,g as I,e as M,Z as w,ag as A,W as D,X as E}from"./index-BG30WuBG.js";import{u as F}from"./useInfiniteQuery-Dd787Fyg.js";import{p as K}from"./PeerPicker-JK4q0ZO9.js";import{f as k}from"./usage-CSmvbieU.js";import{D as O}from"./DataTable-D65CSQpj.js";const $=50;function c(r){return r===null?e.jsx(l,{tone:"info",children:"In flight"}):r<400?e.jsx(l,{tone:"success",children:r}):r<500?e.jsx(l,{tone:"warning",children:r}):e.jsx(l,{tone:"danger",children:r})}function q({entry:r}){const a=k(r,Date.now());return a==="free"?e.jsx("span",{className:"gc-muted",title:"Served by a free seller: $0",children:"Free"}):a==="pending"?e.jsx("span",{className:"gc-muted",title:"The buyer reports spend a moment after the response",children:"pending"}):a==="not-recorded"?e.jsx("span",{className:"gc-muted",title:"No spend was reported for this request: the buyer lost it",children:"not recorded"}):e.jsx(e.Fragment,{children:I(r.spent)})}function N({peerId:r,full:a=!1}){const t=C(),o=K(t.data,r);return a?e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsx("span",{children:o}),e.jsx(u,{children:r})]}):e.jsx("span",{className:"gc-ellipsis",title:r,children:o})}function _(r){try{return JSON.stringify(JSON.parse(r),null,2)}catch{return r}}function p({title:r,body:a}){return e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsx("div",{className:"as-field__label",children:r}),e.jsx(E,{code:_(a)})]})}function z({detail:r}){return!r.requestBody&&!r.responseBody?e.jsx("p",{className:"gc-fineprint",children:"Bodies are not stored for this request. Turn on content logging under Settings → Observability to keep them."}):e.jsxs(e.Fragment,{children:[r.requestBody&&e.jsx(p,{title:"Request body",body:r.requestBody}),r.responseBody&&e.jsx(p,{title:"Response body",body:r.responseBody})]})}function J({entry:r}){const a=M({queryKey:j.request(r.tag),queryFn:()=>f.usage.request(r.tag),retry:!1,staleTime:6e4}),t=a.data??r,o=w(a.error)&&a.error.status===404;return e.jsxs(e.Fragment,{children:[t.errorCode||t.errorMessage?e.jsx(A,{tone:"danger",title:t.errorCode??"Request failed",children:t.errorMessage??"No message was returned."}):null,e.jsx(D,{items:[["Status",c(t.status)],["Request",e.jsxs(u,{children:[t.method," ",t.path]},"p")],["Model",t.model??"—"],["Key",t.keyLabel],["End user",t.endUser??"—"],["Seller",t.sellerPeerId?e.jsx(N,{peerId:t.sellerPeerId,full:!0},"s"):"—"],["Latency",d(t.latencyMs)],["Duration",t.finishedAt?d(t.finishedAt-t.startedAt):"—"],["Input tokens",i(t.inputTokens)],["Cached input",i(t.cachedInputTokens)],["Output tokens",i(t.outputTokens)],["Cost",e.jsx(q,{entry:t},"c")],["Tag",e.jsx(u,{children:t.tag},"t")]]}),a.isLoading&&e.jsx(y,{rows:2}),a.error&&!o?e.jsx(x,{error:a.error,title:"Could not load the bodies"}):null,a.data&&e.jsx(z,{detail:a.data})]})}function W({filter:r,showKey:a=!0}){var g;const[t,o]=v.useState(null),n=F({queryKey:j.requests(r),queryFn:({pageParam:s})=>f.usage.requests({...r,before:s??void 0,limit:$}),initialPageParam:null,getNextPageParam:s=>s.nextBefore,refetchInterval:s=>{var h;return(h=s.state.data)!=null&&h.pages.some(B=>B.requests.some(R=>k(R,Date.now())==="pending"))?5e3:!1}});if(n.isLoading)return e.jsx(y,{rows:8});if(n.error)return e.jsx(x,{error:n.error,onRetry:()=>void n.refetch()});const b=((g=n.data)==null?void 0:g.pages.flatMap(s=>s.requests))??[];return e.jsxs(e.Fragment,{children:[e.jsx(O,{label:"Request log",rows:b,rowKey:s=>s.tag,onRowClick:o,rowLabel:s=>`request ${s.tag}`,empty:e.jsx(L,{icon:e.jsx(P.logs,{size:18}),title:"No requests found",body:"Requests appear here as soon as a key is used. Check the filters if you expected some."}),columns:[{key:"time",header:"Time",render:s=>e.jsx("span",{className:"gc-nowrap",children:m(s.startedAt)})},...a?[{key:"key",header:"Key",secondary:!0,render:s=>s.keyLabel}]:[],{key:"model",header:"Model",render:s=>e.jsxs("span",{className:"gc-ellipsis",children:[s.model??e.jsxs("span",{className:"gc-muted",children:[s.method," ",s.path]}),s.status!==null&&s.status>=400?e.jsxs("span",{className:"gc-narrow-only",children:[" ",c(s.status)]}):null]})},{key:"seller",header:"Seller",render:s=>s.sellerPeerId?e.jsx(N,{peerId:s.sellerPeerId}):"—"},{key:"status",header:"Status",secondary:!0,render:s=>e.jsx("span",{title:s.errorMessage??void 0,children:c(s.status)})},{key:"latency",header:"Latency",align:"right",secondary:!0,optional:!0,render:s=>d(s.latencyMs)},{key:"tokens",header:"Tokens",align:"right",secondary:!0,render:s=>`${i(s.inputTokens)} → ${i(s.outputTokens)}`},{key:"cost",header:"Cost",align:"right",render:s=>e.jsx(q,{entry:s})}]}),n.hasNextPage&&e.jsx("div",{className:"gc-load-more",children:e.jsx(S,{variant:"outline",size:"sm",disabled:n.isFetchingNextPage,onClick:()=>void n.fetchNextPage(),children:n.isFetchingNextPage?"Loading…":"Load older requests"})}),e.jsx(T,{isOpen:t!==null,onClose:()=>o(null),title:(t==null?void 0:t.model)??"Request",subtitle:t?m(t.startedAt):void 0,eyebrow:"Request",children:t&&e.jsx(J,{entry:t},t.tag)})]})}export{W as R};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{w as o}from"./core-z96MxYDt.js";import"./index-BG30WuBG.js";import"./index.es-CA2ape1X.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-CAcvlKBB.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const n=o` <svg fill="none" viewBox="0 0 13 4">
|
|
2
|
-
<path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
|
|
3
|
-
</svg>`;export{n as cursorSvg};
|