1import{_ as pe,du as X,aw as F,am as dr,$ as ct,aK as ae,cg as lr,dv as pr,cf as te,M as G,dw as yr,dx as fn,T as mr,dy as hr,dz as gr,cW as _r,bN as Re,dA as Kt,c4 as br,dB as wr,c9 as Xt,dC as Dn,dD as vr,dE as xr,dF as Er,Q as Or,cd as Pr,ce as Br,dG as Ar}from"./index-c2fc66f8.js";import{h as Sr}from"./hashTypedData-fc5ab6bd.js";import{g as Gr}from"./verifyHash-9d818d73.js";import{c as Lr,s as ut,p as Ur}from"./parseSignature-2702032d.js";var Je,k,Cn,fe,dn,kn,_t,Qt,bt,wt,Ue={},Fn=[],Ir=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Jt=Array.isArray;function se(e,t){for(var n in t)e[n]=t[n];return e}function Tn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Dr(e,t,n){var r,a,i,c={};for(i in t)i=="key"?r=t[i]:i=="ref"?a=t[i]:c[i]=t[i];if(arguments.length>2&&(c.children=arguments.length>3?Je.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)c[i]===void 0&&(c[i]=e.defaultProps[i]);return Ne(e,c,r,a,null)}function Ne(e,t,n,r,a){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:a??++Cn,__i:-1,__u:0};return a==null&&k.vnode!=null&&k.vnode(i),i}function et(e){return e.children}function He(e,t){this.props=e,this.context=t}function xe(e,t){if(t==null)return e.__?xe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?xe(e):null}function Nn(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Nn(e)}}function ln(e){(!e.__d&&(e.__d=!0)&&fe.push(e)&&!Me.__r++||dn!==k.debounceRendering)&&((dn=k.debounceRendering)||kn)(Me)}function Me(){var e,t,n,r,a,i,c,s;for(fe.sort(_t);e=fe.shift();)e.__d&&(t=fe.length,r=void 0,i=(a=(n=e).__v).__e,c=[],s=[],n.__P&&((r=se({},a)).__v=a.__v+1,k.vnode&&k.vnode(r),en(n.__P,r,a,n.__n,n.__P.namespaceURI,32&a.__u?[i]:null,c,i??xe(a),!!(32&a.__u),s),r.__v=a.__v,r.__.__k[r.__i]=r,Rn(c,r,s),r.__e!=i&&Nn(r)),fe.length>t&&fe.sort(_t));Me.__r=0}function Hn(e,t,n,r,a,i,c,s,o,f,m){var u,y,p,l,b,d=r&&r.__k||Fn,h=t.length;for(n.__d=o,Cr(n,t,d),o=n.__d,u=0;u<h;u++)(p=n.__k[u])!=null&&(y=p.__i===-1?Ue:d[p.__i]||Ue,p.__i=u,en(e,p,y,a,i,c,s,o,f,m),l=p.__e,p.ref&&y.ref!=p.ref&&(y.ref&&tn(y.ref,null,p),m.push(p.ref,p.__c||l,p)),b==null&&l!=null&&(b=l),65536&p.__u||y.__k===p.__k?o=Vn(p,o,e):typeof p.type=="function"&&p.__d!==void 0?o=p.__d:l&&(o=l.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=o,n.__e=b}function Cr(e,t,n){var r,a,i,c,s,o=t.length,f=n.length,m=f,u=0;for(e.__k=[],r=0;r<o;r++)(a=t[r])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=r+u,(a=e.__k[r]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Ne(null,a,null,null,null):Jt(a)?Ne(et,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Ne(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,i=null,(s=a.__i=kr(a,n,c,m))!==-1&&(m--,(i=n[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&u--,typeof a.type!="function"&&(a.__u|=65536)):s!==c&&(s==c-1?u--:s==c+1?u++:(s>c?u--:u++,a.__u|=65536))):a=e.__k[r]=null;if(m)for(r=0;r<f;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=xe(i)),Mn(i,i))}function Vn(e,t,n){var r,a;if(typeof e.type=="function"){for(r=e.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=e,t=Vn(r[a],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=xe(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function kr(e,t,n,r){var a=e.key,i=e.type,c=n-1,s=n+1,o=t[n];if(o===null||o&&a==o.key&&i===o.type&&!(131072&o.__u))return n;if(r>(o!=null&&!(131072&o.__u)?1:0))for(;c>=0||s<t.length;){if(c>=0){if((o=t[c])&&!(131072&o.__u)&&a==o.key&&i===o.type)return c;c--}if(s<t.length){if((o=t[s])&&!(131072&o.__u)&&a==o.key&&i===o.type)return s;s++}}return-1}function pn(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ir.test(t)?n:n+"px"}function Fe(e,t,n,r,a){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||pn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||pn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}
vendor: 6,115 bytes, line 1
1),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Qt,e.addEventListener(t,i?wt:bt,i)):e.removeEventListener(t,i?wt:bt,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function yn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Qt++;else if(t.t<n.u)return;return n(k.event?k.event(t):t)}}}function en(e,t,n,r,a,i,c,s,o,f){var m,u,y,p,l,b,d,h,g,x,O,U,S,B,A,_,P=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(o=!!(32&n.__u),i=[s=t.__e=n.__e]),(m=k.__b)&&m(t);e:if(typeof P=="function")try{if(h=t.props,g="prototype"in P&&P.prototype.render,x=(m=P.contextType)&&r[m.__c],O=m?x?x.props.value:m.__:r,n.__c?d=(u=t.__c=n.__c).__=u.__E:(g?t.__c=u=new P(h,O):(t.__c=u=new He(h,O),u.constructor=P,u.render=Tr),x&&x.sub(u),u.props=h,u.state||(u.state={}),u.context=O,u.__n=r,y=u.__d=!0,u.__h=[],u._sb=[]),g&&u.__s==null&&(u.__s=u.state),g&&P.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=se({},u.__s)),se(u.__s,P.getDerivedStateFromProps(h,u.__s))),p=u.props,l=u.state,u.__v=t,y)g&&P.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),g&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(g&&P.getDerivedStateFromProps==null&&h!==p&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(h,O),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(h,u.__s,O)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(u.props=h,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(I){I&&(I.__=t)}),U=0;U<u._sb.length;U++)u.__h.push(u._sb[U]);u._sb=[],u.__h.length&&c.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(h,u.__s,O),g&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(p,l,b)})}if(u.context=O,u.props=h,u.__P=e,u.__e=!1,S=k.__r,B=0,g){for(u.state=u.__s,u.__d=!1,S&&S(t),m=u.render(u.props,u.state,u.context),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);u._sb=[]}else do u.__d=!1,S&&S(t),m=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++B<25);u.state=u.__s,u.getChildContext!=null&&(r=se(se({},r),u.getChildContext())),g&&!y&&u.getSnapshotBeforeUpdate!=null&&(b=u.getSnapshotBeforeUpdate(p,l)),Hn(e,Jt(_=m!=null&&m.type===et&&m.key==null?m.props.children:m)?_:[_],t,n,r,a,i,c,s,o,f),u.base=t.__e,t.__u&=-161,u.__h.length&&c.push(u),d&&(u.__E=u.__=null)}catch(I){if(t.__v=null,o||i!=null){for(t.__u|=o?160:32;s&&s.nodeType===8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else t.__e=n.__e,t.__k=n.__k;k.__e(I,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Fr(n.__e,t,n,r,a,i,c,o,f);(m=k.diffed)&&m(t)}function Rn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)tn(n[r],n[++r],n[++r]);k.__c&&k.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){k.__e(i,a.__v)}})}function Fr(e,t,n,r,a,i,c,s,o){var f,m,u,y,p,l,b,d=n.props,h=t.props,g=t.type;if(g==="svg"?a="http://www.w3.org/2000/svg":g==="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((p=i[f])&&"setAttribute"in p==!!g&&(g?p.localName===g:p.nodeType===3)){e=p,i[f]=null;break}}if(e==null){if(g===null)return document.createTextNode(h);e=document.createElementNS(a,g,h.is&&h),s&&(k.__m&&k.__m(t,i),s=!1),i=null}if(g===null)d===h||s&&e.data===h||(e.data=h);else{if(i=i&&Je.call(e.childNodes),d=n.props||Ue,!s&&i!=null)for(d={},f=0;f<e.attributes.length;f++)d[(p=e.attributes[f]).name]=p.value;for(f in d)if(p=d[f],f!="children"){if(f=="dangerouslySetInnerHTML")u=p;else if(!(f in h)){if(f=="value"&&"defaultValue"in h||f=="checked"&&"defaultChecked"in h)continue;Fe(e,f,null,p,a)}}for(f in h)p=h[f],f=="children"?y=p:f=="dangerouslySetInnerHTML"?m=p:f=="value"?l=p:f=="checked"?b=p:s&&typeof p!="function"||d[f]===p||Fe(e,f,p,d[f],a);if(m)s||u&&(m.__html===u.__html||m.__html===e.innerHTML)||(e.innerHTML=m.__html),t.__k=[];else if(u&&(e.innerHTML=""),Hn(e,Jt(y)?y:[y],t,n,r,g==="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,c,i?i[0]:n.__k&&xe(n,0),s,o),i!=null)for(f=i.length;f--;)Tn(i[f]);s||(f="value",g==="progress"&&l==null?e.removeAttribute("value"):l!==void 0&&(l!==e[f]||g==="progress"&&!l||g==="option"&&l!==d[f])&&Fe(e,f,l,d[f],a),f="checked",b!==void 0&&b!==e[f]&&Fe(e,f,b,d[f],a))}return e}function tn(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(a){k.__e(a,n)}}function Mn(e,t,n){var r,a;if(k.unmount&&k.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||tn(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){k.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&Mn(r[a],t,n||typeof e.type!="function");n||Tn(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Tr(e,t,n){return this.constructor(e,n)}function si(e,t,n){var r,a,i,c;k.__&&k.__(e,t),a=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],c=[],en(t,e=(!r&&n||t).__k=Dr(et,null,[e]),a||Ue,Ue,t.namespaceURI,!r&&n?[n]:a?null:t.firstChild?Je.call(t.childNodes):null,i,!r&&n?n:a?a.__e:t.firstChild,r,c),Rn(i,e,c)}Je=Fn.slice,k={__e:function(e,t,n,r){for(var a,i,c;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),c=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,r||{}),c=a.__d),c)return a.__E=a}catch(s){e=s}throw e}},Cn=0,He.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=se({},this.state),typeof e=="function"&&(e=e(se({},n),this.props)),e&&se(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ln(this))},He.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ln(this))},He.prototype.render=et,fe=[],kn=typeof Promise=="function"?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,_t=function(e,t){return e.__v.__b-t.__v.__b},Me.__r=0,Qt=0,bt=yn(!1),wt=yn(!0);function jn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=jn(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ci(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=jn(e))&&(r&&(r+=" "),r+=t);return r}var Ie,T,ft,mn,vt=0,zn=[],V=k,hn=V.__b,gn=V.__r,_n=V.diffed,bn=V.__c,wn=V.unmount,vn=V.__;function nn(e,t){V.__h&&V.__h(T,e,vt||t),vt=0;var n=T.__H||(T.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ui(e){return vt=1,Nr(qn,e)}function Nr(e,t,n){var r=nn(Ie++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):qn(void 0,t),function(s){var o=r.__N?r.__N[0]:r.__[0],f=r.t(o,s);o!==f&&(r.__N=[f,r.__[1]],r.__c.setState({}))}],r.__c=T,!T.u)){var a=function(s,o,f){if(!r.__c.__H)return!0;var m=r.__c.__H.__.filter(function(y){return!!y.__c});if(m.every(function(y){return!y.__N}))return!i||i.call(this,s,o,f);var u=!1;return m.forEach(function(y){if(y.__N){var p=y.__[0];y.__=y.__N,y.__N=void 0,p!==y.__[0]&&(u=!0)}}),!(!u&&r.__c.props===s)&&(!i||i.call(this,s,o,f))};T.u=!0;var i=T.shouldComponentUpdate,c=T.componentWillUpdate;T.componentWillUpdate=function(s,o,f){if(this.__e){var m=i;i=void 0,a(s,o,f),i=m}c&&c.call(this,s,o,f)},T.shouldComponentUpdate=a}return r.__N||r.__}function fi(e,t){var n=nn(Ie++,3);!V.__s&&$n(n.__H,t)&&(n.__=e,n.i=t,T.__H.__h.push(n))}function di(e,t){var n=nn(Ie++,7);return $n(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Hr(){for(var e;e=zn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ve),e.__H.__h.forEach(xt),e.__H.__h=[]}catch(t){e.__H.__h=[],V.__e(t,e.__v)}}V.__b=function(e){T=null,hn&&hn(e)},V.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),vn&&vn(e,t)},V.__r=function(e){gn&&gn(e),Ie=0;var t=(T=e.__c).__H;t&&(ft===T?(t.__h=[],T.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(Ve),t.__h.forEach(xt),t.__h=[],Ie=0)),ft=T},V.diffed=function(e){_n&&_n(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zn.push(t)!==1&&mn===V.requestAnimationFrame||((mn=V.requestAnimationFrame)||Vr)(Hr)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),ft=T=null},V.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ve),n.__h=n.__h.filter(function(r){return!r.__||xt(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],V.__e(r,n.__v)}}),bn&&bn(e,t)},V.unmount=function(e){wn&&wn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Ve(r)}catch(a){t=a}}),n.__H=void 0,t&&V.__e(t,n.__v))};var xn=typeof requestAnimationFrame=="function";function Vr(e){var t,n=function(){clearTimeout(r),xn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);xn&&(t=requestAnimationFrame(n))}function Ve(e){var t=T,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),T=t}function xt(e){var t=T;e.__c=e.__(),T=t}function $n(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function qn(e,t){return typeof t=="function"?t(e):t}const li=[{inputs:[{name:"preOpGas",type:"uint256"},{name:"paid",type:"uint256"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"targetSuccess",type:"bool"},{name:"targetResult",type:"bytes"}],name:"ExecutionResult",type:"error"},{inputs:[{name:"opIndex",type:"uint256"},{name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{inputs:[{components:[{name:"preOpGas",type:"uint256"},{name:"prefund",type:"uint256"},{name:"sigFailed",type:"bool"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"paymasterContext",type:"bytes"}],name:"returnInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"senderInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"factoryInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"paymasterInfo",type:"tuple"}],name:"ValidationResult",type:"error"},{inputs:[{components:[{name:"preOpGas",type:"uint256"},{name:"prefund",type:"uint256"},{name:"sigFailed",type:"bool"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"paymasterContext",type:"bytes"}],name:"returnInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"senderInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"factoryInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"paymasterInfo",type:"tuple"},{components:[{name:"aggregator",type:"address"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"stakeInfo",type:"tuple"}],name:"aggregatorInfo",type:"tuple"}],name:"ValidationResultWithAggregation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"factory",type:"address"},{indexed:!1,name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalStaked",type:"uint256"},{indexed:!1,name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"paymaster",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"success",type:"bool"},{indexed:!1,name:"actualGasCost",type:"uint256"},{indexed:!1,name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[],name:"SIG_VALIDATION_FAILED",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"},{name:"sender",type:"address"},{name:"paymasterAndData",type:"bytes"}],name:"_validateSenderAndPaymaster",outputs:[],stateMutability:"view",type:"function"},{inputs:[{name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"",type:"address"}],name:"deposits",outputs:[{name:"deposit",type:"uint112"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{name:"deposit",type:"uint112"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{name:"sender",type:"address"},{name:"key",type:"uint192"}],name:"getNonce",outputs:[{name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOps",type:"tuple[]"},{name:"aggregator",type:"address"},{name:"signature",type:"bytes"}],name:"opsPerAggregator",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"ops",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"callData",type:"bytes"},{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"paymaster",type:"address"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"}],name:"mUserOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"prefund",type:"uint256"},{name:"contextOffset",type:"uint256"},{name:"preOpGas",type:"uint256"}],name:"opInfo",type:"tuple"},{name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"",type:"address"},{name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"op",type:"tuple"},{name:"target",type:"address"},{name:"targetCallData",type:"bytes"}],name:"simulateHandleOp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"simulateValidation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"},{name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],pi="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";function Zn(e,t={}){const{forHash:n}=t,{authorization:r,factory:a,factoryData:i}=e;return n&&(a==="0x7702"||a==="0x7702000000000000000000000000000000000000")?r?pe([r.address,i??"0x"]):"0x7702000000000000000000000000000000000000":a?pe([a,i??"0x"]):"0x"}const En="0x22e325a297439656";function Wn(e,t={}){const{callGasLimit:n,callData:r,maxPriorityFeePerGas:a,maxFeePerGas:i,paymaster:c,paymasterData:s,paymasterPostOpGasLimit:o,paymasterSignature:f,paymasterVerificationGasLimit:m,sender:u,signature:y="0x",verificationGasLimit:p}=e,l=pe([X(F(p||0n),{size:16}),X(F(n||0n),{size:16})]),b=Zn(e,t),d=pe([X(F(a||0n),{size:16}),X(F(i||0n),{size:16})]),h=e.nonce??0n,g=c?pe([c,X(F(m||0n),{size:16}),X(F(o||0n),{size:16}),s||"0x",...f?t.forHash?[En]:[f,X(F(dr(f)),{size:2}),En]:[]]):"0x",x=e.preVerificationGas??0n;return{accountGasLimits:l,callData:r,initCode:b,gasFees:d,nonce:h,paymasterAndData:g,preVerificationGas:x,sender:u,signature:y}}const Rr={PackedUserOperation:[{type:"address",name:"sender"},{type:"uint256",name:"nonce"},{type:"bytes",name:"initCode"},{type:"bytes",name:"callData"},{type:"bytes32",name:"accountGasLimits"},{type:"uint256",name:"preVerificationGas"},{type:"bytes32",name:"gasFees"},{type:"bytes",name:"paymasterAndData"}]};function Mr(e){const{chainId:t,entryPointAddress:n,userOperation:r}=e,a=Wn(r,{forHash:!0});return{types:Rr,primaryType:"PackedUserOperation",domain:{name:"ERC4337",version:"1",chainId:t,verifyingContract:n},message:a}}function yi(e){const{chainId:t,entryPointAddress:n,entryPointVersion:r}=e,a=e.userOperation,{authorization:i,callData:c="0x",callGasLimit:s,maxFeePerGas:o,maxPriorityFeePerGas:f,nonce:m,paymasterAndData:u="0x",preVerificationGas:y,sender:p,verificationGasLimit:l}=a;if(r==="0.8"||r==="0.9")return Sr(Mr({chainId:t,entryPointAddress:n,userOperation:a}));const b=(()=>{var d,h;if(r==="0.6"){const g=(d=a.initCode)==null?void 0:d.slice(0,42),x=(h=a.initCode)==null?void 0:h.slice(42),O=Zn({authorization:i,factory:g,factoryData:x},{forHash:!0});return ct([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[p,m,ae(O),ae(c),s,l,y,o,f,ae(u)])}if(r==="0.7"){const g=Wn(a,{forHash:!0});return ct([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[g.sender,g.nonce,ae(g.initCode),ae(g.callData),g.accountGasLimits,g.preVerificationGas,g.gasFees,ae(g.paymasterAndData)])}throw new Error(`entryPointVersion "${r}" not supported.`)})();return ae(ct([{type:"bytes32"},{type:"address"},{type:"uint256"}],[ae(b),n,BigInt(t)]))}async function mi(e){const{extend:t,nonceKeyManager:n=Lr({source:{get(){return Date.now()},set(){}}}),...r}=e;let a=!1;const i=await e.getAddress();return{...t,...r,address:i,async getFactoryArgs(){return"isDeployed"in this&&await this.isDeployed()?{factory:void 0,factoryData:void 0}:e.getFactoryArgs()},async getNonce(c){const s=(c==null?void 0:c.key)??BigInt(await n.consume({address:i,chainId:e.client.chain.id,client:e.client}));return e.getNonce?await e.getNonce({...c,key:s}):await lr(e.client,{abi:pr(["function getNonce(address, uint192) pure returns (uint256)"]),address:e.entryPoint.address,functionName:"getNonce",args:[i,s]})},async isDeployed(){return a?!0:(a=!!await te(e.clien
1t,Gr,"getCode")({address:i}),a)},...e.sign?{async sign(c){const[{factory:s,factoryData:o},f]=await Promise.all([this.getFactoryArgs(),e.sign(c)]);return s&&o?ut({address:s,data:o,signature:f}):f}}:{},async signMessage(c){const[{factory:s,factoryData:o},f]=await Promise.all([this.getFactoryArgs(),e.signMessage(c)]);return s&&o&&s!=="0x7702"?ut({address:s,data:o,signature:f}):f},async signTypedData(c){const[{factory:s,factoryData:o},f]=await Promise.all([this.getFactoryArgs(),e.signTypedData(c)]);return s&&o&&s!=="0x7702"?ut({address:s,data:o,signature:f}):f},type:"smart"}}class Et extends G{constructor({cause:t}){super("Smart Account is not deployed.",{cause:t,metaMessages:["This could arise when:","- No `factory`/`factoryData` or `initCode` properties are provided for Smart Account deployment.","- An incorrect `sender` address is provided."],name:"AccountNotDeployedError"})}}Object.defineProperty(Et,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa20/});class Ee extends G{constructor({cause:t,data:n,message:r}={}){var i;const a=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${a?`with reason: ${a}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n}}Object.defineProperty(Ee,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32521});Object.defineProperty(Ee,"message",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Ot extends G{constructor({cause:t}){super("Failed to send funds to beneficiary.",{cause:t,name:"FailedToSendToBeneficiaryError"})}}Object.defineProperty(Ot,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa91/});class Pt extends G{constructor({cause:t}){super("Gas value overflowed.",{cause:t,metaMessages:["This could arise when:","- one of the gas values exceeded 2**120 (uint120)"].filter(
vendor: 7,982 bytes, lines 1-4
1Boolean),name:"GasValuesOverflowError"})}}Object.defineProperty(Pt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa94/});class Bt extends G{constructor({cause:t}){super("The `handleOps` function was called by the Bundler with a gas limit too low.",{cause:t,name:"HandleOpsOutOfGasError"})}}Object.defineProperty(Bt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa95/});class At extends G{constructor({cause:t,factory:n,factoryData:r,initCode:a}){super("Failed to simulate deployment for Smart Account.",{cause:t,metaMessages:["This could arise when:","- Invalid `factory`/`factoryData` or `initCode` properties are present","- Smart Account deployment execution ran out of gas (low `verificationGasLimit` value)",`- Smart Account deployment execution reverted with an error 2`,n&&`factory: ${n}`,r&&`factoryData: ${r}`,a&&`initCode: ${a}`].filter(Boolean),name:"InitCodeFailedError"})}}Object.defineProperty(At,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa13/});class St extends G{constructor({cause:t,factory:n,factoryData:r,initCode:a}){super("Smart Account initialization implementation did not create an account.",{cause:t,metaMessages:["This could arise when:","- `factory`/`factoryData` or `initCode` properties are invalid",`- Smart Account initialization implementation is incorrect 3`,n&&`factory: ${n}`,r&&`factoryData: ${r}`,a&&`initCode: ${a}`].filter(Boolean),name:"InitCodeMustCreateSenderError"})}}Object.defineProperty(St,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa15/});class Gt extends G{constructor({cause:t,factory:n,factoryData:r,initCode:a,sender:i}){super("Smart Account initialization implementation does not return the expected sender.",{cause:t,metaMessages:["This could arise when:",`Smart Account initialization implementation does not return a sender address 4`,n&&`factory: ${n}`,r&&`factoryData: ${r}`,a&&`initCode: ${a}`,i&&`sender: ${i}`].filter(Boolean),name:"InitCodeMustReturnSenderError"})}}Object.defineProperty(Gt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa14/});class Lt extends G{constructor({cause:t}){super("Smart Account does not have sufficient funds to execute the User Operation.",{cause:t,metaMessages:["This could arise when:","- the Smart Account does not have sufficient funds to cover the required prefund, or","- a Paymaster was not provided"].filter(Boolean),name:"InsufficientPrefundError"})}}Object.defineProperty(Lt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa21/});class Ut extends G{constructor({cause:t}){super("Bundler attempted to call an invalid function on the EntryPoint.",{cause:t,name:"InternalCallOnlyError"})}}Object.defineProperty(Ut,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa92/});class It extends G{constructor({cause:t}){super("Bundler used an invalid aggregator for handling aggregated User Operations.",{cause:t,name:"InvalidAggregatorError"})}}Object.defineProperty(It,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa96/});class Dt extends G{constructor({cause:t,nonce:n}){super("Invalid Smart Account nonce used for User Operation.",{cause:t,metaMessages:[n&&`nonce: ${n}`].filter(Boolean),name:"InvalidAccountNonceError"})}}Object.defineProperty(Dt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa25/});class Ct extends G{constructor({cause:t}){super("Bundler has not set a beneficiary address.",{cause:t,name:"InvalidBeneficiaryError"})}}Object.defineProperty(Ct,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa90/});class je extends G{constructor({cause:t}){super("Invalid fields set on User Operation.",{cause:t,name:"InvalidFieldsError"})}}Object.defineProperty(je,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class kt extends G{constructor({cause:t,paymasterAndData:n}){super("Paymaster properties provided are invalid.",{cause:t,metaMessages:["This could arise when:","- the `paymasterAndData` property is of an incorrect length\n",n&&`paymasterAndData: ${n}`].filter(Boolean),name:"InvalidPaymasterAndDataError"})}}Object.defineProperty(kt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa93/});class le extends G{constructor({cause:t}){super("Paymaster deposit for the User Operation is too low.",{cause:t,metaMessages:["This could arise when:","- the Paymaster has deposited less than the expected amount via the `deposit` function"].filter(Boolean),name:"PaymasterDepositTooLowError"})}}Object.defineProperty(le,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32508});Object.defineProperty(le,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa31/});class Ft extends G{constructor({cause:t}){super("The `validatePaymasterUserOp` function on the Paymaster reverted.",{cause:t,name:"PaymasterFunctionRevertedError"})}}Object.defineProperty(Ft,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa33/});class Tt extends G{constructor({cause:t}){super("The Paymaster contract has not been deployed.",{cause:t,name:"PaymasterNotDeployedError"})}}Object.defineProperty(Tt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa30/});class ze extends G{constructor({cause:t}){super("UserOperation rejected because paymaster (or signature aggregator) is throttled/banned.",{cause:t,name:"PaymasterRateLimitError"})}}Object.defineProperty(ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32504});class $e extends G{constructor({cause:t}){super("UserOperation rejected because paymaster (or signature aggregator) stake or unstake-delay is too low.",{cause:t,name:"PaymasterStakeTooLowError"})}}Object.defineProperty($e,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32505});class Nt extends G{constructor({cause:t}){super("Paymaster `postOp` function reverted.",{cause:t,name:"PaymasterPostOpFunctionRevertedError"})}}Object.defineProperty(Nt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa50/});class Ht extends G{constructor({cause:t,factory:n,factoryData:r,initCode:a}){super("Smart Account has already been deployed.",{cause:t,metaMessages:["Remove the following properties and try again:",n&&"`factory`",r&&"`factoryData`",a&&"`initCode`"].filter(Boolean),name:"SenderAlreadyConstructedError"})}}Object.defineProperty(Ht,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa10/});class qe extends G{constructor({cause:t}){super("UserOperation rejected because account signature check failed (or paymaster signature, if the paymaster uses its data as signature).",{cause:t,name:"SignatureCheckFailedError"})}}Object.defineProperty(qe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32507});class Vt extends G{constructor({cause:t}){super("The `validateUserOp` function on the Smart Account reverted.",{cause:t,name:"SmartAccountFunctionRevertedError"})}}Object.defineProperty(Vt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa23/});class Ze extends G{constructor({cause:t}){super("UserOperation rejected because account specified unsupported signature aggregator.",{cause:t,name:"UnsupportedSignatureAggregatorError"})}}Object.defineProperty(Ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32506});class Rt extends G{constructor({cause:t}){super("User Operation expired.",{cause:t,metaMessages:["This could arise when:","- the `validAfter` or `validUntil` values returned from `validateUserOp` on the Smart Account are not satisfied"].filter(Boolean),name:"UserOperationExpiredError"})}}Object.defineProperty(Rt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa22/});class Mt extends G{constructor({cause:t}){super("Paymaster for User Operation expired.",{cause:t,metaMessages:["This could arise when:","- the `validAfter` or `validUntil` values returned from `validatePaymasterUserOp` on the Paymaster are not satisfied"].filter(Boolean),name:"UserOperationPaymasterExpiredError"})}}Object.defineProperty(Mt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa32/});
4class jt extends G{constructor({cause:t}){super("Signature provided for the User Operation is invalid.",{cause:t,metaMessages:["This could arise when:","- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Smart Account"].filter(Boolean),name:"UserOperationSignatureError"})}}Object.defineProperty(jt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa24/});class zt extends G{constructor({cause:t}){super("Signature provided for the User Operation is invalid.",{cause:t,metaMessages:["This could arise when:","- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Paymaster"].filter(Boolean),name:"UserOperationPaymasterSignatureError"})}}Object.defineProperty(zt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa34/});class We extends G{constructor({cause:t}){super("User Operation rejected by EntryPoint's `simulateValidation` during account creation or validation.",{cause:t,name:"UserOperationRejectedByEntryPointError"})}}Object.defineProperty(We,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32500});class Ye extends G{constructor({cause:t}){super("User Operation rejected by Paymaster's `validatePaymasterUserOp`.",{cause:t,name:"UserOperationRejectedByPaymasterError"})}}Object.defineProperty(Ye,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32501});class Ke extends G{constructor({cause:t}){super("User Operation rejected with op code validation error.",{cause:t,name:"UserOperationRejectedByOpCodeError"})}}Object.defineProperty(Ke,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32502});class Xe extends G{constructor({cause:t}){super("UserOperation out of time-range: either wallet or paymaster returned a time-range, and it is already expired (or will expire soon).",{cause:t,name:"UserOperationOutOfTimeRangeError"})}}Object.defineProperty(Xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32503});class jr extends G{constructor({cause:t}){super(`An error occurred while executing user operation: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownBundlerError"})}}class $t extends G{constructor({cause:t}){super("User Operation verification gas limit exceeded.",{cause:t,metaMessages:["This could arise when:","- the gas used for verification exceeded the `verificationGasLimit`"].filter(Boolean),name:"VerificationGasLimitExceededError"})}}Object.defineProperty($t,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa40/});class qt extends G{constructor({cause:t}){super("User Operation verification gas limit is too low.",{cause:t,metaMessages:["This could arise when:","- the `verificationGasLimit` is too low to verify the User Operation"].filter(Boolean),name:"VerificationGasLimitTooLowError"})}}Object.defineProperty(qt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa41/});class zr extends G{constructor(t,{callData:n,callGasLimit:r,docsPath:a,factory:i,factoryData:c,initCode:s,maxFeePerGas:o,maxPriorityFeePerGas:f,nonce:m,paymaster:u,paymasterAndData:y,paymasterData:p,paymasterPostOpGasLimit:l,paymasterVerificationGasLimit:b,preVerificationGas:d,sender:h,signature:g,verificationGasLimit:x}){const O=yr({callData:n,callGasLimit:r,factory:i,factoryData:c,initCode:s,maxFeePerGas:typeof o<"u"&&`${fn(o)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${fn(f)} gwei`,nonce:m,paymaster:u,paymasterAndData:y,paymasterData:p,paymasterPostOpGasLimit:l,paymasterVerificationGasLimit:b,preVerificationGas:d,sender:h,signature:g,verificationGasLimit:x});super(t.shortMessage,{cause:t,docsPath:a,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",O].filter(Boolean),name:"UserOperationExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class $r extends G{constructor({hash:t}){super(`User Operation receipt with hash "${t}" could not be found. The User Operation may not have been processed yet.`,{name:"UserOperationReceiptNotFoundError"})}}class qr extends G{constructor({hash:t}){super(`User Operation with hash "${t}" could not be found.`,{name:"UserOperationNotFoundError"})}}class On extends G{constructor({hash:t}){super(`Timed out while waiting for User Operation with hash "${t}" to be confirmed.`,{name:"WaitForUserOperationReceiptTimeoutError"})}}const Zr=[Ee,je,le,ze,$e,qe,Ze,Xe,We,Ye,Ke];function Wr(e,t){const n=(e.details||"").toLowerCase();if(Et.message.test(n))return new Et({cause:e});if(Ot.message.test(n))return new Ot({cause:e});if(Pt.message.test(n))return new Pt({cause:e});if(Bt.message.test(n))return new Bt({cause:e});if(At.message.test(n))return new At({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(St.message.test(n))return new St({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(Gt.message.test(n))return new Gt({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode,sender:t.sender});if(Lt.message.test(n))return new Lt({cause:e});if(Ut.message.test(n))return new Ut({cause:e});if(Dt.message.test(n))return new Dt({cause:e,nonce:t.nonce});if(It.message.test(n))return new It({cause:e});if(Ct.message.test(n))return new Ct({cause:e});if(kt.message.test(n))return new kt({cause:e});if(le.message.test(n))return new le({cause:e});if(Ft.message.test(n))return new Ft({cause:e});if(Tt.message.test(n))return new Tt({cause:e});if(Nt.message.test(n))return new Nt({cause:e});if(Vt.message.test(n))return new Vt({cause:e});if(Ht.message.test(n))return new Ht({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(Rt.message.test(n))return new Rt({cause:e});if(Mt.message.test(n))return new Mt({cause:e});if(zt.message.test(n))return new zt({cause:e});if(jt.message.test(n))return new jt({cause:e});if($t.message.test(n))return new $t({cause:e});if(qt.message.test(n))return new qt({cause:e});const r=e.walk(a=>Zr.some(i=>i.code===a.code));if(r){if(r.code===Ee.code)return new Ee({cause:e,data:r.data,message:r.details});if(r.code===je.code)return new je({cause:e});if(r.code===le.code)return new le({cause:e});if(r.code===ze.code)return new ze({cause:e});if(r.code===$e.code)return new $e({cause:e});if(r.code===qe.code)return new qe({cause:e});if(r.code===Ze.code)return new Ze({cause:e});if(r.code===Xe.code)return new Xe({cause:e});if(r.code===We.code)return new We({cause:e});if(r.code===Ye.code)return new Ye({cause:e});if(r.code===Ke.code)return new Ke({cause:e})}return new jr({cause:e})}function Yn(e,{calls:t,docsPath:n,...r}){const a=(()=>{const i=Wr(e,r);if(t&&i instanceof Ee){const c=Yr(i),s=t==null?void 0:t.filter(o=>o.abi);if(c&&s.length>0)return Kr({calls:s,revertData:c})}return i})();return new zr(a,{docsPath:n,...r})}function Yr(e){let t;return e.walk(n=>{var a,i,c,s;const r=n;
4if(typeof r.data=="string"||typeof((a=r.data)==null?void 0:a.revertData)=="string"||!(r instanceof G)&&typeof r.message=="string"){const o=(s=(c=((i=r.data)==null?void 0:i.revertData)||r.data||r.message).match)==null?void 0:s.call(c,/(0x[A-Za-z0-9]*)/);if(o)return t=o[1],!0}return!1}),t}function Kr(e){const{calls:t,revertData:n}=e,{abi:r,functionName:a,args:i,to:c}=(()=>{const o=t==null?void 0:t.filter(m=>!!m.abi);if(o.length===1)return o[0];const f=o.filter(m=>{try{return!!mr({abi:m.abi,data:n})}catch{return!1}});return f.length===1?f[0]:{abi:[],functionName:o.reduce((m,u)=>`${m?`${m} | `:""}${u.functionName}`,""),args:void 0,to:void 0}})(),s=(()=>n==="0x"?new hr({functionName:a}):new gr({abi:r,data:n,functionName:a}))();return new _r(s,{abi:r,args:i,contractAddress:c,functionName:a})}function Xr(e){const t={};return e.callGasLimit&&(t.callGasLimit=BigInt(e.callGasLimit)),e.preVerificationGas&&(t.preVerificationGas=BigInt(e.preVerificationGas)),e.verificationGasLimit&&(t.verificationGasLimit=BigInt(e.verificationGasLimit)),e.paymasterPostOpGasLimit&&(t.paymasterPostOpGasLimit=BigInt(e.paymasterPostOpGasLimit)),e.paymasterVerificationGasLimit&&(t.paymasterVerificationGasLimit=BigInt(e.paymasterVerificationGasLimit)),t}function tt(e){const t={};return typeof e.callData<"u"&&(t.callData=e.callData),typeof e.callGasLimit<"u"&&(t.callGasLimit=F(e.callGasLimit)),typeof e.factory<"u"&&(t.factory=e.factory),typeof e.factoryData<"u"&&(t.factoryData=e.factoryData),typeof e.initCode<"u"&&(t.initCode=e.initCode),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=F(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=F(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=F(e.nonce)),typeof e.paymaster<"u"&&(t.paymaster=e.paymaster),typeof e.paymasterAndData<"u"&&(t.paymasterAndData=e.paymasterAndData||"0x"),typeof e.paymasterData<"u"&&(t.paymasterData=e.paymasterData),typeof e.paymasterPostOpGasLimit<"u"&&(t.paymasterPostOpGasLimit=F(e.paymasterPostOpGasLimit)),typeof e.paymasterSignature<"u"&&(t.paymasterSignature=e.paymasterSignature),typeof e.paymasterVerificationGasLimit<"u"&&(t.paymasterVerificationGasLimit=F(e.paymasterVerificationGasLimit)),typeof e.preVerificationGas<"u"&&(t.preVerificationGas=F(e.preVerificationGas)),typeof e.sender<"u"&&(t.sender=e.sender),typeof e.signature<"u"&&(t.signature=e.signature),typeof e.verificationGasLimit<"u"&&(t.verificationGasLimit=F(e.verificationGasLimit)),typeof e.authorization<"u"&&(t.eip7702Auth=Qr(e.authorization)),t}function Qr(e){return{address:e.address,chainId:F(e.chainId),nonce:F(e.nonce),r:e.r?F(BigInt(e.r),{size:32}):X("0x",{size:32}),s:e.s?F(BigInt(e.s),{size:32}):X("0x",{size:32}),yParity:e.yParity?F(e.yParity,{size:1}):X("0x",{size:32})}}async function Jr(e,t){const{chainId:n,entryPointAddress:r,context:a,...i}=t,c=tt(i),{paymasterPostOpGasLimit:s,paymasterVerificationGasLimit:o,...f}=await e.request({method:"pm_getPaymasterData",params:[{...c,callGasLimit:c.callGasLimit??"0x0",verificationGasLimit:c.verificationGasLimit??"0x0",preVerificationGas:c.preVerificationGas??"0x0"},r,F(n),a]});return{...f,...s&&{paymasterPostOpGasLimit:Re(s)},...o&&{paymasterVerificationGasLimit:Re(o)}}}async function ea(e,t){const{chainId:n,entryPointAddress:r,context:a,...i}=t,c=tt(i),{paymasterPostOpGasLimit:s,paymasterVerificationGasLimit:o,...f}=await e.request({method:"pm_getPaymasterStubData",params:[{...c,callGasLimit:c.callGasLimit??"0x0",verificationGasLimit:c.verificationGasLimit??"0x0",preVerificationGas:c.preVerificationGas??"0x0"},r,F(n),a]});return{...f,...s&&{paymasterPostOpGasLimit:Re(s)},...o&&{paymasterVerificationGasLimit:Re(o)}}}const ta=["factory","fees","gas","paymaster","nonce","signature","authorization"];async function rn(e,t){var B,A;const n=t,{account:r=e.account,dataSuffix:a=typeof e.dataSuffix=="string"?e.dataSuffix:(B=e.dataSuffix)==null?void 0:B.value,parameters:i=ta,stateOverride:c}=n;if(!r)throw new Kt;const s=Xt(r),o=e,f=n.paymaster??(o==null?void 0:o.paymaster),m=typeof f=="string"?f:void 0,{getPaymasterStubData:u,getPaymasterData:y}=(()=>{if(f===!0)return{getPaymasterStubData:_=>te(o,ea,"getPaymasterStubData")(_),getPaymasterData:_=>te(o,Jr,"getPaymasterData")(_)};if(typeof f=="object"){const{getPaymasterStubData:_,getPaymasterData:P}=f;return{getPaymasterStubData:P&&_?_:P,getPaymasterData:P&&_?P:void 0}}return{getPaymasterStubData:void 0,getPaymasterData:void 0}})(),p=n.paymasterContext?n.paymasterContext:o==null?void 0:o.paymasterContext;let l={...n,paymaster:m,sender:s.address};const[b,d,h,g,x]=await Promise.all([(async()=>n.calls?s.encodeCalls(n.calls.map(_=>{const P=_;return P.abi?{data:br(P),to:P.to,value:P.value}:P})):n.callData)(),(async()=>
4{if(!i.includes("factory"))return;if(n.initCode)return{initCode:n.initCode};if(n.factory&&n.factoryData)return{factory:n.factory,factoryData:n.factoryData};const{factory:_,factoryData:P}=await s.getFactoryArgs();return s.entryPoint.version==="0.6"?{initCode:_&&P?pe([_,P]):void 0}:{factory:_,factoryData:P}})(),(async()=>{var _;if(i.includes("fees")){if(typeof n.maxFeePerGas=="bigint"&&typeof n.maxPriorityFeePerGas=="bigint")return l;if((_=o==null?void 0:o.userOperation)!=null&&_.estimateFeesPerGas){const P=await o.userOperation.estimateFeesPerGas({account:s,bundlerClient:o,userOperation:l});return{...l,...P}}try{const P=o.client??e,I=await te(P,wr,"estimateFeesPerGas")({chain:P.chain,type:"eip1559"});return{maxFeePerGas:typeof n.maxFeePerGas=="bigint"?n.maxFeePerGas:BigInt(2n*I.maxFeePerGas),maxPriorityFeePerGas:typeof n.maxPriorityFeePerGas=="bigint"?n.maxPriorityFeePerGas:BigInt(2n*I.maxPriorityFeePerGas)}}catch{return}}})(),(async()=>{if(i.includes("nonce"))return typeof n.nonce=="bigint"?n.nonce:s.getNonce()})(),(async()=>{if(i.includes("authorization")){if(typeof n.authorization=="object")return n.authorization;if(s.authorization&&!await s.isDeployed())return{...await Ur(s.client,s.authorization),r:"0xfffffffffffffffffffffffffffffff000000000000000000000000000000000",s:"0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",yParity:1}}})()]);typeof b<"u"&&(l.callData=a?pe([b,a]):b),typeof d<"u"&&(l={...l,...d}),typeof h<"u"&&(l={...l,...h}),typeof g<"u"&&(l.nonce=g),typeof x<"u"&&(l.authorization=x),i.includes("signature")&&(typeof n.signature<"u"?l.signature=n.signature:l.signature=await s.getStubSignature(l)),s.entryPoint.version==="0.6"&&!l.initCode&&(l.initCode="0x");let O;async function U(){return O||(e.chain?e.chain.id:(O=await te(e,Dn,"getChainId")({}),O))}let S=!1;if(i.includes("paymaster")&&u&&!m&&!n.paymasterAndData){const{isFinal:_=!1,sponsor:P,...I}=await u({chainId:await U(),entryPointAddress:s.entryPoint.address,context:p,...l});S=_,l={...l,...I}}if(s.entryPoint.version==="0.6"&&!l.paymasterAndData&&(l.paymasterAndData="0x"),i.includes("gas")){if((A=s.userOperation)!=null&&A.estimateGas){const _=await s.userOperation.estimateGas(l);l={...l,..._}}if(typeof l.callGasLimit>"u"||typeof l.preVerificationGas>"u"||typeof l.verificationGasLimit>"u"||l.paymaster&&typeof l.paymasterPostOpGasLimit>"u"||l.paymaster&&typeof l.paymasterVerificationGasLimit>"u"){const _=await te(o,Kn,"estimateUserOperationGas")({account:s,callGasLimit:0n,preVerificationGas:0n,verificationGasLimit:0n,stateOverride:c,...l.paymaster?{paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n}:{},...l});l={...l,callGasLimit:l.callGasLimit??_.callGasLimit,preVerificationGas:l.preVerificationGas??_.preVerificationGas,verificationGasLimit:l.verificationGasLimit??_.verificationGasLimit,paymasterPostOpGasLimit:l.paymasterPostOpGasLimit??_.paymasterPostOpGasLimit,paymasterVerificationGasLimit:l.paymasterVerificationGasLimit??_.paymasterVerificationGasLimit}}}if(i.includes("paymaster")&&y&&!m&&!n.paymasterAndData&&!S){const _=await y({chainId:await U(),entryPointAddress:s.entryPoint.address,context:p,...l});l={...l,..._}}return delete l.calls,delete l.parameters,delete l.paymasterContext,typeof l.paymaster!="string"&&delete l.paymaster,l}async function Kn(e,t){var o;const{account:n=e.account,entryPointAddress:r,stateOverride:a}=t;if(!n&&!t.sender)throw new Kt;const i=n?Xt(n):void 0,c=vr(a),s=i?await te(e,rn,"prepareUserOperation")({...t,parameters:["authorization","factory","nonce","paymaster","signature"]}):t;try{const f=[tt(s),r??((o=i==null?void 0:i.entryPoint)==null?void 0:o.address)],m=await e.request({method:"eth_estimateUserOperationGas",params:c?[...f,c]:[...f]});return Xr(m)}catch(f){const m=t.calls;throw Yn(f,{...s,...m?{calls:m}:{}})}}function na(e){return e.request({method:"eth_supportedEntryPoints"})}function ra(e){const t={...e};return e.callGasLimit&&(t.callGasLimit=BigInt(e.callGasLimit)),e.maxFeePerGas&&(t.maxFeePerGas=BigInt(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=BigInt(e.maxPriorityFeePerGas)),e.nonce&&(t.nonce=BigInt(e.nonce)),e.paymasterPostOpGasLimit&&(t.paymasterPostOpGasLimit=BigInt(e.paymasterPostOpGasLimit)),e.paymasterVerificationGasLimit&&(t.paymasterVerificationGasLimit=BigInt(e.paymasterVerificationGasLimit)),e.preVerificationGas&&(t.preVerificationGas=BigInt(e.preVerificationGas)),e.verificationGasLimit&&(t.verificationGasLimit=BigInt(e.verificationGasLimit)),t}async function aa(e,{hash:t}){const n=await e.request({method:"eth_getUserOperationByHash",params:[t]},{dedupe:!0});if(!n)throw new qr({hash:t});const{blockHash:r,blockNumber:a,entryPoint:i,transactionHash:c,userOperation:s}=n;
4return{blockHash:r,blockNumber:BigInt(a),entryPoint:i,transactionHash:c,userOperation:ra(s)}}function ia(e){const t={...e};return e.actualGasCost&&(t.actualGasCost=BigInt(e.actualGasCost)),e.actualGasUsed&&(t.actualGasUsed=BigInt(e.actualGasUsed)),e.logs&&(t.logs=e.logs.map(n=>xr(n))),e.receipt&&(t.receipt=Er(t.receipt)),t}async function Xn(e,{hash:t}){const n=await e.request({method:"eth_getUserOperationReceipt",params:[t]},{dedupe:!0});if(!n)throw new $r({hash:t});return ia(n)}async function oa(e,t){var o,f;const{account:n=e.account,entryPointAddress:r}=t;if(!n&&!t.sender)throw new Kt;const a=n?Xt(n):void 0,i=a?await te(e,rn,"prepareUserOperation")(t):t,c=t.signature||await((o=a==null?void 0:a.signUserOperation)==null?void 0:o.call(a,i)),s=tt({...i,signature:c});try{return await e.request({method:"eth_sendUserOperation",params:[s,r??((f=a==null?void 0:a.entryPoint)==null?void 0:f.address)]},{retryCount:0})}catch(m){const u=t.calls;throw Yn(m,{...i,...u?{calls:u}:{},signature:c})}}function sa(e,t){const{hash:n,pollingInterval:r=e.pollingInterval,retryCount:a,timeout:i=12e4}=t;let c=0;const s=Or(["waitForUserOperationReceipt",e.uid,n]);return new Promise((o,f)=>{const m=Pr(s,{resolve:o,reject:f},u=>{const y=b=>{l(),b(),m()},p=i?setTimeout(()=>y(()=>u.reject(new On({hash:n}))),i):void 0,l=Br(async()=>{a&&c>=a&&(clearTimeout(p),y(()=>u.reject(new On({hash:n}))));try{const b=await te(e,Xn,"getUserOperationReceipt")({hash:n});clearTimeout(p),y(()=>u.resolve(b))}catch(b){const d=b;d.name!=="UserOperationReceiptNotFoundError"&&(clearTimeout(p),y(()=>u.reject(d)))}c++},{emitOnBegin:!0,interval:r});return l})})}function ca(e){return{estimateUserOperationGas:t=>Kn(e,t),getChainId:()=>Dn(e),getSupportedEntryPoints:()=>na(e),getUserOperation:t=>aa(e,t),getUserOperationReceipt:t=>Xn(e,t),prepareUserOperation:t=>rn(e,t),sendUserOperation:t=>oa(e,t),waitForUserOperationReceipt:t=>sa(e,t)}}function hi(e){const{client:t,dataSuffix:n,key:r="bundler",name:a="Bundler Client",paymaster:i,paymasterContext:c,transport:s,userOperation:o}=e;return Object.assign(Ar({...e,chain:e.chain??(t==null?void 0:t.chain),key:r,name:a,transport:s,type:"bundlerClient"}),{client:t,dataSuffix:n??(t==null?void 0:t.dataSuffix),paymaster:i,paymasterContext:c,userOperation:o}).extend(ca)}function Pn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ua(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function nt(e,...t){if(!ua(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function fa(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Pn(e.outputLen),Pn(e.blockLen)}function Qe(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function da(e,t){nt(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const we=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),K=(e,t)=>e<<32-t|e>>>t;function la(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function an(e){return typeof e=="string"&&(e=la(e)),nt(e),e}function pa(...e){let t=0;for(let r=0;r<e.length;r++){const a=e[r];nt(a),t+=a.length}const n=new Uint8Array(t);for(let r=0,a=0;r<e.length;r++){const i=e[r];n.set(i,a),a+=i.length}return n}class Qn{clone(){return this._cloneInto()}}function ya(e){const t=r=>e().update(an(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ma(e=32){if(we&&typeof we.getRandomValues=="function")return we.getRandomValues(new Uint8Array(e));if(we&&typeof we.randomBytes=="function")return we.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function ha(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const a=BigInt(32),i=BigInt(4294967295),c=Number(n>>a&i),s=Number(n&i),o=r?4:0,f=r?0:4;e.setUint32(t+o,c,r),e.setUint32(t+f,s,r)}const ga=(e,t,n)=>e&t^~e&n,_a=(e,t,n)=>e&t^e&n^t&n;class ba extends Qn{constructor(t,n,r,a){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=a,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=dt(this.buffer)}update(t){Qe(this);const{view:n,buffer:r,blockLen:a}=this;t=an(t);const i=t.length;for(let c=0;c<i;){const s=Math.min(a-this.pos,i-c);if(s===a){const o=dt(t);for(;a<=i-c;
vendor: 6,741 bytes, line 4
4c+=a)this.process(o,c);continue}r.set(t.subarray(c,c+s),this.pos),this.pos+=s,c+=s,this.pos===a&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Qe(this),da(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:a,isLE:i}=this;let{pos:c}=this;n[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>a-c&&(this.process(r,0),c=0);for(let u=c;u<a;u++)n[u]=0;ha(r,a-8,BigInt(this.length*8),i),this.process(r,0);const s=dt(t),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=o/4,m=this.get();if(f>m.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<f;u++)s.setUint32(4*u,m[u],i)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:a,finished:i,destroyed:c,pos:s}=this;return t.length=a,t.pos=s,t.finished=i,t.destroyed=c,a%n&&t.buffer.set(r),t}}const wa=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]),ie=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),oe=new Uint32Array(64);class va extends ba{constructor(){super(64,32,8,!1),this.A=ie[0]|0,this.B=ie[1]|0,this.C=ie[2]|0,this.D=ie[3]|0,this.E=ie[4]|0,this.F=ie[5]|0,this.G=ie[6]|0,this.H=ie[7]|0}get(){const{A:t,B:n,C:r,D:a,E:i,F:c,G:s,H:o}=this;return[t,n,r,a,i,c,s,o]}set(t,n,r,a,i,c,s,o){this.A=t|0,this.B=n|0,this.C=r|0,this.D=a|0,this.E=i|0,this.F=c|0,this.G=s|0,this.H=o|0}process(t,n){for(let u=0;u<16;u++,n+=4)oe[u]=t.getUint32(n,!1);for(let u=16;u<64;u++){const y=oe[u-15],p=oe[u-2],l=K(y,7)^K(y,18)^y>>>3,b=K(p,17)^K(p,19)^p>>>10;oe[u]=b+oe[u-7]+l+oe[u-16]|0}let{A:r,B:a,C:i,D:c,E:s,F:o,G:f,H:m}=this;for(let u=0;u<64;u++){const y=K(s,6)^K(s,11)^K(s,25),p=m+y+ga(s,o,f)+wa[u]+oe[u]|0,b=(K(r,2)^K(r,13)^K(r,22))+_a(r,a,i)|0;m=f,f=o,o=s,s=c+p|0,c=i,i=a,a=r,r=p+b|0}r=r+this.A|0,a=a+this.B|0,i=i+this.C|0,c=c+this.D|0,s=s+this.E|0,o=o+this.F|0,f=f+this.G|0,m=m+this.H|0,this.set(r,a,i,c,s,o,f,m)}roundClean(){oe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const xa=ya(()=>new va);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rt=BigInt(0),at=BigInt(1),Ea=BigInt(2);function he(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ce(e){if(!he(e))throw new Error("Uint8Array expected")}function Oe(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const Oa=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pe(e){Ce(e);let t="";for(let n=0;n<e.length;n++)t+=Oa[e[n]];return t}function ve(e){const t=e.toString(16);return t.length&1?"0"+t:t}function on(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?rt:BigInt("0x"+e)}const J={_0:48,_9:57,A:65,F:70,a:97,f:102};function Bn(e){if(e>=J._0&&e<=J._9)return e-J._0;if(e>=J.A&&e<=J.F)return e-(J.A-10);if(e>=J.a&&e<=J.f)return e-(J.a-10)}function Be(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let a=0,i=0;a<n;a++,i+=2){const c=Bn(e.charCodeAt(i)),s=Bn(e.charCodeAt(i+1));if(c===void 0||s===void 0){const o=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+o+'" at index '+i)}r[a]=c*16+s}return r}function ye(e){return on(Pe(e))}function sn(e){return Ce(e),on(Pe(Uint8Array.from(e).reverse()))}function Ae(e,t){return Be(e.toString(16).padStart(t*2,"0"))}function cn(e,t){return Ae(e,t).reverse()}function Pa(e){return Be(ve(e))}function Y(e,t,n){let r;if(typeof t=="string")try{r=Be(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(he(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const a=r.length;if(typeof n=="number"&&a!==n)throw new Error(e+" of length "+n+" expected, got "+a);return r}function De(...e){let t=0;for(let r=0;r<e.length;r++){const a=e[r];Ce(a),t+=a.length}const n=new Uint8Array(t);for(let r=0,a=0;r<e.length;r++){const i=e[r];n.set(i,a),a+=i.length}return n}function Ba(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function Aa(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}const lt=e=>typeof e=="bigint"&&rt<=e;function it(e,t,n){return lt(e)&<(t)&<(n)&&t<=e&&e<n}function me(e,t,n,r){if(!it(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function Jn(e){let t;for(t=0;e>rt;e>>=at,t+=1);return t}function Sa(e,t){return e>>BigInt(t)&at}function Ga(e,t,n){return e|(n?at:rt)<<BigInt(t)}const un=e=>(Ea<<BigInt(e-1))-at,pt=e=>new Uint8Array(e),An=e=>Uint8Array.from(e);function er(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=pt(e),a=pt(e),i=0;const c=()=>{r.fill(1),a.fill(0),i=0},s=(...u)=>n(a,r,...u),o=(u=pt())=>{a=s(An([0]),u),r=s(),u.length!==0&&(a=s(An([1]),u),r=s())},f=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const y=[];for(;u<t;){r=s();const p=r.slice();y.push(p),u+=r.length}return De(...y)};return(u,y)=>{c(),o(u);let p;for(;!(p=y(f()));)o();return c(),p}}const La={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||he(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function ke(e,t,n={}){const r=(a,i,c)=>{const s=La[i];if(typeof s!="function")throw new Error("invalid validator function");const o=e[a];if(!(c&&o===void 0)&&!s(o,e))throw new Error("param "+String(a)+" is invali
4d. Expected "+i+", got "+o)};for(const[a,i]of Object.entries(t))r(a,i,!1);for(const[a,i]of Object.entries(n))r(a,i,!0);return e}const Ua=()=>{throw new Error("not implemented")};function Zt(e){const t=new WeakMap;return(n,...r)=>{const a=t.get(n);if(a!==void 0)return a;const i=e(n,...r);return t.set(n,i),i}}const Ia=Object.freeze(Object.defineProperty({__proto__:null,aInRange:me,abool:Oe,abytes:Ce,bitGet:Sa,bitLen:Jn,bitMask:un,bitSet:Ga,bytesToHex:Pe,bytesToNumberBE:ye,bytesToNumberLE:sn,concatBytes:De,createHmacDrbg:er,ensureBytes:Y,equalBytes:Ba,hexToBytes:Be,hexToNumber:on,inRange:it,isBytes:he,memoized:Zt,notImplemented:Ua,numberToBytesBE:Ae,numberToBytesLE:cn,numberToHexUnpadded:ve,numberToVarBytesBE:Pa,utf8ToBytes:Aa,validateObject:ke},Symbol.toStringTag,{value:"Module"}));class tr extends Qn{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,fa(t);const r=an(n);if(this.iHash=t.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 a=this.blockLen,i=new Uint8Array(a);i.set(r.length>a?t.create().update(r).digest():r);for(let c=0;c<i.length;c++)i[c]^=54;this.iHash.update(i),this.oHash=t.create();for(let c=0;c<i.length;c++)i[c]^=106;this.oHash.update(i),i.fill(0)}update(t){return Qe(this),this.iHash.update(t),this}digestInto(t){Qe(this),nt(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:a,destroyed:i,blockLen:c,outputLen:s}=this;return t=t,t.finished=a,t.destroyed=i,t.blockLen=c,t.outputLen=s,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const nr=(e,t,n)=>new tr(e,t).update(n).digest();nr.create=(e,t)=>new tr(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const M=BigInt(0),N=BigInt(1),de=BigInt(2),Da=BigInt(3),Wt=BigInt(4),Sn=BigInt(5),Gn=BigInt(8);function Z(e,t){const n=e%t;return n>=M?n:t+n}function Ca(e,t,n){if(t<M)throw new Error("invalid exponent, negatives unsupported");if(n<=M)throw new Error("invalid modulus");if(n===N)return M;let r=N;for(;t>M;)t&N&&(r=r*e%n),e=e*e%n,t>>=N;return r}function gi(e,t,n){let r=e;for(;t-- >M;)r*=r,r%=n;return r}function Yt(e,t){if(e===M)throw new Error("invert: expected non-zero number");if(t<=M)throw new Error("invert: expected positive modulus, got "+t);let n=Z(e,t),r=t,a=M,i=N;for(;n!==M;){const s=r/n,o=r%n,f=a-i*s;r=n,n=o,a=i,i=f}if(r!==N)throw new Error("invert: does not exist");return Z(a,t)}function ka(e){const t=(e-N)/de;let n,r,a;for(n=e-N,r=0;n%de===M;n/=de,r++);for(a=de;a<e&&Ca(a,t,e)!==e-N;a++)if(a>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const c=(e+N)/Wt;return function(o,f){const m=o.pow(f,c);if(!o.eql(o.sqr(m),f))throw new Error("Cannot find square root");return m}}const i=(n+N)/de;return function(s,o){if(s.pow(o,t)===s.neg(s.ONE))throw new Error("Cannot find square root");let f=r,m=s.pow(s.mul(s.ONE,a),n),u=s.pow(o,i),y=s.pow(o,n);for(;!s.eql(y,s.ONE);){if(s.eql(y,s.ZERO))return s.ZERO;let p=1;for(let b=s.sqr(y);p<f&&!s.eql(b,s.ONE);p++)b=s.sqr(b);const l=s.pow(m,N<<BigInt(f-p-1));m=s.sqr(l),u=s.mul(u,l),y=s.mul(y,m),f=p}return u}}function Fa(e){if(e%Wt===Da){const t=(e+N)/Wt;return function(r,a){const i=r.pow(a,t);if(!r.eql(r.sqr(i),a))throw new Error("Cannot find square root");return i}}if(e%Gn===Sn){const t=(e-Sn)/Gn;return function(r,a){const i=r.mul(a,de),c=r.pow(i,t),s=r.mul(a,c),o=r.mul(r.mul(s,de),c),f=r.mul(s,r.sub(o,r.ONE));if(!r.eql(r.sqr(f),a))throw new Error("Cannot find square root");return f}}return ka(e)}const Ta=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Na(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Ta.reduce((r,a)=>(r[a]="function",r),t);return ke(e,n)}
vendor: 15,117 bytes, line 4
4function Ha(e,t,n){if(n<M)throw new Error("invalid exponent, negatives unsupported");if(n===M)return e.ONE;if(n===N)return t;let r=e.ONE,a=t;for(;n>M;)n&N&&(r=e.mul(r,a)),a=e.sqr(a),n>>=N;return r}function Va(e,t){const n=new Array(t.length),r=t.reduce((i,c,s)=>e.is0(c)?i:(n[s]=i,e.mul(i,c)),e.ONE),a=e.inv(r);return t.reduceRight((i,c,s)=>e.is0(c)?i:(n[s]=e.mul(i,n[s]),e.mul(i,c)),a),n}function rr(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ar(e,t,n=!1,r={}){if(e<=M)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:a,nByteLength:i}=rr(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const s=Object.freeze({ORDER:e,isLE:n,BITS:a,BYTES:i,MASK:un(a),ZERO:M,ONE:N,create:o=>Z(o,e),isValid:o=>{if(typeof o!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof o);return M<=o&&o<e},is0:o=>o===M,isOdd:o=>(o&N)===N,neg:o=>Z(-o,e),eql:(o,f)=>o===f,sqr:o=>Z(o*o,e),add:(o,f)=>Z(o+f,e),sub:(o,f)=>Z(o-f,e),mul:(o,f)=>Z(o*f,e),pow:(o,f)=>Ha(s,o,f),div:(o,f)=>Z(o*Yt(f,e),e),sqrN:o=>o*o,addN:(o,f)=>o+f,subN:(o,f)=>o-f,mulN:(o,f)=>o*f,inv:o=>Yt(o,e),sqrt:r.sqrt||(o=>(c||(c=Fa(e)),c(s,o))),invertBatch:o=>Va(s,o),cmov:(o,f,m)=>m?f:o,toBytes:o=>n?cn(o,i):Ae(o,i),fromBytes:o=>{if(o.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+o.length);return n?sn(o):ye(o)}});return Object.freeze(s)}function ir(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function or(e){const t=ir(e);return t+Math.ceil(t/2)}function Ra(e,t,n=!1){const r=e.length,a=ir(t),i=or(t);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const c=n?sn(e):ye(e),s=Z(c,t-N)+N;return n?cn(s,a):Ae(s,a)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ln=BigInt(0),Te=BigInt(1);function yt(e,t){const n=t.negate();return e?n:t}function sr(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function mt(e,t){sr(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1);return{windows:n,windowSize:r}}function Ma(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function ja(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const ht=new WeakMap,cr=new WeakMap;function gt(e){return cr.get(e)||1}function za(e,t){return{constTimeNegate:yt,hasPrecomputes(n){return gt(n)!==1},unsafeLadder(n,r,a=e.ZERO){let i=n;for(;r>Ln;)r&Te&&(a=a.add(i)),i=i.double(),r>>=Te;return a},precomputeWindow(n,r){const{windows:a,windowSize:i}=mt(r,t),c=[];let s=n,o=s;for(let f=0;f<a;f++){o=s,c.push(o);for(let m=1;m<i;m++)o=o.add(s),c.push(o);s=o.double()}return c},wNAF(n,r,a){const{windows:i,windowSize:c}=mt(n,t);let s=e.ZERO,o=e.BASE;const f=BigInt(2**n-1),m=2**n,u=BigInt(n);for(let y=0;y<i;y++){const p=y*c;let l=Number(a&f);a>>=u,l>c&&(l-=m,a+=Te);const b=p,d=p+Math.abs(l)-1,h=y%2!==0,g=l<0;l===0?o=o.add(yt(h,r[b])):s=s.add(yt(g,r[d]))}return{p:s,f:o}},wNAFUnsafe(n,r,a,i=e.ZERO){const{windows:c,windowSize:s}=mt(n,t),o=BigInt(2**n-1),f=2**n,m=BigInt(n);for(let u=0;u<c;u++){const y=u*s;if(a===Ln)break;let p=Number(a&o);if(a>>=m,p>s&&(p-=f,a+=Te),p===0)continue;let l=r[y+Math.abs(p)-1];p<0&&(l=l.negate()),i=i.add(l)}return i},getPrecomputes(n,r,a){let i=ht.get(r);return i||(i=this.precomputeWindow(r,n),n!==1&&ht.set(r,a(i))),i},wNAFCached(n,r,a){const i=gt(n);return this.wNAF(i,this.getPrecomputes(i,n,a),r)},wNAFCachedUnsafe(n,r,a,i){const c=gt(n);return c===1?this.unsafeLadder(n,r,i):this.wNAFUnsafe(c,this.getPrecomputes(c,n,a),r,i)},setWindowSize(n,r){sr(r,t),cr.set(n,r),ht.delete(n)}}}function $a(e,t,n,r){if(Ma(n,e),ja(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,i=Jn(BigInt(n.length)),c=i>12?i-3:i>4?i-2:i?2:1,s=(1<<c)-1,o=new Array(s+1).fill(a),f=Math.floor((t.BITS-1)/c)*c;let m=a;for(let u=f;u>=0;u-=c){o.fill(a);for(let p=0;p<r.length;p++){const l=r[p],b=Number(l>>BigInt(u)&BigInt(s));o[b]=o[b].add(n[p])}let y=a;for(let p=o.length-1,l=a;p>0;p--)l=l.add(o[p]),y=y.add(l);if(m=m.add(y),u!==0)for(let p=0;p<c;p++)m=m.double()}return m}function ur(e){return Na(e.Fp),ke(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rr(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Un(e){e.lowS!==void 0&&Oe("lowS",e.lowS),e.prehash!==void 0&&Oe("prehash",e.prehash)}function qa(e){const t=ur(e);ke(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a}=t;if(n){if(!r.eql(a,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:Za,hexToBytes:Wa}=Ia;class Ya extends Error{constructor(t=""){super(t)}}const ee={Err:Ya,_tlv:{encode:(e,t)=>{const{Err:n}=ee;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,a=ve(r);if(a.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?ve(a.length/2|128):"";return ve(e)+i+a+t},decode(e,t){const{Err:n}=ee;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const a=t[r++],i=!!(a&128);let c=0;if(!i)c=a;else{const o=a&127;if(!o)throw new n("tlv.decode(long): indefinite length not supported");if(o>4)throw new n("tlv.decode(long): byte length is too big");const f=t.subarray(r,r+o);if(f.length!==o)throw new n("tlv.decode: length bytes not complete");if(f[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const m of f)c=c<<8|m;if(r+=o,c<128)throw new n("tlv.decode(long): not minimal encoding")}const s=t.subarray(r,r+c);if(s.length!==c)throw new n("tlv.decode: wrong value length");return{v:s,l:t.subarray(r+c)}}},_int:{encode(e){const{Err:t}=ee;if(e<ne)throw new t("integer: negative integers are not allowed");let n=ve(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=ee;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Za(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=ee,a=typeof e=="string"?Wa(e):e;Ce(a);const{v:i,l:c}=r.decode(48,a);if(c.length)throw new t("invalid signature: left bytes after parsing");const{v:s,l:o}=r.decode(2,i),{v:f,l:m}=r.decode(2,o);if(m.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(s),s:n.decode(f)}},hexFromSig(e){const{_tlv:t,_int:n}=ee,r=t.encode(2,n.encode(e.r)),a=t.encode(2,n.encode(e.s)),i=r+a;return t.encode(48,i)}},ne=BigInt(0),R=BigInt(1);BigInt(2);const In=BigInt(3);BigInt(4);function Ka(e){const t=qa(e),{Fp:n}=t,r=ar(t.n,t.nBitLength),a=t.toBytes||((b,d,h)=>{const g=d.toAffine();return De(Uint8Array.from([4]),n.toBytes(g.x),n.toBytes(g.y))}),i=t.fromBytes||(b=>{const d=b.subarray(1),h=n.fromBytes(d.subarray(0,n.BYTES)),g=n.fromBytes(d.subarray(n.BYTES,2*n.BYTES));return{x:h,y:g}});function c(b){const{a:d,b:h}=t,g=n.sqr(b),x=n.mul(g,b);return n.add(n.add(x,n.mul(b,d)),h)}if(!n.eql(n.sqr(t.Gy),c(t.Gx)))throw new Error("bad generator point: equation left != right");function s(b){return it(b,R,t.n)}function o(b){const{allowedPrivateKeyLengths:d,nByteLength:h,wrapPrivateKey:g,n:x}=t;if(d&&typeof b!="bigint"){if(he(b)&&(b=Pe(b)),typeof b!="string"||!d.includes(b.length))throw new Error("invalid private key");b=b.padStart(h*2,"0")}let O;try{O=typeof b=="bigint"?b:ye(Y("private key",b,h))}catch{throw new Error("invalid private key, expected hex or "+h+" bytes, got "+typeof b)}return g&&(O=Z(O,x)),me("private key",O,R,x),O}function f(b){if(!(b instanceof y))throw new Error("ProjectivePoint expected")}const m=Zt((b,d)=>{const{px:h,py:g,pz:x}=b;if(n.eql(x,n.ONE))return{x:h,y:g};const O=b.is0();d==null&&(d=O?n.ONE:n.inv(x));const U=n.mul(h,d),S=n.mul(g,d),B=n.mul(x,d);if(O)return{x:n.ZERO,y:n.ZERO};if(!n.eql(B,n.ONE))throw new Error("invZ was invalid");return{x:U,y:S}}),u=Zt(b=>{if(b.is0()){if(t.allowInfinityPoint&&!n.is0(b.py))return;throw new Error("bad point: ZERO")}const{x:d,y:h}=b.toAffine();if(!n.isValid(d)||!n.isValid(h))throw new Error("bad point: x or y not FE");const g=n.sqr(h),x=c(d);if(!n.eql(g,x))throw new Error("bad point: equation left != right");if(!b.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class y{constructor(d,h,g){if(this.px=d,this.py=h,this.pz=g,d==null||!n.isValid(d))throw new Error("x required");if(h==null||!n.isValid(h))throw new Error("y required");if(g==null||!n.isValid(g))throw new Error("z required");Object.freeze(this)}static fromAffine(d){const{x:h,y:g}=d||{};if(!d||!n.isValid(h)||!n.isValid(g))throw new Error("invalid affine point");if(d instanceof y)throw new Error("projective point not allowed");const x=O=>n.eql(O,n.ZERO);return x(h)&&x(g)?y.ZERO:new y(h,g,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(d){const h=n.invertBatch(d.map(g=>g.pz));return d.map((g,x)=>g.toAffine(h[x])).map(y.fromAffine)}static fromHex(d){const h=y.fromAffine(i(Y("pointHex",d)));return h.assertValidity(),h}static fromPrivateKey(d){return y.BASE.multiply(o(d))}static msm(d,h){return $a(y,r,d,h)}_setWindowSize(d){l.setWindowSize(this,d)}assertValidity(){u(this)}hasEvenY(){const{y:d}=this.toAffine();if(n.isOdd)return!n.isOdd(d);throw new Error("Field doesn't support isOdd")}equals(d){f(d);const{px:h,py:g,pz:x}=this,{px:O,py:U,pz:S}=d,B=n.eql(n.mul(h,S),n.mul(O,x)),A=n.eql(n.mul(g,S),n.mul(U,x));return B&&A}negate(){return new y(this.px,n.neg(this.py),this.pz)}double(){const{a:d,b:h}=t,g=n.mul(h,In),{px:x,py:O,pz:U}=this;let S=n.ZERO,B=n.ZERO,A=n.ZERO,_=n.mul(x,x),P=n.mul(O,O),I=n.mul(U,U),C=n.mul(x,O);return C=n.add(C,C),A=n.mul(x,U),A=n.add(A,A),S=n.mul(d,A),B=n.mul(g,I),B=n.add(S,B),S=n.sub(P,B),B=n.add(P,B),B=n.mul(S,B),S=n.mul(C,S),A=n.mul(g,A),I=n.mul(d,I),C=n.sub(_,I),C=n.mul(d,C),C=n.add(C,A),A=n.add(_,_),_=n.add(A,_),_=n.add(_,I),_=n.mul(_,C),B=n.add(B,_),I=n.mul(O,U),I=n.add(I,I),_=n.mul(I,C),S=n.sub(S,_),A=n.mul(I,P),A=n.add(A,A),A=n.add(A,A),new y(S,B,A)}add(d){f(d);const{px:h,py:g,pz:x}=this,{px:O,py:U,pz:S}=d;let B=n.ZERO,A=n.ZERO,_=n.ZERO;const P=t.a,I=n.mul(t.b,In);let C=n.mul(h,O),q=n.mul(g,U),w=n.mul(x,S),v=n.add(h,g),E=n.add(O,U);v=n.mul(v,E),E=n.add(C,q),v=n.sub(v,E),E=n.add(h,x);let L=n.add(O,S);return E=n.mul(E,L),L=n.add(C,w),E=n.sub(E,L),L=n.add(g,x),B=n.add(U,S),L=n.mul(L,B),B=n.add(q,w),L=n.sub(L,B),_=n.mul(P,E),B=n.mul(I,w),_=n.add(B,_),B=n.sub(q,_),_=n.add(q,_),A=n.mul(B,_),q=n.add(C,C),q=n.add(q,C),w=n.mul(P,w),E=n.mul(I,E),q=n.add(q,w),w=n.sub(C,w),w=n.mul(P,w),E=n.add(E,w),C=n.mul(q,E),A=n.add(A,C),C=n.mul(L,E),B=n.mul(v,B),B=n.sub(B,C),C=n.mul(v,q),_=n.mul(L,_),_=n.add(_,C),new y(B,A,_)}subtract(d){return this.add(d.negate())}is0(){return this.equals(y.ZERO)}wNAF(d){return l.wNAFCached(this,d,y.normalizeZ)}multiplyUnsafe(d){const{endo:h,n:g}=t;me("scalar",d,ne,g);const x=y.ZERO;if(d===ne)return x;if(this.is0()||d===R)return this;if(!h||l.hasPrecomputes(this))return l.wNAFCachedUnsafe(this,d,y.normalizeZ);let{k1neg:O,k1:U,k2neg:S,k2:B}=h.splitScalar(d),A=x,_=x,P=this;for(;U>ne||B>ne;)U&R&&(A=A.add(P)),B&R&&(_=_.add(P)),P=P.double(),U>>=R,B>>=R;return O&&(A=A.negate()),S&&(_=_.negate()),_=new y(n.mul(_.px,h.beta),_.py,_.pz),A.add(_)}multiply(d){const{endo:h,n:g}=t;me("scalar",d,R,g);let x,O;if(h){const{k1neg:U,k1:S,k2neg:B,k2:A}=h.splitScalar(d);let{p:_,f:P}=this.wNAF(S),{p:I,f:C}=this.wNAF(A);_=l.constTimeNegate(U,_),I=l.constTimeNegate(B,I),I=new y(n.mul(I.px,h.beta),I.py,I.pz),x=_.add(I),O=P.add(C)}else{const{p:U,f:S}=this.wNAF(d);x=U,O=S}return y.normalizeZ([x,O])[0]}multiplyAndAddUnsafe(d,h,g){const x=y.BASE,O=(S,B)=>B===ne||B===R||!S.equals(x)?S.multiplyUnsafe(B):S.multiply(B),U=O(this,h).add(O(d,g));return U.is0()?void 0:U}toAffine(d){return m(this,d)}isTorsionFree(){const{h:d,isTorsionFree:h}=t;if(d===R)return!0;if(h)return h(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:d,clearCofactor:h}=t;return d===R?this:h?h(y,this):this.multiplyUnsafe(t.h)}toRawBytes(d=!0){return Oe("isCompressed",d),this.assertValidity(),a(y,this,d)}toHex(d=!0){return Oe("isCompressed",d),Pe(this.toRawBytes(d))}}y.BASE=new y(t.Gx,t.Gy,n.ONE),y.ZERO=new y(n.ZERO,n.ONE,n.ZERO);const p=t.nBitLength,l=za(y,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:o,weierstrassEquation:c,isWithinCurveOrder:s}}function Xa(e){const t=ur(e);return ke(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Qa(e){const t=Xa(e),{Fp:n,n:r}=t,a=n.BYTES+1,i=2*n.BYTES+1;function c(w){return Z(w,r)}function s(w){return Yt(w,r)}const{ProjectivePoint:o,normPrivateKeyToScalar:f,weierstrassEquation:m,isWithinCurveOrder:u}=Ka({...t,toBytes(w,v,E){const L=v.toAffine(),D=n.toBytes(L.x),H=De;return Oe("isCompressed",E),E?H(Uint8Array.from([v.hasEvenY()?2:3]),D):H(Uint8Array.from([4]),D,n.toBytes(L.y))},fromBytes(w){const v=w.length,E=w[0],L=w.subarray(1);if(v===a&&(E===2||E===3)){const D=ye(L);if(!it(D,R,n.ORDER))throw new Error("Point is not on curve");const H=m(D);let z;try{z=n.sqrt(H)}catch(W){const $=W instanceof Error?": "+W.message:"";throw new Error("Point is not on curve"+$)}const j=(z&R)===R;return(E&1)===1!==j&&(z=n.neg(z)),{x:D,y:z}}else if(v===i&&E===4){const D=n.fromBytes(L.subarray(0,n.BYTES)),H=n.fromBytes(L.subarray(n.BYTES,2*n.BYTES));return{x:D,y:H}}else{const D=a,H=i;throw new Error("invalid Point, expected length of "+D+", or uncompressed "+H+", got "+v)}}}),y=w=>Pe(Ae(w,t.nByteLength));function p(w){const v=r>>R;return w>v}function l(w){return p(w)?c(-w):w}const b=(w,v,E)=>ye(w.slice(v,E));class d{constructor(v,E,L){this.r=v,this.s=E,this.recovery=L,this.assertValidity()}static fromCompact(v){const E=t.nByteLength;return v=Y("compactSignature",v,E*2),new d(b(v,0,E),b(v,E,2*E))}static fromDER(v){const{r:E,s:L}=ee.toSig(Y("DER",v));return new d(E,L)}assertValidity(){me("r",this.r,R,r),me("s",this.s,R,r)}addRecoveryBit(v){return new d(this.r,this.s,v)}recoverPublicKey(v){const{r:E,s:L,recovery:D}=this,H=S(Y("msgHash",v));if(D==null||![0,1,2,3].includes(D))throw new Error("recovery id invalid");const z=D===2||D===3?E+t.n:E;
4if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const j=D&1?"03":"02",Q=o.fromHex(j+y(z)),W=s(z),$=c(-H*W),ge=c(L*W),re=o.BASE.multiplyAndAddUnsafe(Q,$,ge);if(!re)throw new Error("point at infinify");return re.assertValidity(),re}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new d(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Be(this.toDERHex())}toDERHex(){return ee.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Be(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}const h={isValidPrivateKey(w){try{return f(w),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const w=or(t.n);return Ra(t.randomBytes(w),t.n)},precompute(w=8,v=o.BASE){return v._setWindowSize(w),v.multiply(BigInt(3)),v}};function g(w,v=!0){return o.fromPrivateKey(w).toRawBytes(v)}function x(w){const v=he(w),E=typeof w=="string",L=(v||E)&&w.length;return v?L===a||L===i:E?L===2*a||L===2*i:w instanceof o}function O(w,v,E=!0){if(x(w))throw new Error("first arg must be private key");if(!x(v))throw new Error("second arg must be public key");return o.fromHex(v).multiply(f(w)).toRawBytes(E)}const U=t.bits2int||function(w){if(w.length>8192)throw new Error("input is too large");const v=ye(w),E=w.length*8-t.nBitLength;return E>0?v>>BigInt(E):v},S=t.bits2int_modN||function(w){return c(U(w))},B=un(t.nBitLength);function A(w){return me("num < 2^"+t.nBitLength,w,ne,B),Ae(w,t.nByteLength)}function _(w,v,E=P){if(["recovered","canonical"].some(ce=>ce in E))throw new Error("sign() legacy options not supported");const{hash:L,randomBytes:D}=t;let{lowS:H,prehash:z,extraEntropy:j}=E;H==null&&(H=!0),w=Y("msgHash",w),Un(E),z&&(w=Y("prehashed msgHash",L(w)));const Q=S(w),W=f(v),$=[A(W),A(Q)];if(j!=null&&j!==!1){const ce=j===!0?D(n.BYTES):j;$.push(Y("extraEntropy",ce))}const ge=De(...$),re=Q;function ot(ce){const _e=U(ce);if(!u(_e))return;const st=s(_e),Se=o.BASE.multiply(_e).toAffine(),ue=c(Se.x);if(ue===ne)return;const Ge=c(st*c(re+ue*W));if(Ge===ne)return;let Le=(Se.x===ue?0:2)|Number(Se.y&R),be=Ge;return H&&p(Ge)&&(be=l(Ge),Le^=1),new d(ue,be,Le)}return{seed:ge,k2sig:ot}}const P={lowS:t.lowS,prehash:!1},I={lowS:t.lowS,prehash:!1};function C(w,v,E=P){const{seed:L,k2sig:D}=_(w,v,E),H=t;return er(H.hash.outputLen,H.nByteLength,H.hmac)(L,D)}o.BASE._setWindowSize(8);function q(w,v,E,L=I){var Le;const D=w;v=Y("msgHash",v),E=Y("publicKey",E);const{lowS:H,prehash:z,format:j}=L;if(Un(L),"strict"in L)throw new Error("options.strict was renamed to lowS");if(j!==void 0&&j!=="compact"&&j!=="der")throw new Error("format must be compact or der");
4const Q=typeof D=="string"||he(D),W=!Q&&!j&&typeof D=="object"&&D!==null&&typeof D.r=="bigint"&&typeof D.s=="bigint";if(!Q&&!W)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let $,ge;try{if(W&&($=new d(D.r,D.s)),Q){try{j!=="compact"&&($=d.fromDER(D))}catch(be){if(!(be instanceof ee.Err))throw be}!$&&j!=="der"&&($=d.fromCompact(D))}ge=o.fromHex(E)}catch{return!1}if(!$||H&&$.hasHighS())return!1;z&&(v=t.hash(v));const{r:re,s:ot}=$,ce=S(v),_e=s(ot),st=c(ce*_e),Se=c(re*_e),ue=(Le=o.BASE.multiplyAndAddUnsafe(ge,st,Se))==null?void 0:Le.toAffine();return ue?c(ue.x)===re:!1}return{CURVE:t,getPublicKey:g,getSharedSecret:O,sign:C,verify:q,ProjectivePoint:o,Signature:d,utils:h}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ja(e){return{hash:e,hmac:(t,...n)=>nr(e,t,pa(...n)),randomBytes:ma}}function ei(e,t){const n=r=>Qa({...e,...Ja(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fr=ar(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),ti=fr.create(BigInt("-3")),ni=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),_i=ei({a:ti,b:ni,Fp:fr,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},xa);export{si as B,ar as F,di as T,Dr as _,hi as a,pi as b,ci as c,ei as d,li as e,gi as f,yi as g,ui as h,k as l,Z as m,_i as p,xa as s,mi as t,fi as y};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.