UNPKG

o1js

Version:

TypeScript framework for zk-SNARKs and zkApps

15 lines 13.9 MB
var M2=Object.create;var Wn=Object.defineProperty;var x2=Object.getOwnPropertyDescriptor;var $2=Object.getOwnPropertyNames;var K2=Object.getPrototypeOf,v2=Object.prototype.hasOwnProperty;var Cg=(g,A)=>()=>(A||g((A={exports:{}}).exports,A),A.exports),ut=(g,A)=>{for(var _ in A)Wn(g,_,{get:A[_],enumerable:!0})},q2=(g,A,_,t)=>{if(A&&typeof A=="object"||typeof A=="function")for(let a of $2(A))!v2.call(g,a)&&a!==_&&Wn(g,a,{get:()=>A[a],enumerable:!(t=x2(A,a))||t.enumerable});return g};var Wi=(g,A,_)=>(_=g!=null?M2(K2(g)):{},q2(A||!g||!g.__esModule?Wn(_,"default",{value:g,enumerable:!0}):_,g));var qo=Cg((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(g){return typeof g=="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});var createOutputMethod=function(g,A){return function(_){return new Sha256(A,!0).update(_)[g]()}},createMethod=function(g){var A=createOutputMethod("hex",g);NODE_JS&&(A=nodeWrap(A,g)),A.create=function(){return new Sha256(g)},A.update=function(a){return A.create().update(a)};for(var _=0;_<OUTPUT_TYPES.length;++_){var t=OUTPUT_TYPES[_];A[t]=createOutputMethod(t,g)}return A},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(g){if(typeof g=="string")return crypto.createHash(algorithm).update(g,"utf8").digest("hex");if(g==null)throw new Error(ERROR);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(g)).digest("hex"):method(g)};return nodeMethod},createHmacOutputMethod=function(g,A){return function(_,t){return new HmacSha256(_,A,!0).update(t)[g]()}},createHmacMethod=function(g){var A=createHmacOutputMethod("hex",g);A.create=function(a){return new HmacSha256(a,g)},A.update=function(a,I){return A.create(a).update(I)};for(var _=0;_<OUTPUT_TYPES.length;++_){var t=OUTPUT_TYPES[_];A[t]=createHmacOutputMethod(t,g)}return A};function Sha256(g,A){A?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=g}Sha256.prototype.update=function(g){if(!this.finalized){var A,_=typeof g;if(_!=="string"){if(_==="object"){if(g===null)throw new Error(ERROR);if(ARRAY_BUFFER&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(g)))throw new Error(ERROR)}else throw new Error(ERROR);A=!0}for(var t,a=0,I,r=g.length,C=this.blocks;a<r;){if(this.hashed&&(this.hashed=!1,C[0]=this.block,C[16]=C[1]=C[2]=C[3]=C[4]=C[5]=C[6]=C[7]=C[8]=C[9]=C[10]=C[11]=C[12]=C[13]=C[14]=C[15]=0),A)for(I=this.start;a<r&&I<64;++a)C[I>>2]|=g[a]<<SHIFT[I++&3];else for(I=this.start;a<r&&I<64;++a)t=g.charCodeAt(a),t<128?C[I>>2]|=t<<SHIFT[I++&3]:t<2048?(C[I>>2]|=(192|t>>6)<<SHIFT[I++&3],C[I>>2]|=(128|t&63)<<SHIFT[I++&3]):t<55296||t>=57344?(C[I>>2]|=(224|t>>12)<<SHIFT[I++&3],C[I>>2]|=(128|t>>6&63)<<SHIFT[I++&3],C[I>>2]|=(128|t&63)<<SHIFT[I++&3]):(t=65536+((t&1023)<<10|g.charCodeAt(++a)&1023),C[I>>2]|=(240|t>>18)<<SHIFT[I++&3],C[I>>2]|=(128|t>>12&63)<<SHIFT[I++&3],C[I>>2]|=(128|t>>6&63)<<SHIFT[I++&3],C[I>>2]|=(128|t&63)<<SHIFT[I++&3]);this.lastByteIndex=I,this.bytes+=I-this.start,I>=64?(this.block=C[16],this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,A=this.lastByteIndex;g[16]=this.block,g[A>>2]|=EXTRA[A&3],this.block=g[16],A>=56&&(this.hashed||this.hash(),g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),g[14]=this.hBytes<<3|this.bytes>>>29,g[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var g=this.h0,A=this.h1,_=this.h2,t=this.h3,a=this.h4,I=this.h5,r=this.h6,C=this.h7,c=this.blocks,n,Q,u,f,D,l,m,k,b,F,o;for(n=16;n<64;++n)D=c[n-15],Q=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3,D=c[n-2],u=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10,c[n]=c[n-16]+Q+c[n-7]+u<<0;for(o=A&_,n=0;n<64;n+=4)this.first?(this.is224?(k=300032,D=c[0]-1413257819,C=D-150054599<<0,t=D+24177077<<0):(k=704751109,D=c[0]-210244248,C=D-1521486534<<0,t=D+143694565<<0),this.first=!1):(Q=(g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10),u=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),k=g&A,f=k^g&_^o,m=a&I^~a&r,D=C+u+m+K[n]+c[n],l=Q+f,C=t+D<<0,t=D+l<<0),Q=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),u=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),b=t&g,f=b^t&A^k,m=C&a^~C&I,D=r+u+m+K[n+1]+c[n+1],l=Q+f,r=_+D<<0,_=D+l<<0,Q=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),u=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),F=_&t,f=F^_&g^b,m=r&C^~r&a,D=I+u+m+K[n+2]+c[n+2],l=Q+f,I=A+D<<0,A=D+l<<0,Q=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),u=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),o=A&_,f=o^A&t^F,m=I&r^~I&C,D=a+u+m+K[n+3]+c[n+3],l=Q+f,a=g+D<<0,g=D+l<<0;this.h0=this.h0+g<<0,this.h1=this.h1+A<<0,this.h2=this.h2+_<<0,this.h3=this.h3+t<<0,this.h4=this.h4+a<<0,this.h5=this.h5+I<<0,this.h6=this.h6+r<<0,this.h7=this.h7+C<<0},Sha256.prototype.hex=function(){this.finalize();var g=this.h0,A=this.h1,_=this.h2,t=this.h3,a=this.h4,I=this.h5,r=this.h6,C=this.h7,c=HEX_CHARS[g>>28&15]+HEX_CHARS[g>>24&15]+HEX_CHARS[g>>20&15]+HEX_CHARS[g>>16&15]+HEX_CHARS[g>>12&15]+HEX_CHARS[g>>8&15]+HEX_CHARS[g>>4&15]+HEX_CHARS[g&15]+HEX_CHARS[A>>28&15]+HEX_CHARS[A>>24&15]+HEX_CHARS[A>>20&15]+HEX_CHARS[A>>16&15]+HEX_CHARS[A>>12&15]+HEX_CHARS[A>>8&15]+HEX_CHARS[A>>4&15]+HEX_CHARS[A&15]+HEX_CHARS[_>>28&15]+HEX_CHARS[_>>24&15]+HEX_CHARS[_>>20&15]+HEX_CHARS[_>>16&15]+HEX_CHARS[_>>12&15]+HEX_CHARS[_>>8&15]+HEX_CHARS[_>>4&15]+HEX_CHARS[_&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[I>>28&15]+HEX_CHARS[I>>24&15]+HEX_CHARS[I>>20&15]+HEX_CHARS[I>>16&15]+HEX_CHARS[I>>12&15]+HEX_CHARS[I>>8&15]+HEX_CHARS[I>>4&15]+HEX_CHARS[I&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15];return this.is224||(c+=HEX_CHARS[C>>28&15]+HEX_CHARS[C>>24&15]+HEX_CHARS[C>>20&15]+HEX_CHARS[C>>16&15]+HEX_CHARS[C>>12&15]+HEX_CHARS[C>>8&15]+HEX_CHARS[C>>4&15]+HEX_CHARS[C&15]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var g=this.h0,A=this.h1,_=this.h2,t=this.h3,a=this.h4,I=this.h5,r=this.h6,C=this.h7,c=[g>>24&255,g>>16&255,g>>8&255,g&255,A>>24&255,A>>16&255,A>>8&255,A&255,_>>24&255,_>>16&255,_>>8&255,_&255,t>>24&255,t>>16&255,t>>8&255,t&255,a>>24&255,a>>16&255,a>>8&255,a&255,I>>24&255,I>>16&255,I>>8&255,I&255,r>>24&255,r>>16&255,r>>8&255,r&255];return this.is224||c.push(C>>24&255,C>>16&255,C>>8&255,C&255),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var g=new ArrayBuffer(this.is224?28:32),A=new DataView(g);return A.setUint32(0,this.h0),A.setUint32(4,this.h1),A.setUint32(8,this.h2),A.setUint32(12,this.h3),A.setUint32(16,this.h4),A.setUint32(20,this.h5),A.setUint32(24,this.h6),this.is224||A.setUint32(28,this.h7),g};function HmacSha256(g,A,_){var t,a=typeof g;if(a==="string"){var I=[],r=g.length,C=0,c;for(t=0;t<r;++t)c=g.charCodeAt(t),c<128?I[C++]=c:c<2048?(I[C++]=192|c>>6,I[C++]=128|c&63):c<55296||c>=57344?(I[C++]=224|c>>12,I[C++]=128|c>>6&63,I[C++]=128|c&63):(c=65536+((c&1023)<<10|g.charCodeAt(++t)&1023),I[C++]=240|c>>18,I[C++]=128|c>>12&63,I[C++]=128|c>>6&63,I[C++]=128|c&63);g=I}else if(a==="object"){if(g===null)throw new Error(ERROR);if(ARRAY_BUFFER&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(g)))throw new Error(ERROR)}else throw new Error(ERROR);g.length>64&&(g=new Sha256(A,!0).update(g).array());var n=[],Q=[];for(t=0;t<64;++t){var u=g[t]||0;n[t]=92^u,Q[t]=54^u}Sha256.call(this,A,_),this.update(Q),this.oKeyPad=n,this.inner=!0,this.sharedMemory=_}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var g=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(g),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var oQ=Cg((KR,Af)=>{var Dh="Input must be an string, Buffer or Uint8Array";function wh(g){let A;if(g instanceof Uint8Array)A=g;else if(typeof g=="string")A=new TextEncoder().encode(g);else throw new Error(Dh);return A}function mh(g){return Array.prototype.map.call(g,function(A){return(A<16?"0":"")+A.toString(16)}).join("")}function XC(g){return(4294967296+g).toString(16).substring(1)}function yh(g,A,_){let t=` `+g+" = ";for(let a=0;a<A.length;a+=2){if(_===32)t+=XC(A[a]).toUpperCase(),t+=" ",t+=XC(A[a+1]).toUpperCase();else if(_===64)t+=XC(A[a+1]).toUpperCase(),t+=XC(A[a]).toUpperCase();else throw new Error("Invalid size "+_);a%6===4?t+=` `+new Array(g.length+4).join(" "):a<A.length-2&&(t+=" ")}console.log(t)}function ph(g,A,_){let t=new Date().getTime(),a=new Uint8Array(A);for(let r=0;r<A;r++)a[r]=r%256;let I=new Date().getTime();console.log("Generated random input in "+(I-t)+"ms"),t=I;for(let r=0;r<_;r++){let C=g(a),c=new Date().getTime(),n=c-t;t=c,console.log("Hashed in "+n+"ms: "+C.substring(0,20)+"..."),console.log(Math.round(A/(1<<20)/(n/1e3)*100)/100+" MB PER SECOND")}}Af.exports={normalizeInput:wh,toHex:mh,debugPrint:yh,testSpeed:ph}});var cf=Cg((vR,Cf)=>{var _c=oQ();function Ac(g,A,_){let t=g[A]+g[_],a=g[A+1]+g[_+1];t>=4294967296&&a++,g[A]=t,g[A+1]=a}function _f(g,A,_,t){let a=g[A]+_;_<0&&(a+=4294967296);let I=g[A+1]+t;a>=4294967296&&I++,g[A]=a,g[A+1]=I}function gf(g,A){return g[A]^g[A+1]<<8^g[A+2]<<16^g[A+3]<<24}function we(g,A,_,t,a,I){let r=Hr[a],C=Hr[a+1],c=Hr[I],n=Hr[I+1];Ac(xA,g,A),_f(xA,g,r,C);let Q=xA[t]^xA[g],u=xA[t+1]^xA[g+1];xA[t]=u,xA[t+1]=Q,Ac(xA,_,t),Q=xA[A]^xA[_],u=xA[A+1]^xA[_+1],xA[A]=Q>>>24^u<<8,xA[A+1]=u>>>24^Q<<8,Ac(xA,g,A),_f(xA,g,c,n),Q=xA[t]^xA[g],u=xA[t+1]^xA[g+1],xA[t]=Q>>>16^u<<16,xA[t+1]=u>>>16^Q<<16,Ac(xA,_,t),Q=xA[A]^xA[_],u=xA[A+1]^xA[_+1],xA[A]=u>>>31^Q<<1,xA[A+1]=Q>>>31^u<<1}var tf=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),dh=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],Fg=new Uint8Array(dh.map(function(g){return g*2})),xA=new Uint32Array(32),Hr=new Uint32Array(32);function af(g,A){let _=0;for(_=0;_<16;_++)xA[_]=g.h[_],xA[_+16]=tf[_];for(xA[24]=xA[24]^g.t,xA[25]=xA[25]^g.t/4294967296,A&&(xA[28]=~xA[28],xA[29]=~xA[29]),_=0;_<32;_++)Hr[_]=gf(g.b,4*_);for(_=0;_<12;_++)we(0,8,16,24,Fg[_*16+0],Fg[_*16+1]),we(2,10,18,26,Fg[_*16+2],Fg[_*16+3]),we(4,12,20,28,Fg[_*16+4],Fg[_*16+5]),we(6,14,22,30,Fg[_*16+6],Fg[_*16+7]),we(0,10,20,30,Fg[_*16+8],Fg[_*16+9]),we(2,12,22,24,Fg[_*16+10],Fg[_*16+11]),we(4,14,16,26,Fg[_*16+12],Fg[_*16+13]),we(6,8,18,28,Fg[_*16+14],Fg[_*16+15]);for(_=0;_<16;_++)g.h[_]=g.h[_]^xA[_]^xA[_+16]}var me=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function ef(g,A,_,t){if(g===0||g>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(A&&A.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(_&&_.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(t&&t.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");let a={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:g};me.fill(0),me[0]=g,A&&(me[1]=A.length),me[2]=1,me[3]=1,_&&me.set(_,32),t&&me.set(t,48);for(let I=0;I<16;I++)a.h[I]=tf[I]^gf(me,I*4);return A&&(QQ(a,A),a.c=128),a}function QQ(g,A){for(let _=0;_<A.length;_++)g.c===128&&(g.t+=g.c,af(g,!1),g.c=0),g.b[g.c++]=A[_]}function If(g){for(g.t+=g.c;g.c<128;)g.b[g.c++]=0;af(g,!0);let A=new Uint8Array(g.outlen);for(let _=0;_<g.outlen;_++)A[_]=g.h[_>>2]>>8*(_&3);return A}function rf(g,A,_,t,a){_=_||64,g=_c.normalizeInput(g),t&&(t=_c.normalizeInput(t)),a&&(a=_c.normalizeInput(a));let I=ef(_,A,t,a);return QQ(I,g),If(I)}function kh(g,A,_,t,a){let I=rf(g,A,_,t,a);return _c.toHex(I)}Cf.exports={blake2b:rf,blake2bHex:kh,blake2bInit:ef,blake2bUpdate:QQ,blake2bFinal:If}});var uf=Cg((qR,Ef)=>{var nf=oQ();function Fh(g,A){return g[A]^g[A+1]<<8^g[A+2]<<16^g[A+3]<<24}function ye(g,A,_,t,a,I){g_[g]=g_[g]+g_[A]+a,g_[t]=gc(g_[t]^g_[g],16),g_[_]=g_[_]+g_[t],g_[A]=gc(g_[A]^g_[_],12),g_[g]=g_[g]+g_[A]+I,g_[t]=gc(g_[t]^g_[g],8),g_[_]=g_[_]+g_[t],g_[A]=gc(g_[A]^g_[_],7)}function gc(g,A){return g>>>A^g<<32-A}var Bf=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hg=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),g_=new Uint32Array(16),Qg=new Uint32Array(16);function of(g,A){let _=0;for(_=0;_<8;_++)g_[_]=g.h[_],g_[_+8]=Bf[_];for(g_[12]^=g.t,g_[13]^=g.t/4294967296,A&&(g_[14]=~g_[14]),_=0;_<16;_++)Qg[_]=Fh(g.b,4*_);for(_=0;_<10;_++)ye(0,4,8,12,Qg[hg[_*16+0]],Qg[hg[_*16+1]]),ye(1,5,9,13,Qg[hg[_*16+2]],Qg[hg[_*16+3]]),ye(2,6,10,14,Qg[hg[_*16+4]],Qg[hg[_*16+5]]),ye(3,7,11,15,Qg[hg[_*16+6]],Qg[hg[_*16+7]]),ye(0,5,10,15,Qg[hg[_*16+8]],Qg[hg[_*16+9]]),ye(1,6,11,12,Qg[hg[_*16+10]],Qg[hg[_*16+11]]),ye(2,7,8,13,Qg[hg[_*16+12]],Qg[hg[_*16+13]]),ye(3,4,9,14,Qg[hg[_*16+14]],Qg[hg[_*16+15]]);for(_=0;_<8;_++)g.h[_]^=g_[_]^g_[_+8]}function Qf(g,A){if(!(g>0&&g<=32))throw new Error("Incorrect output length, should be in [1, 32]");let _=A?A.length:0;if(A&&!(_>0&&_<=32))throw new Error("Incorrect key length, should be in [1, 32]");let t={h:new Uint32Array(Bf),b:new Uint8Array(64),c:0,t:0,outlen:g};return t.h[0]^=16842752^_<<8^g,_>0&&(sQ(t,A),t.c=64),t}function sQ(g,A){for(let _=0;_<A.length;_++)g.c===64&&(g.t+=g.c,of(g,!1),g.c=0),g.b[g.c++]=A[_]}function sf(g){for(g.t+=g.c;g.c<64;)g.b[g.c++]=0;of(g,!0);let A=new Uint8Array(g.outlen);for(let _=0;_<g.outlen;_++)A[_]=g.h[_>>2]>>8*(_&3)&255;return A}function lf(g,A,_){_=_||32,g=nf.normalizeInput(g);let t=Qf(_,A);return sQ(t,g),sf(t)}function hh(g,A,_){let t=lf(g,A,_);return nf.toHex(t)}Ef.exports={blake2s:lf,blake2sHex:hh,blake2sInit:Qf,blake2sUpdate:sQ,blake2sFinal:sf}});var Df=Cg((RR,ff)=>{var zr=cf(),Vr=uf();ff.exports={blake2b:zr.blake2b,blake2bHex:zr.blake2bHex,blake2bInit:zr.blake2bInit,blake2bUpdate:zr.blake2bUpdate,blake2bFinal:zr.blake2bFinal,blake2s:Vr.blake2s,blake2sHex:Vr.blake2sHex,blake2sInit:Vr.blake2sInit,blake2sUpdate:Vr.blake2sUpdate,blake2sFinal:Vr.blake2sFinal}});var pn=Cg((fl,Rw)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],A):typeof fl=="object"?Rw.exports=A():g.StackFrame=A()})(fl,function(){"use strict";function g(D){return!isNaN(parseFloat(D))&&isFinite(D)}function A(D){return D.charAt(0).toUpperCase()+D.substring(1)}function _(D){return function(){return this[D]}}var t=["isConstructor","isEval","isNative","isToplevel"],a=["columnNumber","lineNumber"],I=["fileName","functionName","source"],r=["args"],C=["evalOrigin"],c=t.concat(a,I,r,C);function n(D){if(D)for(var l=0;l<c.length;l++)D[c[l]]!==void 0&&this["set"+A(c[l])](D[c[l]])}n.prototype={getArgs:function(){return this.args},setArgs:function(D){if(Object.prototype.toString.call(D)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=D},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(D){if(D instanceof n)this.evalOrigin=D;else if(D instanceof Object)this.evalOrigin=new n(D);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var D=this.getFileName()||"",l=this.getLineNumber()||"",m=this.getColumnNumber()||"",k=this.getFunctionName()||"";return this.getIsEval()?D?"[eval] ("+D+":"+l+":"+m+")":"[eval]:"+l+":"+m:k?k+" ("+D+":"+l+":"+m+")":D+":"+l+":"+m}},n.fromString=function(l){var m=l.indexOf("("),k=l.lastIndexOf(")"),b=l.substring(0,m),F=l.substring(m+1,k).split(","),o=l.substring(k+1);if(o.indexOf("@")===0)var w=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),y=w[1],M=w[2],x=w[3];return new n({functionName:b,args:F||void 0,fileName:y,lineNumber:M||void 0,columnNumber:x||void 0})};for(var Q=0;Q<t.length;Q++)n.prototype["get"+A(t[Q])]=_(t[Q]),n.prototype["set"+A(t[Q])]=function(D){return function(l){this[D]=!!l}}(t[Q]);for(var u=0;u<a.length;u++)n.prototype["get"+A(a[u])]=_(a[u]),n.prototype["set"+A(a[u])]=function(D){return function(l){if(!g(l))throw new TypeError(D+" must be a Number");this[D]=Number(l)}}(a[u]);for(var f=0;f<I.length;f++)n.prototype["get"+A(I[f])]=_(I[f]),n.prototype["set"+A(I[f])]=function(D){return function(l){this[D]=String(l)}}(I[f]);return n})});var Uw=Cg((Dl,Yw)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],A):typeof Dl=="object"?Yw.exports=A(pn()):g.ErrorStackParser=A(g.StackFrame)})(Dl,function(A){"use strict";var _=/(^|@)\S+:\d+/,t=/^\s*at .*(\S+:\d+|\(native\))/m,a=/^(eval@)?(\[native code])?$/;return{parse:function(r){if(typeof r.stacktrace<"u"||typeof r["opera#sourceloc"]<"u")return this.parseOpera(r);if(r.stack&&r.stack.match(t))return this.parseV8OrIE(r);if(r.stack)return this.parseFFOrSafari(r);throw new Error("Cannot parse given Error object")},extractLocation:function(r){if(r.indexOf(":")===-1)return[r];var C=/(.+?)(?::(\d+))?(?::(\d+))?$/,c=C.exec(r.replace(/[()]/g,""));return[c[1],c[2]||void 0,c[3]||void 0]},parseV8OrIE:function(r){var C=r.stack.split(` `).filter(function(c){return!!c.match(t)},this);return C.map(function(c){c.indexOf("(eval ")>-1&&(c=c.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=c.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),Q=n.match(/ (\(.+\)$)/);n=Q?n.replace(Q[0],""):n;var u=this.extractLocation(Q?Q[1]:n),f=Q&&n||void 0,D=["eval","<anonymous>"].indexOf(u[0])>-1?void 0:u[0];return new A({functionName:f,fileName:D,lineNumber:u[1],columnNumber:u[2],source:c})},this)},parseFFOrSafari:function(r){var C=r.stack.split(` `).filter(function(c){return!c.match(a)},this);return C.map(function(c){if(c.indexOf(" > eval")>-1&&(c=c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),c.indexOf("@")===-1&&c.indexOf(":")===-1)return new A({functionName:c});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,Q=c.match(n),u=Q&&Q[1]?Q[1]:void 0,f=this.extractLocation(c.replace(n,""));return new A({functionName:u,fileName:f[0],lineNumber:f[1],columnNumber:f[2],source:c})},this)},parseOpera:function(r){return!r.stacktrace||r.message.indexOf(` `)>-1&&r.message.split(` `).length>r.stacktrace.split(` `).length?this.parseOpera9(r):r.stack?this.parseOpera11(r):this.parseOpera10(r)},parseOpera9:function(r){for(var C=/Line (\d+).*script (?:in )?(\S+)/i,c=r.message.split(` `),n=[],Q=2,u=c.length;Q<u;Q+=2){var f=C.exec(c[Q]);f&&n.push(new A({fileName:f[2],lineNumber:f[1],source:c[Q]}))}return n},parseOpera10:function(r){for(var C=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,c=r.stacktrace.split(` `),n=[],Q=0,u=c.length;Q<u;Q+=2){var f=C.exec(c[Q]);f&&n.push(new A({functionName:f[3]||void 0,fileName:f[2],lineNumber:f[1],source:c[Q]}))}return n},parseOpera11:function(r){var C=r.stack.split(` `).filter(function(c){return!!c.match(_)&&!c.match(/^Error created at/)},this);return C.map(function(c){var n=c.split("@"),Q=this.extractLocation(n.pop()),u=n.shift()||"",f=u.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,D;u.match(/\(([^)]*)\)/)&&(D=u.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var l=D===void 0||D==="[arguments not available]"?void 0:D.split(",");return new A({functionName:f,args:l,fileName:Q[0],lineNumber:Q[1],columnNumber:Q[2],source:c})},this)}}})});var Jw=Cg((wl,Sw)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stack-generator",["stackframe"],A):typeof wl=="object"?Sw.exports=A(pn()):g.StackGenerator=A(g.StackFrame)})(wl,function(g){return{backtrace:function(_){var t=[],a=10;typeof _=="object"&&typeof _.maxStackSize=="number"&&(a=_.maxStackSize);for(var I=arguments.callee;I&&t.length<a&&I.arguments;){for(var r=new Array(I.arguments.length),C=0;C<r.length;++C)r[C]=I.arguments[C];/function(?:\s+([\w$]+))+\s*\(/.test(I.toString())?t.push(new g({functionName:RegExp.$1||void 0,args:r})):t.push(new g({args:r}));try{I=I.caller}catch{break}}return t}}})});var ml=Cg(_t=>{function mG(g,A,_){if(A in g)return g[A];if(arguments.length===3)return _;throw new Error('"'+A+'" is a required argument.')}_t.getArg=mG;var jw=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,yG=/^data:.+\,.+$/;function dn(g){var A=g.match(jw);return A?{scheme:A[1],auth:A[2],host:A[3],port:A[4],path:A[5]}:null}_t.urlParse=dn;function Fi(g){var A="";return g.scheme&&(A+=g.scheme+":"),A+="//",g.auth&&(A+=g.auth+"@"),g.host&&(A+=g.host),g.port&&(A+=":"+g.port),g.path&&(A+=g.path),A}_t.urlGenerate=Fi;function Hw(g){var A=g,_=dn(g);if(_){if(!_.path)return g;A=_.path}for(var t=_t.isAbsolute(A),a=A.split(/\/+/),I,r=0,C=a.length-1;C>=0;C--)I=a[C],I==="."?a.splice(C,1):I===".."?r++:r>0&&(I===""?(a.splice(C+1,r),r=0):(a.splice(C,2),r--));return A=a.join("/"),A===""&&(A=t?"/":"."),_?(_.path=A,Fi(_)):A}_t.normalize=Hw;function pG(g,A){g===""&&(g="."),A===""&&(A=".");var _=dn(A),t=dn(g);if(t&&(g=t.path||"/"),_&&!_.scheme)return t&&(_.scheme=t.scheme),Fi(_);if(_||A.match(yG))return A;if(t&&!t.host&&!t.path)return t.host=A,Fi(t);var a=A.charAt(0)==="/"?A:Hw(g.replace(/\/+$/,"")+"/"+A);return t?(t.path=a,Fi(t)):a}_t.join=pG;_t.isAbsolute=function(g){return g.charAt(0)==="/"||!!g.match(jw)};function dG(g,A){g===""&&(g="."),g=g.replace(/\/$/,"");for(var _=0;A.indexOf(g+"/")!==0;){var t=g.lastIndexOf("/");if(t<0||(g=g.slice(0,t),g.match(/^([^\/]+:\/)?\/*$/)))return A;++_}return Array(_+1).join("../")+A.substr(g.length+1)}_t.relative=dG;var zw=function(){var g=Object.create(null);return!("__proto__"in g)}();function Vw(g){return g}function kG(g){return Pw(g)?"$"+g:g}_t.toSetString=zw?Vw:kG;function FG(g){return Pw(g)?g.slice(1):g}_t.fromSetString=zw?Vw:FG;function Pw(g){if(!g)return!1;var A=g.length;if(A<9||g.charCodeAt(A-1)!==95||g.charCodeAt(A-2)!==95||g.charCodeAt(A-3)!==111||g.charCodeAt(A-4)!==116||g.charCodeAt(A-5)!==111||g.charCodeAt(A-6)!==114||g.charCodeAt(A-7)!==112||g.charCodeAt(A-8)!==95||g.charCodeAt(A-9)!==95)return!1;for(var _=A-10;_>=0;_--)if(g.charCodeAt(_)!==36)return!1;return!0}function hG(g,A,_){var t=g.source-A.source;return t!==0||(t=g.originalLine-A.originalLine,t!==0)||(t=g.originalColumn-A.originalColumn,t!==0||_)||(t=g.generatedColumn-A.generatedColumn,t!==0)||(t=g.generatedLine-A.generatedLine,t!==0)?t:g.name-A.name}_t.compareByOriginalPositions=hG;function bG(g,A,_){var t=g.generatedLine-A.generatedLine;return t!==0||(t=g.generatedColumn-A.generatedColumn,t!==0||_)||(t=g.source-A.source,t!==0)||(t=g.originalLine-A.originalLine,t!==0)||(t=g.originalColumn-A.originalColumn,t!==0)?t:g.name-A.name}_t.compareByGeneratedPositionsDeflated=bG;function Lw(g,A){return g===A?0:g>A?1:-1}function NG(g,A){var _=g.generatedLine-A.generatedLine;return _!==0||(_=g.generatedColumn-A.generatedColumn,_!==0)||(_=Lw(g.source,A.source),_!==0)||(_=g.originalLine-A.originalLine,_!==0)||(_=g.originalColumn-A.originalColumn,_!==0)?_:Lw(g.name,A.name)}_t.compareByGeneratedPositionsInflated=NG});var Ww=Cg(KI=>{KI.GREATEST_LOWER_BOUND=1;KI.LEAST_UPPER_BOUND=2;function yl(g,A,_,t,a,I){var r=Math.floor((A-g)/2)+g,C=a(_,t[r],!0);return C===0?r:C>0?A-r>1?yl(r,A,_,t,a,I):I==KI.LEAST_UPPER_BOUND?A<t.length?A:-1:r:r-g>1?yl(g,r,_,t,a,I):I==KI.LEAST_UPPER_BOUND?r:g<0?-1:g}KI.search=function(A,_,t,a){if(_.length===0)return-1;var I=yl(-1,_.length,A,_,t,a||KI.GREATEST_LOWER_BOUND);if(I<0)return-1;for(;I-1>=0&&t(_[I],_[I-1],!0)===0;)--I;return I}});var Zw=Cg(Tw=>{var pl=ml(),dl=Object.prototype.hasOwnProperty;function ae(){this._array=[],this._set=Object.create(null)}ae.fromArray=function(A,_){for(var t=new ae,a=0,I=A.length;a<I;a++)t.add(A[a],_);return t};ae.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length};ae.prototype.add=function(A,_){var t=pl.toSetString(A),a=dl.call(this._set,t),I=this._array.length;(!a||_)&&this._array.push(A),a||(this._set[t]=I)};ae.prototype.has=function(A){var _=pl.toSetString(A);return dl.call(this._set,_)};ae.prototype.indexOf=function(A){var _=pl.toSetString(A);if(dl.call(this._set,_))return this._set[_];throw new Error('"'+A+'" is not in the set.')};ae.prototype.at=function(A){if(A>=0&&A<this._array.length)return this._array[A];throw new Error("No element indexed by "+A)};ae.prototype.toArray=function(){return this._array.slice()};Tw.ArraySet=ae});var Xw=Cg(kl=>{var Ow="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");kl.encode=function(g){if(0<=g&&g<Ow.length)return Ow[g];throw new TypeError("Must be between 0 and 63: "+g)};kl.decode=function(g){var A=65,_=90,t=97,a=122,I=48,r=57,C=43,c=47,n=26,Q=52;return A<=g&&g<=_?g-A:t<=g&&g<=a?g-t+n:I<=g&&g<=r?g-I+Q:g==C?62:g==c?63:-1}});var am=Cg(hl=>{var Am=Xw(),Fl=5,_m=1<<Fl,gm=_m-1,tm=_m;function GG(g){return g<0?(-g<<1)+1:(g<<1)+0}function MG(g){var A=(g&1)===1,_=g>>1;return A?-_:_}hl.encode=function(A){var _="",t,a=GG(A);do t=a&gm,a>>>=Fl,a>0&&(t|=tm),_+=Am.encode(t);while(a>0);return _};hl.decode=function(A,_,t){var a=A.length,I=0,r=0,C,c;do{if(_>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(c=Am.decode(A.charCodeAt(_++)),c===-1)throw new Error("Invalid base64 digit: "+A.charAt(_-1));C=!!(c&tm),c&=gm,I=I+(c<<r),r+=Fl}while(C);t.value=MG(I),t.rest=_}});var Im=Cg(em=>{function bl(g,A,_){var t=g[A];g[A]=g[_],g[_]=t}function xG(g,A){return Math.round(g+Math.random()*(A-g))}function Nl(g,A,_,t){if(_<t){var a=xG(_,t),I=_-1;bl(g,a,t);for(var r=g[t],C=_;C<t;C++)A(g[C],r)<=0&&(I+=1,bl(g,I,C));bl(g,I+1,C);var c=I+1;Nl(g,A,_,c-1),Nl(g,A,c+1,t)}}em.quickSort=function(g,A){Nl(g,A,0,g.length-1)}});var im=Cg(kn=>{var lA=ml(),Gl=Ww(),U0=Zw().ArraySet,$G=am(),hi=Im().quickSort;function F_(g){var A=g;return typeof g=="string"&&(A=JSON.parse(g.replace(/^\)\]\}'/,""))),A.sections!=null?new Vt(A):new Mg(A)}F_.fromSourceMap=function(g){return Mg.fromSourceMap(g)};F_.prototype._version=3;F_.prototype.__generatedMappings=null;Object.defineProperty(F_.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});F_.prototype.__originalMappings=null;Object.defineProperty(F_.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});F_.prototype._charIsMappingSeparator=function(A,_){var t=A.charAt(_);return t===";"||t===","};F_.prototype._parseMappings=function(A,_){throw new Error("Subclasses must implement _parseMappings")};F_.GENERATED_ORDER=1;F_.ORIGINAL_ORDER=2;F_.GREATEST_LOWER_BOUND=1;F_.LEAST_UPPER_BOUND=2;F_.prototype.eachMapping=function(A,_,t){var a=_||null,I=t||F_.GENERATED_ORDER,r;switch(I){case F_.GENERATED_ORDER:r=this._generatedMappings;break;case F_.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var C=this.sourceRoot;r.map(function(c){var n=c.source===null?null:this._sources.at(c.source);return n!=null&&C!=null&&(n=lA.join(C,n)),{source:n,generatedLine:c.generatedLine,generatedColumn:c.generatedColumn,originalLine:c.originalLine,originalColumn:c.originalColumn,name:c.name===null?null:this._names.at(c.name)}},this).forEach(A,a)};F_.prototype.allGeneratedPositionsFor=function(A){var _=lA.getArg(A,"line"),t={source:lA.getArg(A,"source"),originalLine:_,originalColumn:lA.getArg(A,"column",0)};if(this.sourceRoot!=null&&(t.source=lA.relative(this.sourceRoot,t.source)),!this._sources.has(t.source))return[];t.source=this._sources.indexOf(t.source);var a=[],I=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",lA.compareByOriginalPositions,Gl.LEAST_UPPER_BOUND);if(I>=0){var r=this._originalMappings[I];if(A.column===void 0)for(var C=r.originalLine;r&&r.originalLine===C;)a.push({line:lA.getArg(r,"generatedLine",null),column:lA.getArg(r,"generatedColumn",null),lastColumn:lA.getArg(r,"lastGeneratedColumn",null)}),r=this._originalMappings[++I];else for(var c=r.originalColumn;r&&r.originalLine===_&&r.originalColumn==c;)a.push({line:lA.getArg(r,"generatedLine",null),column:lA.getArg(r,"generatedColumn",null),lastColumn:lA.getArg(r,"lastGeneratedColumn",null)}),r=this._originalMappings[++I]}return a};kn.SourceMapConsumer=F_;function Mg(g){var A=g;typeof g=="string"&&(A=JSON.parse(g.replace(/^\)\]\}'/,"")));var _=lA.getArg(A,"version"),t=lA.getArg(A,"sources"),a=lA.getArg(A,"names",[]),I=lA.getArg(A,"sourceRoot",null),r=lA.getArg(A,"sourcesContent",null),C=lA.getArg(A,"mappings"),c=lA.getArg(A,"file",null);if(_!=this._version)throw new Error("Unsupported version: "+_);t=t.map(String).map(lA.normalize).map(function(n){return I&&lA.isAbsolute(I)&&lA.isAbsolute(n)?lA.relative(I,n):n}),this._names=U0.fromArray(a.map(String),!0),this._sources=U0.fromArray(t,!0),this.sourceRoot=I,this.sourcesContent=r,this._mappings=C,this.file=c}Mg.prototype=Object.create(F_.prototype);Mg.prototype.consumer=F_;Mg.fromSourceMap=function(A){var _=Object.create(Mg.prototype),t=_._names=U0.fromArray(A._names.toArray(),!0),a=_._sources=U0.fromArray(A._sources.toArray(),!0);_.sourceRoot=A._sourceRoot,_.sourcesContent=A._generateSourcesContent(_._sources.toArray(),_.sourceRoot),_.file=A._file;for(var I=A._mappings.toArray().slice(),r=_.__generatedMappings=[],C=_.__originalMappings=[],c=0,n=I.length;c<n;c++){var Q=I[c],u=new rm;u.generatedLine=Q.generatedLine,u.generatedColumn=Q.generatedColumn,Q.source&&(u.source=a.indexOf(Q.source),u.originalLine=Q.originalLine,u.originalColumn=Q.originalColumn,Q.name&&(u.name=t.indexOf(Q.name)),C.push(u)),r.push(u)}return hi(_.__originalMappings,lA.compareByOriginalPositions),_};Mg.prototype._version=3;Object.defineProperty(Mg.prototype,"sources",{get:function(){return this._sources.toArray().map(function(g){return this.sourceRoot!=null?lA.join(this.sourceRoot,g):g},this)}});function rm(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Mg.prototype._parseMappings=function(A,_){for(var t=1,a=0,I=0,r=0,C=0,c=0,n=A.length,Q=0,u={},f={},D=[],l=[],m,k,b,F,o;Q<n;)if(A.charAt(Q)===";")t++,Q++,a=0;else if(A.charAt(Q)===",")Q++;else{for(m=new rm,m.generatedLine=t,F=Q;F<n&&!this._charIsMappingSeparator(A,F);F++);if(k=A.slice(Q,F),b=u[k],b)Q+=k.length;else{for(b=[];Q<F;)$G.decode(A,Q,f),o=f.value,Q=f.rest,b.push(o);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");u[k]=b}m.generatedColumn=a+b[0],a=m.generatedColumn,b.length>1&&(m.source=C+b[1],C+=b[1],m.originalLine=I+b[2],I=m.originalLine,m.originalLine+=1,m.originalColumn=r+b[3],r=m.originalColumn,b.length>4&&(m.name=c+b[4],c+=b[4])),l.push(m),typeof m.originalLine=="number"&&D.push(m)}hi(l,lA.compareByGeneratedPositionsDeflated),this.__generatedMappings=l,hi(D,lA.compareByOriginalPositions),this.__originalMappings=D};Mg.prototype._findMapping=function(A,_,t,a,I,r){if(A[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+A[t]);if(A[a]<0)throw new TypeError("Column must be greater than or equal to 0, got "+A[a]);return Gl.search(A,_,I,r)};Mg.prototype.computeColumnSpans=function(){for(var A=0;A<this._generatedMappings.length;++A){var _=this._generatedMappings[A];if(A+1<this._generatedMappings.length){var t=this._generatedMappings[A+1];if(_.generatedLine===t.generatedLine){_.lastGeneratedColumn=t.generatedColumn-1;continue}}_.lastGeneratedColumn=1/0}};Mg.prototype.originalPositionFor=function(A){var _={generatedLine:lA.getArg(A,"line"),generatedColumn:lA.getArg(A,"column")},t=this._findMapping(_,this._generatedMappings,"generatedLine","generatedColumn",lA.compareByGeneratedPositionsDeflated,lA.getArg(A,"bias",F_.GREATEST_LOWER_BOUND));if(t>=0){var a=this._generatedMappings[t];if(a.generatedLine===_.generatedLine){var I=lA.getArg(a,"source",null);I!==null&&(I=this._sources.at(I),this.sourceRoot!=null&&(I=lA.join(this.sourceRoot,I)));var r=lA.getArg(a,"name",null);return r!==null&&(r=this._names.at(r)),{source:I,line:lA.getArg(a,"originalLine",null),column:lA.getArg(a,"originalColumn",null),name:r}}}return{source:null,line:null,column:null,name:null}};Mg.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(A){return A==null}):!1};Mg.prototype.sourceContentFor=function(A,_){if(!this.sourcesContent)return null;if(this.sourceRoot!=null&&(A=lA.relative(this.sourceRoot,A)),this._sources.has(A))return this.sourcesContent[this._sources.indexOf(A)];var t;if(this.sourceRoot!=null&&(t=lA.urlParse(this.sourceRoot))){var a=A.replace(/^file:\/\//,"");if(t.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!t.path||t.path=="/")&&this._sources.has("/"+A))return this.sourcesContent[this._sources.indexOf("/"+A)]}if(_)return null;throw new Error('"'+A+'" is not in the SourceMap.')};Mg.prototype.generatedPositionFor=function(A){var _=lA.getArg(A,"source");if(this.sourceRoot!=null&&(_=lA.relative(this.sourceRoot,_)),!this._sources.has(_))return{line:null,column:null,lastColumn:null};_=this._sources.indexOf(_);var t={source:_,originalLine:lA.getArg(A,"line"),originalColumn:lA.getArg(A,"column")},a=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",lA.compareByOriginalPositions,lA.getArg(A,"bias",F_.GREATEST_LOWER_BOUND));if(a>=0){var I=this._originalMappings[a];if(I.source===t.source)return{line:lA.getArg(I,"generatedLine",null),column:lA.getArg(I,"generatedColumn",null),lastColumn:lA.getArg(I,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};kn.BasicSourceMapConsumer=Mg;function Vt(g){var A=g;typeof g=="string"&&(A=JSON.parse(g.replace(/^\)\]\}'/,"")));var _=lA.getArg(A,"version"),t=lA.getArg(A,"sections");if(_!=this._version)throw new Error("Unsupported version: "+_);this._sources=new U0,this._names=new U0;var a={line:-1,column:0};this._sections=t.map(function(I){if(I.url)throw new Error("Support for url field in sections not implemented.");var r=lA.getArg(I,"offset"),C=lA.getArg(r,"line"),c=lA.getArg(r,"column");if(C<a.line||C===a.line&&c<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=r,{generatedOffset:{generatedLine:C+1,generatedColumn:c+1},consumer:new F_(lA.getArg(I,"map"))}})}Vt.prototype=Object.create(F_.prototype);Vt.prototype.constructor=F_;Vt.prototype._version=3;Object.defineProperty(Vt.prototype,"sources",{get:function(){for(var g=[],A=0;A<this._sections.length;A++)for(var _=0;_<this._sections[A].consumer.sources.length;_++)g.push(this._sections[A].consumer.sources[_]);return g}});Vt.prototype.originalPositionFor=function(A){var _={generatedLine:lA.getArg(A,"line"),generatedColumn:lA.getArg(A,"column")},t=Gl.search(_,this._sections,function(I,r){var C=I.generatedLine-r.generatedOffset.generatedLine;return C||I.generatedColumn-r.generatedOffset.generatedColumn}),a=this._sections[t];return a?a.consumer.originalPositionFor({line:_.generatedLine-(a.generatedOffset.generatedLine-1),column:_.generatedColumn-(a.generatedOffset.generatedLine===_.generatedLine?a.generatedOffset.generatedColumn-1:0),bias:A.bias}):{source:null,line:null,column:null,name:null}};Vt.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(A){return A.consumer.hasContentsOfAllSources()})};Vt.prototype.sourceContentFor=function(A,_){for(var t=0;t<this._sections.length;t++){var a=this._sections[t],I=a.consumer.sourceContentFor(A,!0);if(I)return I}if(_)return null;throw new Error('"'+A+'" is not in the SourceMap.')};Vt.prototype.generatedPositionFor=function(A){for(var _=0;_<this._sections.length;_++){var t=this._sections[_];if(t.consumer.sources.indexOf(lA.getArg(A,"source"))!==-1){var a=t.consumer.generatedPositionFor(A);if(a){var I={line:a.line+(t.generatedOffset.generatedLine-1),column:a.column+(t.generatedOffset.generatedLine===a.line?t.generatedOffset.generatedColumn-1:0)};return I}}}return{line:null,column:null}};Vt.prototype._parseMappings=function(A,_){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var a=this._sections[t],I=a.consumer._generatedMappings,r=0;r<I.length;r++){var C=I[r],c=a.consumer._sources.at(C.source);a.consumer.sourceRoot!==null&&(c=lA.join(a.consumer.sourceRoot,c)),this._sources.add(c),c=this._sources.indexOf(c);var n=a.consumer._names.at(C.name);this._names.add(n),n=this._names.indexOf(n);var Q={source:c,generatedLine:C.generatedLine+(a.generatedOffset.generatedLine-1),generatedColumn:C.generatedColumn+(a.generatedOffset.generatedLine===C.generatedLine?a.generatedOffset.generatedColumn-1:0),originalLine:C.originalLine,originalColumn:C.originalColumn,name:n};this.__generatedMappings.push(Q),typeof Q.originalLine=="number"&&this.__originalMappings.push(Q)}hi(this.__generatedMappings,lA.compareByGeneratedPositionsDeflated),hi(this.__originalMappings,lA.compareByOriginalPositions)};kn.IndexedSourceMapConsumer=Vt});var cm=Cg((Ml,Cm)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stacktrace-gps",["source-map","stackframe"],A):typeof Ml=="object"?Cm.exports=A(im(),pn()):g.StackTraceGPS=A(g.SourceMap||g.sourceMap,g.StackFrame)})(Ml,function(g,A){"use strict";function _(Q){return new Promise(function(u,f){var D=new XMLHttpRequest;D.open("get",Q),D.onerror=f,D.onreadystatechange=function(){D.readyState===4&&(D.status>=200&&D.status<300||Q.substr(0,7)==="file://"&&D.responseText?u(D.responseText):f(new Error("HTTP status: "+D.status+" retrieving "+Q)))},D.send()})}function t(Q){if(typeof window<"u"&&window.atob)return window.atob(Q);throw new Error("You must supply a polyfill for window.atob in this environment")}function a(Q){if(typeof JSON<"u"&&JSON.parse)return JSON.parse(Q);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function I(Q,u){for(var f=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],D=Q.split(` `),l="",m=Math.min(u,20),k=0;k<m;++k){var b=D[u-k-1],F=b.indexOf("//");if(F>=0&&(b=b.substr(0,F)),b){l=b+l;for(var o=f.length,w=0;w<o;w++){var y=f[w].exec(l);if(y&&y[1])return y[1]}}}}function r(){if(typeof Object.defineProperty!="function"||typeof Object.create!="function")throw new Error("Unable to consume source maps in older browsers")}function C(Q){if(typeof Q!="object")throw new TypeError("Given StackFrame is not an object");if(typeof Q.fileName!="string")throw new TypeError("Given file name is not a String");if(typeof Q.lineNumber!="number"||Q.lineNumber%1!==0||Q.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if(typeof Q.columnNumber!="number"||Q.columnNumber%1!==0||Q.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function c(Q){for(var u=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/mg,f,D;D=u.exec(Q);)f=D[1];if(f)return f;throw new Error("sourceMappingURL not found")}function n(Q,u,f){return new Promise(function(D,l){var m=u.originalPositionFor({line:Q.lineNumber,column:Q.columnNumber});if(m.source){var k=u.sourceContentFor(m.source);k&&(f[m.source]=k),D(new A({functionName:m.name||Q.functionName,args:Q.args,fileName:m.source,lineNumber:m.line,columnNumber:m.column}))}else l(new Error("Could not get original source for given stackframe and source map"))})}return function Q(u){if(!(this instanceof Q))return new Q(u);u=u||{},this.sourceCache=u.sourceCache||{},this.sourceMapConsumerCache=u.sourceMapConsumerCache||{},this.ajax=u.ajax||_,this._atob=u.atob||t,this._get=function(D){return new Promise(function(l,m){var k=D.substr(0,5)==="data:";if(this.sourceCache[D])l(this.sourceCache[D]);else if(u.offline&&!k)m(new Error("Cannot make network requests in offline mode"));else if(k){var b=/^data:application\/json;([\w=:"-]+;)*base64,/,F=D.match(b);if(F){var o=F[0].length,w=D.substr(o),y=this._atob(w);this.sourceCache[D]=y,l(y)}else m(new Error("The encoding of the inline sourcemap is not supported"))}else{var M=this.ajax(D,{method:"get"});this.sourceCache[D]=M,M.then(l,m)}}.bind(this))},this._getSourceMapConsumer=function(D,l){return new Promise(function(m){if(this.sourceMapConsumerCache[D])m(this.sourceMapConsumerCache[D]);else{var k=new Promise(function(b,F){return this._get(D).then(function(o){typeof o=="string"&&(o=a(o.replace(/^\)\]\}'/,""))),typeof o.sourceRoot>"u"&&(o.sourceRoot=l),b(new g.SourceMapConsumer(o))}).catch(F)}.bind(this));this.sourceMapConsumerCache[D]=k,m(k)}}.bind(this))},this.pinpoint=function(D){return new Promise(function(l,m){this.getMappedLocation(D).then(function(k){function b(){l(k)}this.findFunctionName(k).then(l,b).catch(b)}.bind(this),m)}.bind(this))},this.findFunctionName=function(D){return new Promise(function(l,m){C(D),this._get(D.fileName).then(function(b){var F=D.lineNumber,o=D.columnNumber,w=I(b,F,o);l(w?new A({functionName:w,args:D.args,fileName:D.fileName,lineNumber:F,columnNumber:o}):D)},m).catch(m)}.bind(this))},this.getMappedLocation=function(D){return new Promise(function(l,m){r(),C(D);var k=this.sourceCache,b=D.fileName;this._get(b).then(function(F){var o=c(F),w=o.substr(0,5)==="data:",y=b.substring(0,b.lastIndexOf("/")+1);return o[0]!=="/"&&!w&&!/^https?:\/\/|^\/\//i.test(o)&&(o=y+o),this._getSourceMapConsumer(o,y).then(function(M){return n(D,M,k).then(l).catch(function(){l(D)})})}.bind(this),m).catch(m)}.bind(this))}}})});var Bm=Cg((xl,nm)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stacktrace",["error-stack-parser","stack-generator","stacktrace-gps"],A):typeof xl=="object"?nm.exports=A(Uw(),Jw(),cm()):g.StackTrace=A(g.ErrorStackParser,g.StackGenerator,g.StackTraceGPS)})(xl,function(A,_,t){var a={filter:function(n){return(n.functionName||"").indexOf("StackTrace$$")===-1&&(n.functionName||"").indexOf("ErrorStackParser$$")===-1&&(n.functionName||"").indexOf("StackTraceGPS$$")===-1&&(n.functionName||"").indexOf("StackGenerator$$")===-1},sourceCache:{}},I=function(){try{throw new Error}catch(Q){return Q}};function r(n,Q){var u={};return[n,Q].forEach(function(f){for(var D in f)Object.prototype.hasOwnProperty.call(f,D)&&(u[D]=f[D]);return u}),u}function C(n){return n.stack||n["opera#sourceloc"]}function c(n,Q){return typeof Q=="function"?n.filter(Q):n}return{get:function(Q){var u=I();return C(u)?this.fromError(u,Q):this.generateArtificially(Q)},getSync:function(Q){Q=r(a,Q);var u=I(),f=C(u)?A.parse(u):_.backtrace(Q);return c(f,Q.filter)},fromError:function(Q,u){u=r(a,u);var f=new t(u);return new Promise(function(D){var l=c(A.parse(Q),u.filter);D(Promise.all(l.map(function(m){return new Promise(function(k){function b(){k(m)}f.pinpoint(m).then(k,b).catch(b)})})))}.bind(this))},generateArtificially:function(Q){Q=r(a,Q);var u=_.backtrace(Q);return typeof Q.filter=="function"&&(u=u.filter(Q.filter)),Promise.resolve(u)},instrument:function(Q,u,f,D){if(typeof Q!="function")throw new Error("Cannot instrument non-function object");if(typeof Q.__stacktraceOriginalFn=="function")return Q;var l=function(){try{return this.get().then(u,f).catch(f),Q.apply(D||this,arguments)}catch(k){throw C(k)&&this.fromError(k).then(u,f).catch(f),k}}.bind(this);return l.__stacktraceOriginalFn=Q,l},deinstrument:function(Q){if(typeof Q!="function")throw new Error("Cannot de-instrument non-function object");return typeof Q.__stacktraceOriginalFn=="function"?Q.__stacktraceOriginalFn:Q},report:function(Q,u,f,D){return new Promise(function(l,m){var k=new XMLHttpRequest;if(k.onerror=m,k.onreadystatechange=function(){k.readyState===4&&(k.status>=200&&k.status<400?l(k.responseText):m(new Error("POST to "+u+" failed with status: "+k.status)))},k.open("post",u),k.setRequestHeader("Content-Type","application/json"),D&&typeof D.headers=="object"){var b=D.headers;for(var F in b)Object.prototype.hasOwnProperty.call(b,F)&&k.setRequestHeader(F,b[F])}var o={stack:Q};f!=null&&(o.message=f),k.send(JSON.stringify(o))})}}})});var R2=["o1js_node.bc.cjs","/builtin/","CatchAndPrettifyStacktrace"];function Ie(g){if(g=Y2(g),!(g instanceof Error)||!g.stack)return g;let _=g.stack.split(` `),t=[];for(let a=0;a<_.length;a++){if(R2.some(C=>_[a].includes(C)))continue;let r=U2(_[a]);t.push(r)}return g.stack=t.join(` `),g}async function Na(g){try{return await g}catch(A){throw Ie(A)}}function Y2(g){return g instanceof Error?g:Array.isArray(g)&&g[2]instanceof Error?g[2]:g}function U2(g){return g.includes("o1js")?S2(g):g.includes("opam")?J2(g):g.includes("workspace_root")?L2(g):g}function S2(g){let A=Tn(g);if(!A)return g;let _=A.indexOf("o1js");if(_===-1)return g;let t=g.slice(0,g.indexOf("(")+1),a=A.slice(_);return`${t}${a})`}function J2(g){let A=Tn(g);if(!A)return g;let _=A.indexOf("opam");if(_===-1)return g;let t=A.slice(_).split("/"),a=t.lastIndexOf("lib");if(a===-1)return g;let I=g.slice(0,g.indexOf("(")+1),r=t.slice(a+1);return r.unshift("ocaml"),`${I}${r.join("/")})`}function L2(g){let A=Tn(g);if(!A)return g;let _=A.indexOf("workspace_root");if(_===-1)return g;let t=A.slice(_).split("/"),a=g.slice(0,g.indexOf("(")+1),I=t.slice(_);return`${a}${I.join("/")})`}function Tn(g){let A=/\(([^)]+)\)/,_=g.match(A);if(_)return _[1]}function j2(g){return Error(`${g} This shouldn't have happened and indicates an internal bug.`)}function sA(g,A="Failed assertion."){if(!g)throw j2(A)}var Ga={map(g,A){return g.map(A)}},b_={map(g,A){return g.map(A)},fromArray(g,A){return sA(A.length===g,`Expected array of length ${g}, got ${A.length}`),A},hasLength(g,A){return A.length===g}};var yA={event:"MinaZkappEvent******",events:"MinaZkappEvents*****",sequenceEvents:"MinaZkappSeqEvents**",zkappBodyMainnet:"MainnetZkappBody****",zkappBodyTestnet:"TestnetZkappBody****",accountUpdateCons:"MinaAcctUpdateCons**",accountUpdateNode:"MinaAcctUpdateNode**",zkappMemo:"MinaZkappMemo*******",signatureMainnet:"MinaSignatureMainnet",signatureTestnet:"CodaSignature*******",zkappUri:"MinaZkappUri********",deriveTokenId:"MinaDeriveTokenId***",sideLoadedVK:"MinaSideLoadedVk****"},Hl={"CodaReceiptUC*******":["29302923594948293002713688606335806348158191518870781605