UNPKG

@frames.js/debugger

Version:

Debug your Frames.js applications

1 lines 39.6 kB
"use strict";(()=>{var t={};t.id=8705,t.ids=[8705],t.modules={30517:t=>{t.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6005:t=>{t.exports=require("node:crypto")},84639:(t,e,r)=>{r.r(e),r.d(e,{headerHooks:()=>et,originalPathname:()=>er,patchFetch:()=>ei,requestAsyncStorage:()=>t7,routeModule:()=>t6,serverHooks:()=>t9,staticGenerationAsyncStorage:()=>t5,staticGenerationBailout:()=>ee});var i={};r.r(i),r.d(i,{POST:()=>t8});var n=r(95419),s=r(69108),o=r(99678),h=r(98984);function a(t){if(!Number.isSafeInteger(t)||t<0)throw Error(`Wrong positive integer: ${t}`)}function d(t,...e){if(!(t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name))throw Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function c(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function l(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}let f=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),u=(t,e)=>t<<32-e|t>>>e;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw Error("Non little-endian hardware is not supported");let p=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0")),b={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function y(t){return t>=b._0&&t<=b._9?t-b._0:t>=b._A&&t<=b._F?t-(b._A-10):t>=b._a&&t<=b._f?t-(b._a-10):void 0}function g(t){if("string"!=typeof t)throw Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function x(t){if("string"==typeof t&&(t=g(t)),!l(t))throw Error(`expected Uint8Array, got ${typeof t}`);return t}function w(...t){let e=0;for(let r=0;r<t.length;r++){let i=t[r];if(!l(i))throw Error("Uint8Array expected");e+=i.length}let r=new Uint8Array(e);for(let e=0,i=0;e<t.length;e++){let n=t[e];r.set(n,i),i+=n.length}return r}class E{clone(){return this._cloneInto()}}function A(t){let e=e=>t().update(x(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}class m extends E{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,function(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.wrapConstructor");a(t.outputLen),a(t.blockLen)}(t);let r=x(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let t=0;t<n.length;t++)n[t]^=54;this.iHash.update(n),this.oHash=t.create();for(let t=0;t<n.length;t++)n[t]^=106;this.oHash.update(n),n.fill(0)}update(t){return c(this),this.iHash.update(t),this}digestInto(t){c(this),d(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:s,outputLen:o}=this;return t.finished=i,t.destroyed=n,t.blockLen=s,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let v=(t,e,r)=>new m(t,e).update(r).digest();v.create=(t,e)=>new m(t,e);class H extends E{constructor(t,e,r,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=f(this.buffer)}update(t){c(this);let{view:e,buffer:r,blockLen:i}=this,n=(t=x(t)).length;for(let s=0;s<n;){let o=Math.min(i-this.pos,n-s);if(o===i){let e=f(t);for(;i<=n-s;s+=i)this.process(e,s);continue}r.set(t.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){c(this),function(t,e){d(t);let r=e.outputLen;if(t.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:i,isLE:n}=this,{pos:s}=this;e[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let t=s;t<i;t++)e[t]=0;(function(t,e,r,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,i);let n=BigInt(32),s=BigInt(4294967295),o=Number(r>>n&s),h=Number(r&s),a=i?4:0,d=i?0:4;t.setUint32(e+a,o,i),t.setUint32(e+d,h,i)})(r,i-8,BigInt(8*this.length),n),this.process(r,0);let o=f(t),h=this.outputLen;if(h%4)throw Error("_sha2: outputLen should be aligned to 32bit");let a=h/4,l=this.get();if(a>l.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<a;t++)o.setUint32(4*t,l[t],n)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:i,finished:n,destroyed:s,pos:o}=this;return t.length=i,t.pos=o,t.finished=n,t.destroyed=s,i%e&&t.buffer.set(r),t}}let L=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),U=Uint8Array.from({length:16},(t,e)=>e),S=U.map(t=>(9*t+5)%16),B=[U],I=[S];for(let t=0;t<4;t++)for(let e of[B,I])e.push(e[t].map(t=>L[t]));let K=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),C=B.map((t,e)=>t.map(t=>K[e][t])),k=I.map((t,e)=>t.map(t=>K[e][t])),N=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),$=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),_=(t,e)=>t<<e|t>>>32-e;function R(t,e,r,i){return 0===t?e^r^i:1===t?e&r|~e&i:2===t?(e|~r)^i:3===t?e&i|r&~i:e^(r|~i)}let F=new Uint32Array(16);class D extends H{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:r,h3:i,h4:n}=this;return[t,e,r,i,n]}set(t,e,r,i,n){this.h0=0|t,this.h1=0|e,this.h2=0|r,this.h3=0|i,this.h4=0|n}process(t,e){for(let r=0;r<16;r++,e+=4)F[r]=t.getUint32(e,!0);let r=0|this.h0,i=r,n=0|this.h1,s=n,o=0|this.h2,h=o,a=0|this.h3,d=a,c=0|this.h4,l=c;for(let t=0;t<5;t++){let e=4-t,f=N[t],u=$[t],p=B[t],b=I[t],y=C[t],g=k[t];for(let e=0;e<16;e++){let i=_(r+R(t,n,o,a)+F[p[e]]+f,y[e])+c|0;r=c,c=a,a=0|_(o,10),o=n,n=i}for(let t=0;t<16;t++){let r=_(i+R(e,s,h,d)+F[b[t]]+u,g[t])+l|0;i=l,l=d,d=0|_(h,10),h=s,s=r}}this.set(this.h1+o+d|0,this.h2+a+l|0,this.h3+c+i|0,this.h4+r+s|0,this.h0+n+h|0)}roundClean(){F.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}let O=A(()=>new D),j=(t,e,r)=>t&e^~t&r,P=(t,e,r)=>t&e^t&r^e&r,T=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]),M=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),G=new Uint32Array(64);class V extends H{constructor(){super(64,32,8,!1),this.A=0|M[0],this.B=0|M[1],this.C=0|M[2],this.D=0|M[3],this.E=0|M[4],this.F=0|M[5],this.G=0|M[6],this.H=0|M[7]}get(){let{A:t,B:e,C:r,D:i,E:n,F:s,G:o,H:h}=this;return[t,e,r,i,n,s,o,h]}set(t,e,r,i,n,s,o,h){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|s,this.G=0|o,this.H=0|h}process(t,e){for(let r=0;r<16;r++,e+=4)G[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=G[t-15],r=G[t-2],i=u(e,7)^u(e,18)^e>>>3,n=u(r,17)^u(r,19)^r>>>10;G[t]=n+G[t-7]+i+G[t-16]|0}let{A:r,B:i,C:n,D:s,E:o,F:h,G:a,H:d}=this;for(let t=0;t<64;t++){let e=d+(u(o,6)^u(o,11)^u(o,25))+j(o,h,a)+T[t]+G[t]|0,c=(u(r,2)^u(r,13)^u(r,22))+P(r,i,n)|0;d=a,a=h,h=o,o=s+e|0,s=n,n=i,i=r,r=e+c|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,s=s+this.D|0,o=o+this.E|0,h=h+this.F|0,a=a+this.G|0,d=d+this.H|0,this.set(r,i,n,s,o,h,a,d)}roundClean(){G.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let q=A(()=>new V),z=BigInt(4294967296-1),W=BigInt(32);function J(t,e=!1){return e?{h:Number(t&z),l:Number(t>>W&z)}:{h:0|Number(t>>W&z),l:0|Number(t&z)}}let Q={fromBig:J,split:function(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let n=0;n<t.length;n++){let{h:s,l:o}=J(t[n],e);[r[n],i[n]]=[s,o]}return[r,i]},toBig:(t,e)=>BigInt(t>>>0)<<W|BigInt(e>>>0),shrSH:(t,e,r)=>t>>>r,shrSL:(t,e,r)=>t<<32-r|e>>>r,rotrSH:(t,e,r)=>t>>>r|e<<32-r,rotrSL:(t,e,r)=>t<<32-r|e>>>r,rotrBH:(t,e,r)=>t<<64-r|e>>>r-32,rotrBL:(t,e,r)=>t>>>r-32|e<<64-r,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH:(t,e,r)=>t<<r|e>>>32-r,rotlSL:(t,e,r)=>e<<r|t>>>32-r,rotlBH:(t,e,r)=>e<<r-32|t>>>64-r,rotlBL:(t,e,r)=>t<<r-32|e>>>64-r,add:function(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/4294967296|0)|0,l:0|n}},add3L:(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),add3H:(t,e,r,i)=>e+r+i+(t/4294967296|0)|0,add4L:(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),add4H:(t,e,r,i,n)=>e+r+i+n+(t/4294967296|0)|0,add5H:(t,e,r,i,n,s)=>e+r+i+n+s+(t/4294967296|0)|0,add5L:(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0)},[X,Z]=Q.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Y=new Uint32Array(80),tt=new Uint32Array(80);class te extends H{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:s,Dh:o,Dl:h,Eh:a,El:d,Fh:c,Fl:l,Gh:f,Gl:u,Hh:p,Hl:b}=this;return[t,e,r,i,n,s,o,h,a,d,c,l,f,u,p,b]}set(t,e,r,i,n,s,o,h,a,d,c,l,f,u,p,b){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|s,this.Dh=0|o,this.Dl=0|h,this.Eh=0|a,this.El=0|d,this.Fh=0|c,this.Fl=0|l,this.Gh=0|f,this.Gl=0|u,this.Hh=0|p,this.Hl=0|b}process(t,e){for(let r=0;r<16;r++,e+=4)Y[r]=t.getUint32(e),tt[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|Y[t-15],r=0|tt[t-15],i=Q.rotrSH(e,r,1)^Q.rotrSH(e,r,8)^Q.shrSH(e,r,7),n=Q.rotrSL(e,r,1)^Q.rotrSL(e,r,8)^Q.shrSL(e,r,7),s=0|Y[t-2],o=0|tt[t-2],h=Q.rotrSH(s,o,19)^Q.rotrBH(s,o,61)^Q.shrSH(s,o,6),a=Q.rotrSL(s,o,19)^Q.rotrBL(s,o,61)^Q.shrSL(s,o,6),d=Q.add4L(n,a,tt[t-7],tt[t-16]),c=Q.add4H(d,i,h,Y[t-7],Y[t-16]);Y[t]=0|c,tt[t]=0|d}let{Ah:r,Al:i,Bh:n,Bl:s,Ch:o,Cl:h,Dh:a,Dl:d,Eh:c,El:l,Fh:f,Fl:u,Gh:p,Gl:b,Hh:y,Hl:g}=this;for(let t=0;t<80;t++){let e=Q.rotrSH(c,l,14)^Q.rotrSH(c,l,18)^Q.rotrBH(c,l,41),x=Q.rotrSL(c,l,14)^Q.rotrSL(c,l,18)^Q.rotrBL(c,l,41),w=c&f^~c&p,E=l&u^~l&b,A=Q.add5L(g,x,E,Z[t],tt[t]),m=Q.add5H(A,y,e,w,X[t],Y[t]),v=0|A,H=Q.rotrSH(r,i,28)^Q.rotrBH(r,i,34)^Q.rotrBH(r,i,39),L=Q.rotrSL(r,i,28)^Q.rotrBL(r,i,34)^Q.rotrBL(r,i,39),U=r&n^r&o^n&o,S=i&s^i&h^s&h;y=0|p,g=0|b,p=0|f,b=0|u,f=0|c,u=0|l,({h:c,l:l}=Q.add(0|a,0|d,0|m,0|v)),a=0|o,d=0|h,o=0|n,h=0|s,n=0|r,s=0|i;let B=Q.add3L(v,L,S);r=Q.add3H(B,m,H,U),i=0|B}({h:r,l:i}=Q.add(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:s}=Q.add(0|this.Bh,0|this.Bl,0|n,0|s)),({h:o,l:h}=Q.add(0|this.Ch,0|this.Cl,0|o,0|h)),({h:a,l:d}=Q.add(0|this.Dh,0|this.Dl,0|a,0|d)),({h:c,l:l}=Q.add(0|this.Eh,0|this.El,0|c,0|l)),({h:f,l:u}=Q.add(0|this.Fh,0|this.Fl,0|f,0|u)),({h:p,l:b}=Q.add(0|this.Gh,0|this.Gl,0|p,0|b)),({h:y,l:g}=Q.add(0|this.Hh,0|this.Hl,0|y,0|g)),this.set(r,i,n,s,o,h,a,d,c,l,f,u,p,b,y,g)}roundClean(){Y.fill(0),tt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let tr=A(()=>new te);var ti=r(43693),tn=r(64717);function ts(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function to(...t){let e=t=>t,r=(t,e)=>r=>t(e(r));return{encode:t.map(t=>t.encode).reduceRight(r,e),decode:t.map(t=>t.decode).reduce(r,e)}}function th(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw Error("alphabet.encode input should be an array of numbers");return e.map(e=>{if(e<0||e>=t.length)throw Error(`Digit index outside alphabet: ${e} (alphabet: ${t.length})`);return t[e]})},decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw Error("alphabet.decode input should be array of strings");return e.map(e=>{if("string"!=typeof e)throw Error(`alphabet.decode: not string element=${e}`);let r=t.indexOf(e);if(-1===r)throw Error(`Unknown letter: "${e}". Allowed: ${t}`);return r})}}}function ta(t=""){if("string"!=typeof t)throw Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw Error("join.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw Error(`join.encode: non-string input=${t}`);return e.join(t)},decode:e=>{if("string"!=typeof e)throw Error("join.decode input should be string");return e.split(t)}}}function td(t,e,r){if(e<2)throw Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(r<2)throw Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(t))throw Error("convertRadix: data should be array");if(!t.length)return[];let i=0,n=[],s=Array.from(t);for(s.forEach(t=>{if(t<0||t>=e)throw Error(`Wrong integer: ${t}`)});;){let t=0,o=!0;for(let n=i;n<s.length;n++){let h=s[n],a=e*t+h;if(!Number.isSafeInteger(a)||e*t/e!==t||a-h!=e*t)throw Error("convertRadix: carry overflow");t=a%r;let d=Math.floor(a/r);if(s[n]=d,!Number.isSafeInteger(d)||d*r+t!==a)throw Error("convertRadix: carry overflow");o&&(d?o=!1:i=n)}if(n.push(t),o)break}for(let e=0;e<t.length-1&&0===t[e];e++)n.push(0);return n.reverse()}let tc=(t,e)=>e?tc(e,t%e):t,tl=to(function(t){return{encode:e=>{if(!ts(e))throw Error("radix.encode input should be Uint8Array");return td(Array.from(e),256,t)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw Error("radix.decode input should be array of numbers");return Uint8Array.from(td(e,t,256))}}}(58),th("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),ta("")),tf=ti.kA.ProjectivePoint,tu=to(function(t,e){if("function"!=typeof e)throw Error("checksum fn should be function");return{encode(r){if(!ts(r))throw Error("checksum.encode: input should be Uint8Array");let i=e(r).slice(0,t),n=new Uint8Array(r.length+t);return n.set(r),n.set(i,r.length),n},decode(r){if(!ts(r))throw Error("checksum.decode: input should be Uint8Array");let i=r.slice(0,-t),n=e(i).slice(0,t),s=r.slice(-t);for(let e=0;e<t;e++)if(n[e]!==s[e])throw Error("Invalid checksum");return i}}}(4,t=>q(q(t))),tl);function tp(t){return BigInt(`0x${function(t){if(!l(t))throw Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=p[t[r]];return e}(t)}`)}let tb=g("Bitcoin seed"),ty={private:76066276,public:76067358},tg=t=>O(q(t)),tx=t=>f(t).getUint32(0,!1),tw=t=>{if(!Number.isSafeInteger(t)||t<0||t>4294967296-1)throw Error(`Invalid number=${t}. Should be from 0 to 2 ** 32 - 1`);let e=new Uint8Array(4);return f(e).setUint32(0,t,!1),e};class tE{get fingerprint(){if(!this.pubHash)throw Error("No publicKey set!");return tx(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let t=this.privateKey;if(!t)throw Error("No private key");return tu.encode(this.serialize(this.versions.private,w(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw Error("No public key");return tu.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,e=ty){if(d(t),8*t.length<128||8*t.length>512)throw Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);let r=v(tr,tb,t);return new tE({versions:e,chainCode:r.slice(32),privateKey:r.slice(0,32)})}static fromExtendedKey(t,e=ty){let r=tu.decode(t),i=f(r),n=i.getUint32(0,!1),s={versions:e,depth:r[4],parentFingerprint:i.getUint32(5,!1),index:i.getUint32(9,!1),chainCode:r.slice(13,45)},o=r.slice(45),h=0===o[0];if(n!==e[h?"private":"public"])throw Error("Version mismatch");return new tE(h?{...s,privateKey:o.slice(1)}:{...s,publicKey:o})}static fromJSON(t){return tE.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||"object"!=typeof t)throw Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||ty,this.depth=t.depth||0,this.chainCode=t.chainCode,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw Error("HDKey: zero depth with non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!ti.kA.utils.isValidPrivateKey(t.privateKey))throw Error("Invalid private key");this.privKey="bigint"==typeof t.privateKey?t.privateKey:tp(t.privateKey),this.privKeyBytes=function(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw Error("padded hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(r);for(let e=0,n=0;e<r;e++,n+=2){let r=y(t.charCodeAt(n)),s=y(t.charCodeAt(n+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(t[n]+t[n+1])+'" at index '+n);i[e]=16*r+s}return i}(this.privKey.toString(16).padStart(64,"0")),this.pubKey=ti.kA.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=tf.fromHex(t.publicKey).toRawBytes(!0);else throw Error("HDKey: no public or private key provided");this.pubHash=tg(this.pubKey)}derive(t){if(!/^[mM]'?/.test(t))throw Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;let e=t.replace(/^[mM]'?\//,"").split("/"),r=this;for(let t of e){let e=/^(\d+)('?)$/.exec(t),i=e&&e[1];if(!e||3!==e.length||"string"!=typeof i)throw Error(`Invalid child index: ${t}`);let n=+i;if(!Number.isSafeInteger(n)||n>=2147483648)throw Error("Invalid index");"'"===e[2]&&(n+=2147483648),r=r.deriveChild(n)}return r}deriveChild(t){if(!this.pubKey||!this.chainCode)throw Error("No publicKey or chainCode set");let e=tw(t);if(t>=2147483648){let t=this.privateKey;if(!t)throw Error("Could not derive hardened child key");e=w(new Uint8Array([0]),t,e)}else e=w(this.pubKey,e);let r=v(tr,this.chainCode,e),i=tp(r.slice(0,32)),n=r.slice(32);if(!ti.kA.utils.isValidPrivateKey(i))throw Error("Tweak bigger than curve order");let s={versions:this.versions,chainCode:n,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){let t=(0,tn.wQ)(this.privKey+i,ti.kA.CURVE.n);if(!ti.kA.utils.isValidPrivateKey(t))throw Error("The tweak was out of range or the resulted private key is invalid");s.privateKey=t}else{let t=tf.fromHex(this.pubKey).add(tf.fromPrivateKey(i));if(t.equals(tf.ZERO))throw Error("The tweak was equal to negative P, which made the result key invalid");s.publicKey=t.toRawBytes(!0)}return new tE(s)}catch(e){return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw Error("No privateKey set!");return d(t,32),ti.kA.sign(t,this.privKey).toCompactRawBytes()}verify(t,e){let r;if(d(t,32),d(e,64),!this.publicKey)throw Error("No publicKey set!");try{r=ti.kA.Signature.fromCompact(e)}catch(t){return!1}return ti.kA.verify(r,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,e){if(!this.chainCode)throw Error("No chainCode set");return d(e,33),w(tw(t),new Uint8Array([this.depth]),tw(this.parentFingerprint),tw(this.index),this.chainCode,e)}}function tA(t){if(!Number.isSafeInteger(t)||t<0)throw Error(`Wrong positive integer: ${t}`)}function tm(t,...e){if(!(t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name))throw Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function tv(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.wrapConstructor");tA(t.outputLen),tA(t.blockLen)}function tH(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}let tL=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw Error("Non little-endian hardware is not supported");function tU(t){var e;if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}(t)),!((e=t)instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name))throw Error(`expected Uint8Array, got ${typeof t}`);return t}class tS{clone(){return this._cloneInto()}}let tB={}.toString;class tI extends tS{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,tv(t);let r=tU(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let t=0;t<n.length;t++)n[t]^=54;this.iHash.update(n),this.oHash=t.create();for(let t=0;t<n.length;t++)n[t]^=106;this.oHash.update(n),n.fill(0)}update(t){return tH(this),this.iHash.update(t),this}digestInto(t){tH(this),tm(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:s,outputLen:o}=this;return t.finished=i,t.destroyed=n,t.blockLen=s,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let tK=(t,e,r)=>new tI(t,e).update(r).digest();tK.create=(t,e)=>new tI(t,e);class tC extends tS{constructor(t,e,r,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=tL(this.buffer)}update(t){tH(this);let{view:e,buffer:r,blockLen:i}=this,n=(t=tU(t)).length;for(let s=0;s<n;){let o=Math.min(i-this.pos,n-s);if(o===i){let e=tL(t);for(;i<=n-s;s+=i)this.process(e,s);continue}r.set(t.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){tH(this),function(t,e){tm(t);let r=e.outputLen;if(t.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:i,isLE:n}=this,{pos:s}=this;e[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let t=s;t<i;t++)e[t]=0;(function(t,e,r,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,i);let n=BigInt(32),s=BigInt(4294967295),o=Number(r>>n&s),h=Number(r&s),a=i?4:0,d=i?0:4;t.setUint32(e+a,o,i),t.setUint32(e+d,h,i)})(r,i-8,BigInt(8*this.length),n),this.process(r,0);let o=tL(t),h=this.outputLen;if(h%4)throw Error("_sha2: outputLen should be aligned to 32bit");let a=h/4,d=this.get();if(a>d.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<a;t++)o.setUint32(4*t,d[t],n)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:i,finished:n,destroyed:s,pos:o}=this;return t.length=i,t.pos=o,t.finished=n,t.destroyed=s,i%e&&t.buffer.set(r),t}}let tk=BigInt(4294967296-1),tN=BigInt(32);function t$(t,e=!1){return e?{h:Number(t&tk),l:Number(t>>tN&tk)}:{h:0|Number(t>>tN&tk),l:0|Number(t&tk)}}let t_={fromBig:t$,split:function(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let n=0;n<t.length;n++){let{h:s,l:o}=t$(t[n],e);[r[n],i[n]]=[s,o]}return[r,i]},toBig:(t,e)=>BigInt(t>>>0)<<tN|BigInt(e>>>0),shrSH:(t,e,r)=>t>>>r,shrSL:(t,e,r)=>t<<32-r|e>>>r,rotrSH:(t,e,r)=>t>>>r|e<<32-r,rotrSL:(t,e,r)=>t<<32-r|e>>>r,rotrBH:(t,e,r)=>t<<64-r|e>>>r-32,rotrBL:(t,e,r)=>t>>>r-32|e<<64-r,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH:(t,e,r)=>t<<r|e>>>32-r,rotlSL:(t,e,r)=>e<<r|t>>>32-r,rotlBH:(t,e,r)=>e<<r-32|t>>>64-r,rotlBL:(t,e,r)=>t<<r-32|e>>>64-r,add:function(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/4294967296|0)|0,l:0|n}},add3L:(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),add3H:(t,e,r,i)=>e+r+i+(t/4294967296|0)|0,add4L:(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),add4H:(t,e,r,i,n)=>e+r+i+n+(t/4294967296|0)|0,add5H:(t,e,r,i,n,s)=>e+r+i+n+s+(t/4294967296|0)|0,add5L:(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0)},[tR,tF]=t_.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),tD=new Uint32Array(80),tO=new Uint32Array(80);class tj extends tC{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:s,Dh:o,Dl:h,Eh:a,El:d,Fh:c,Fl:l,Gh:f,Gl:u,Hh:p,Hl:b}=this;return[t,e,r,i,n,s,o,h,a,d,c,l,f,u,p,b]}set(t,e,r,i,n,s,o,h,a,d,c,l,f,u,p,b){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|s,this.Dh=0|o,this.Dl=0|h,this.Eh=0|a,this.El=0|d,this.Fh=0|c,this.Fl=0|l,this.Gh=0|f,this.Gl=0|u,this.Hh=0|p,this.Hl=0|b}process(t,e){for(let r=0;r<16;r++,e+=4)tD[r]=t.getUint32(e),tO[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|tD[t-15],r=0|tO[t-15],i=t_.rotrSH(e,r,1)^t_.rotrSH(e,r,8)^t_.shrSH(e,r,7),n=t_.rotrSL(e,r,1)^t_.rotrSL(e,r,8)^t_.shrSL(e,r,7),s=0|tD[t-2],o=0|tO[t-2],h=t_.rotrSH(s,o,19)^t_.rotrBH(s,o,61)^t_.shrSH(s,o,6),a=t_.rotrSL(s,o,19)^t_.rotrBL(s,o,61)^t_.shrSL(s,o,6),d=t_.add4L(n,a,tO[t-7],tO[t-16]),c=t_.add4H(d,i,h,tD[t-7],tD[t-16]);tD[t]=0|c,tO[t]=0|d}let{Ah:r,Al:i,Bh:n,Bl:s,Ch:o,Cl:h,Dh:a,Dl:d,Eh:c,El:l,Fh:f,Fl:u,Gh:p,Gl:b,Hh:y,Hl:g}=this;for(let t=0;t<80;t++){let e=t_.rotrSH(c,l,14)^t_.rotrSH(c,l,18)^t_.rotrBH(c,l,41),x=t_.rotrSL(c,l,14)^t_.rotrSL(c,l,18)^t_.rotrBL(c,l,41),w=c&f^~c&p,E=l&u^~l&b,A=t_.add5L(g,x,E,tF[t],tO[t]),m=t_.add5H(A,y,e,w,tR[t],tD[t]),v=0|A,H=t_.rotrSH(r,i,28)^t_.rotrBH(r,i,34)^t_.rotrBH(r,i,39),L=t_.rotrSL(r,i,28)^t_.rotrBL(r,i,34)^t_.rotrBL(r,i,39),U=r&n^r&o^n&o,S=i&s^i&h^s&h;y=0|p,g=0|b,p=0|f,b=0|u,f=0|c,u=0|l,({h:c,l:l}=t_.add(0|a,0|d,0|m,0|v)),a=0|o,d=0|h,o=0|n,h=0|s,n=0|r,s=0|i;let B=t_.add3L(v,L,S);r=t_.add3H(B,m,H,U),i=0|B}({h:r,l:i}=t_.add(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:s}=t_.add(0|this.Bh,0|this.Bl,0|n,0|s)),({h:o,l:h}=t_.add(0|this.Ch,0|this.Cl,0|o,0|h)),({h:a,l:d}=t_.add(0|this.Dh,0|this.Dl,0|a,0|d)),({h:c,l:l}=t_.add(0|this.Eh,0|this.El,0|c,0|l)),({h:f,l:u}=t_.add(0|this.Fh,0|this.Fl,0|f,0|u)),({h:p,l:b}=t_.add(0|this.Gh,0|this.Gl,0|p,0|b)),({h:y,l:g}=t_.add(0|this.Hh,0|this.Hl,0|y,0|g)),this.set(r,i,n,s,o,h,a,d,c,l,f,u,p,b,y,g)}roundClean(){tD.fill(0),tO.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let tP=function(t){let e=e=>t().update(tU(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}(()=>new tj);function tT(t){if("string"!=typeof t)throw TypeError(`Invalid mnemonic type: ${typeof t}`);return t.normalize("NFKD")}let tM=t=>tT(`mnemonic${t}`);var tG=r(70451),tV=r(32586),tq=r(8345),tz=r(92795),tW=r(85924),tJ=r(38186),tQ=r(46641);async function tX({hash:t,privateKey:e}){let{r,s:i,recovery:n}=ti.kA.sign(t.slice(2),e.slice(2));return{r:(0,tG.NC)(r),s:(0,tG.NC)(i),v:n?28n:27n,yParity:n}}async function tZ({message:t,privateKey:e}){let r=await tX({hash:(0,tJ.r)(t),privateKey:e});return(0,tQ.V)(r)}var tY=r(5614);async function t0(t){let{privateKey:e,transaction:r,serializer:i=tY.D}=t,n="eip4844"===r.type?{...r,sidecars:!1}:r,s=await tX({hash:(0,tW.w)(i(n)),privateKey:e});return i(r,s)}var t1=r(54835);async function t2(t){let{privateKey:e,...r}=t,i=await tX({hash:(0,t1.J)(r),privateKey:e});return(0,tQ.V)(i)}let t3={name:"Farcaster SignedKeyRequestValidator",version:"1",chainId:10,verifyingContract:"0x00000000fc700472606ed4fa22623acf62c60553"},t4=[{name:"requestFid",type:"uint256"},{name:"key",type:"bytes"},{name:"deadline",type:"uint256"}];async function t8(t){if(process.env.SIGNER_URL)return console.log("redirecting to public signer url configured by SIGNER_URL"),h.NextResponse.redirect(new URL(process.env.SIGNER_URL).toString(),{status:307,headers:{"Access-Control-Allow-Origin":"*"}});if(!process.env.FARCASTER_DEVELOPER_FID||!process.env.FARCASTER_DEVELOPER_MNEMONIC)return console.warn("FARCASTER_DEVELOPER_FID or FARCASTER_DEVELOPER_MNEMONIC not set, using frames.js debugger hosted signer"),h.NextResponse.redirect("https://debugger.framesjs.org/signer",{status:307,headers:{"Access-Control-Allow-Origin":"*"}});try{let{publicKey:e}=await t.json(),r=process.env.FARCASTER_DEVELOPER_FID,i=function(t,e={}){let r=function(t,e=""){return function(t,e,r,i){var n;let s;let{c:o,dkLen:h,DK:a,PRF:d,PRFSalt:c}=function(t,e,r,i){tv(t);let{c:n,dkLen:s,asyncTick:o}=function(t,e){if(void 0!==e&&"[object Object]"!==tB.call(e))throw Error("Options should be object or undefined");return Object.assign(t,e)}({dkLen:32,asyncTick:10},i);if(tA(n),tA(s),tA(o),n<1)throw Error("PBKDF2: iterations (c) should be >= 1");let h=tU(e),a=tU(r),d=new Uint8Array(s),c=tK.create(t,h),l=c._cloneInto().update(a);return{c:n,dkLen:s,asyncTick:o,DK:d,PRF:c,PRFSalt:l}}(t,e,r,i),l=new Uint8Array(4),f=tL(l),u=new Uint8Array(d.outputLen);for(let t=1,e=0;e<h;t++,e+=d.outputLen){let r=a.subarray(e,e+d.outputLen);f.setInt32(0,t,!1),(s=c._cloneInto(s)).update(l).digestInto(u),r.set(u.subarray(0,r.length));for(let t=1;t<o;t++){d._cloneInto(s).update(u).digestInto(u);for(let t=0;t<r.length;t++)r[t]^=u[t]}}return n=s,d.destroy(),c.destroy(),n&&n.destroy(),u.fill(0),a}(tP,function(t){let e=tT(t),r=e.split(" ");if(![12,15,18,21,24].includes(r.length))throw Error("Invalid mnemonic");return{nfkd:e,words:r}}(t).nfkd,tM(e),{c:2048,dkLen:64})}(t);return function(t,{accountIndex:e=0,addressIndex:r=0,changeIndex:i=0,path:n}={}){let s=t.derive(n||`m/44'/60'/${e}'/${i}/${r}`);return{...function(t){let e=(0,tG.NC)(ti.kA.getPublicKey(t.slice(2),!1));return{...function(t){if("string"==typeof t){if(!(0,tq.U)(t,{strict:!1}))throw new tV.b({address:t});return{address:t,type:"json-rpc"}}if(!(0,tq.U)(t.address,{strict:!1}))throw new tV.b({address:t.address});return{address:t.address,signMessage:t.signMessage,signTransaction:t.signTransaction,signTypedData:t.signTypedData,source:"custom",type:"local"}}({address:function(t){let e=(0,tW.w)(`0x${t.substring(4)}`).substring(26);return(0,tz.xs)(`0x${e}`)}(e),signMessage:async({message:e})=>tZ({message:e,privateKey:t}),signTransaction:async(e,{serializer:r}={})=>t0({privateKey:t,transaction:e,serializer:r}),signTypedData:async e=>t2({...e,privateKey:t})}),publicKey:e,source:"privateKey"}}((0,tG.NC)(s.privateKey)),getHdKey:()=>s,source:"hd"}}(tE.fromMasterSeed(r),e)}(process.env.FARCASTER_DEVELOPER_MNEMONIC),n=Math.floor(Date.now()/1e3)+86400,s=await i.signTypedData({domain:t3,types:{SignedKeyRequest:t4},primaryType:"SignedKeyRequest",message:{requestFid:BigInt(r),key:e,deadline:BigInt(n)}});return Response.json({signature:s,requestFid:parseInt(r),deadline:n,requestSigner:i.address},{headers:{"Access-Control-Allow-Origin":"*"}})}catch(e){console.error(e);let t=h.NextResponse.error();return t.headers.set("Access-Control-Allow-Origin","*"),t}}let t6=new n.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/signer/route",pathname:"/signer",filename:"route",bundlePath:"app/signer/route"},resolvedPagePath:"/Users/davidfurlong/Projects/active/frames.js/packages/debugger/app/signer/route.ts",nextConfigOutput:"",userland:i}),{requestAsyncStorage:t7,staticGenerationAsyncStorage:t5,serverHooks:t9,headerHooks:et,staticGenerationBailout:ee}=t6,er="/signer/route";function ei(){return(0,o.patchFetch)({serverHooks:t9,staticGenerationAsyncStorage:t5})}},95419:(t,e,r)=>{t.exports=r(30517)},49510:(t,e,r)=>{r.d(e,{FF:()=>m,S5:()=>u,Wd:()=>y,bytesToNumberBE:()=>c,ci:()=>h,dQ:()=>g,eV:()=>b,hexToBytes:()=>d,n$:()=>E,ql:()=>p,tL:()=>f,ty:()=>l}),BigInt(0);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let i=BigInt(1),n=BigInt(2),s=t=>t instanceof Uint8Array,o=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function h(t){if(!s(t))throw Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=o[t[r]];return e}function a(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":`0x${t}`)}function d(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);let e=t.length;if(e%2)throw Error("padded hex string expected, got unpadded hex of length "+e);let r=new Uint8Array(e/2);for(let e=0;e<r.length;e++){let i=2*e,n=Number.parseInt(t.slice(i,i+2),16);if(Number.isNaN(n)||n<0)throw Error("Invalid byte sequence");r[e]=n}return r}function c(t){return a(h(t))}function l(t){if(!s(t))throw Error("Uint8Array expected");return a(h(Uint8Array.from(t).reverse()))}function f(t,e){return d(t.toString(16).padStart(2*e,"0"))}function u(t,e){return f(t,e).reverse()}function p(t,e,r){let i;if("string"==typeof e)try{i=d(e)}catch(r){throw Error(`${t} must be valid hex string, got "${e}". Cause: ${r}`)}else if(s(e))i=Uint8Array.from(e);else throw Error(`${t} must be hex string or Uint8Array`);let n=i.length;if("number"==typeof r&&n!==r)throw Error(`${t} expected ${r} bytes, got ${n}`);return i}function b(...t){let e=new Uint8Array(t.reduce((t,e)=>t+e.length,0)),r=0;return t.forEach(t=>{if(!s(t))throw Error("Uint8Array expected");e.set(t,r),r+=t.length}),e}function y(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}let g=t=>(n<<BigInt(t-1))-i,x=t=>new Uint8Array(t),w=t=>Uint8Array.from(t);function E(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let i=x(t),n=x(t),s=0,o=()=>{i.fill(1),n.fill(0),s=0},h=(...t)=>r(n,i,...t),a=(t=x())=>{n=h(w([0]),t),i=h(),0!==t.length&&(n=h(w([1]),t),i=h())},d=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(i=h()).slice();r.push(e),t+=i.length}return b(...r)};return(t,e)=>{let r;for(o(),a(t);!(r=e(d()));)a();return o(),r}}let A={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function m(t,e,r={}){let i=(e,r,i)=>{let n=A[r];if("function"!=typeof n)throw Error(`Invalid validator "${r}", expected function`);let s=t[e];if((!i||void 0!==s)&&!n(s,t))throw Error(`Invalid param ${String(e)}=${s} (${typeof s}), expected ${r}`)};for(let[t,r]of Object.entries(e))i(t,r,!1);for(let[t,e]of Object.entries(r))i(t,e,!0);return t}}};var e=require("../../webpack-runtime.js");e.C(t);var r=t=>e(e.s=t),i=e.X(0,[1638,6532,8984,4762],()=>r(84639));module.exports=i})();