@smartledger/bsv 7.4.0 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +38 -38
- package/bsv-gdaf.min.js +6 -6
- package/bsv-ltp.min.js +6 -6
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +6 -6
- package/bsv.d.ts +18 -5
- package/bsv.min.js +6 -6
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/lib/script/interpreter.js +47 -6
- package/package.json +1 -1
- package/test/ordinals/inscription.js +94 -0
- package/test/ordinals/ordlock.js +10 -20
- package/test/script/genesis_limits.js +44 -8
- package/test/smart_contract/covenants.js +2 -4
- package/test/smart_contract/dsl_debugger.js +2 -4
- package/test/smart_contract/ordinal_transfer.js +2 -4
- package/test/smart_contract/sighash_marketplace.js +2 -4
- package/test/smart_contract/token_generalized.js +2 -4
- package/version.js +1 -1
package/bsv.min.js
CHANGED
|
@@ -8,15 +8,15 @@ Use Chrome, Firefox or Internet Explorer 11`)}var DU=nt().Buffer,od=globalThis.c
|
|
|
8
8
|
`))):s=e.stylize("[Circular]","special")),xu(a)){if(o&&n.match(/^\d+$/))return s;a=JSON.stringify(""+n),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function gj(e,t,r){var i=0,n=e.reduce(function(o,a){return i++,a.indexOf(`
|
|
9
9
|
`)>=0&&i++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(t===""?"":t+`
|
|
10
10
|
`)+" "+e.join(`,
|
|
11
|
-
`)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}ht.types=a_();function l_(e){return Array.isArray(e)}ht.isArray=l_;function Rg(e){return typeof e=="boolean"}ht.isBoolean=Rg;function qd(e){return e===null}ht.isNull=qd;function vj(e){return e==null}ht.isNullOrUndefined=vj;function h_(e){return typeof e=="number"}ht.isNumber=h_;function Ud(e){return typeof e=="string"}ht.isString=Ud;function mj(e){return typeof e=="symbol"}ht.isSymbol=mj;function xu(e){return e===void 0}ht.isUndefined=xu;function vh(e){return cc(e)&&Bg(e)==="[object RegExp]"}ht.isRegExp=vh;ht.types.isRegExp=vh;function cc(e){return typeof e=="object"&&e!==null}ht.isObject=cc;function Ld(e){return cc(e)&&Bg(e)==="[object Date]"}ht.isDate=Ld;ht.types.isDate=Ld;function mh(e){return cc(e)&&(Bg(e)==="[object Error]"||e instanceof Error)}ht.isError=mh;ht.types.isNativeError=mh;function Cd(e){return typeof e=="function"}ht.isFunction=Cd;function yj(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}ht.isPrimitive=yj;ht.isBuffer=u_();function Bg(e){return Object.prototype.toString.call(e)}function Tg(e){return e<10?"0"+e.toString(10):e.toString(10)}var bj=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _j(){var e=new Date,t=[Tg(e.getHours()),Tg(e.getMinutes()),Tg(e.getSeconds())].join(":");return[e.getDate(),bj[e.getMonth()],t].join(" ")}ht.log=function(){console.log("%s - %s",_j(),ht.format.apply(ht,arguments))};ht.inherits=Ot();ht._extend=function(e,t){if(!t||!cc(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};function d_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Su=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ht.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(Su&&t[Su]){var r=t[Su];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,Su,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var i,n,o=new Promise(function(u,c){i=u,n=c}),a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);a.push(function(u,c){u?n(u):i(c)});try{t.apply(this,a)}catch(u){n(u)}return o}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Su&&Object.defineProperty(r,Su,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,f_(t))};ht.promisify.custom=Su;function wj(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function Sj(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');function t(){for(var r=[],i=0;i<arguments.length;i++)r.push(arguments[i]);var n=r.pop();if(typeof n!="function")throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return n.apply(o,arguments)};e.apply(this,r).then(function(s){A.default.nextTick(a.bind(null,null,s))},function(s){A.default.nextTick(wj.bind(null,s,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,f_(e)),t}ht.callbackify=Sj});var b_=k((hce,y_)=>{"use strict";v();function p_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function g_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p_(Object(r),!0).forEach(function(i){xj(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p_(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function xj(e,t,r){return t=m_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ej(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v_(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,m_(i.key),i)}}function Oj(e,t,r){return t&&v_(e.prototype,t),r&&v_(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function m_(e){var t=Ij(e,"string");return typeof t=="symbol"?t:String(t)}function Ij(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Aj=Kt(),Fd=Aj.Buffer,Pj=rn(),Mg=Pj.inspect,Tj=Mg&&Mg.custom||"inspect";function kj(e,t,r){Fd.prototype.copy.call(e,t,r)}y_.exports=(function(){function e(){Ej(this,e),this.head=null,this.tail=null,this.length=0}return Oj(e,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return Fd.alloc(0);for(var i=Fd.allocUnsafe(r>>>0),n=this.head,o=0;n;)kj(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var a=i.data,s=r>a.length?a.length:r;if(s===a.length?o+=a:o+=a.slice(0,r),r-=s,r===0){s===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=Fd.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,s=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,s),r-=s,r===0){s===a.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++o}return this.length-=o,i}},{key:Tj,value:function(r,i){return Mg(this,g_(g_({},i),{},{depth:0,customInspect:!1}))}}]),e})()});var Cg=k((pce,w_)=>{"use strict";v();function Rj(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,A.default.nextTick(Ng,this,e)):A.default.nextTick(Ng,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted?A.default.nextTick(Hd,r):(r._writableState.errorEmitted=!0,A.default.nextTick(__,r,o)):A.default.nextTick(__,r,o):t?(A.default.nextTick(Hd,r),t(o)):A.default.nextTick(Hd,r)}),this)}function __(e,t){Ng(e,t),Hd(e)}function Hd(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Bj(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ng(e,t){e.emit("error",t)}function Mj(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}w_.exports={destroy:Rj,undestroy:Bj,errorOrDestroy:Mj}});var Eu=k((vce,E_)=>{"use strict";v();function Nj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var x_={};function nn(e,t,r){r||(r=Error);function i(o,a,s){return typeof t=="string"?t:t(o,a,s)}var n=(function(o){Nj(a,o);function a(s,u,c){return o.call(this,i(s,u,c))||this}return a})(r);n.prototype.name=r.name,n.prototype.code=e,x_[e]=n}function S_(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Cj(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Dj(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Lj(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}nn("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);nn("ERR_INVALID_ARG_TYPE",function(e,t,r){var i;typeof t=="string"&&Cj(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(Dj(e," argument"))n="The ".concat(e," ").concat(i," ").concat(S_(t,"type"));else{var o=Lj(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(i," ").concat(S_(t,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);nn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");nn("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});nn("ERR_STREAM_PREMATURE_CLOSE","Premature close");nn("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});nn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");nn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");nn("ERR_STREAM_WRITE_AFTER_END","write after end");nn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);nn("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);nn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");E_.exports.codes=x_});var Dg=k((yce,O_)=>{"use strict";v();var qj=Eu().codes.ERR_INVALID_OPT_VALUE;function Uj(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Fj(e,t,r,i){var n=Uj(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new qj(o,n)}return Math.floor(n)}return e.objectMode?16:16*1024}O_.exports={getHighWaterMark:Fj}});var qg=k((_ce,I_)=>{v();I_.exports=Hj;function Hj(e,t){if(Lg("noDeprecation"))return e;var r=!1;function i(){if(!r){if(Lg("throwDeprecation"))throw new Error(t);Lg("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return i}function Lg(e){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}});var Hg=k((Sce,B_)=>{"use strict";v();B_.exports=ur;function P_(e){var t=this;this.next=null,this.entry=null,this.finish=function(){pz(t,e)}}var lc;ur.WritableState=bh;var jj={deprecate:qg()},T_=eg(),zd=Kt().Buffer,zj=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Kj(e){return zd.from(e)}function Vj(e){return zd.isBuffer(e)||e instanceof zj}var Fg=Cg(),Gj=Dg(),Zj=Gj.getHighWaterMark,is=Eu().codes,Wj=is.ERR_INVALID_ARG_TYPE,Yj=is.ERR_METHOD_NOT_IMPLEMENTED,$j=is.ERR_MULTIPLE_CALLBACK,Xj=is.ERR_STREAM_CANNOT_PIPE,Jj=is.ERR_STREAM_DESTROYED,Qj=is.ERR_STREAM_NULL_VALUES,ez=is.ERR_STREAM_WRITE_AFTER_END,tz=is.ERR_UNKNOWN_ENCODING,hc=Fg.errorOrDestroy;yu()(ur,T_);function rz(){}function bh(e,t,r){lc=lc||Ou(),e=e||{},typeof r!="boolean"&&(r=t instanceof lc),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Zj(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){fz(t,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new P_(this)}bh.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(bh.prototype,"buffer",{get:jj.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var jd;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(jd=Function.prototype[Symbol.hasInstance],Object.defineProperty(ur,Symbol.hasInstance,{value:function(t){return jd.call(this,t)?!0:this!==ur?!1:t&&t._writableState instanceof bh}})):jd=function(t){return t instanceof this};function ur(e){lc=lc||Ou();var t=this instanceof lc;if(!t&&!jd.call(ur,this))return new ur(e);this._writableState=new bh(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),T_.call(this)}ur.prototype.pipe=function(){hc(this,new Xj)};function iz(e,t){var r=new ez;hc(e,r),A.default.nextTick(t,r)}function nz(e,t,r,i){var n;return r===null?n=new Qj:typeof r!="string"&&!t.objectMode&&(n=new Wj("chunk",["string","Buffer"],r)),n?(hc(e,n),A.default.nextTick(i,n),!1):!0}ur.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&Vj(e);return o&&!zd.isBuffer(e)&&(e=Kj(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=rz),i.ending?iz(this,r):(o||nz(this,i,e,r))&&(i.pendingcb++,n=az(this,i,o,e,t,r)),n};ur.prototype.cork=function(){this._writableState.corked++};ur.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&k_(this,e))};ur.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new tz(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oz(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=zd.from(t,r)),t}Object.defineProperty(ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function az(e,t,r,i,n,o){if(!r){var a=oz(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Ug(e,t,!1,s,i,n,o);return u}function Ug(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Jj("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function sz(e,t,r,i,n){--t.pendingcb,r?(A.default.nextTick(n,i),A.default.nextTick(yh,e,t),e._writableState.errorEmitted=!0,hc(e,i)):(n(i),e._writableState.errorEmitted=!0,hc(e,i),yh(e,t))}function uz(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function fz(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new $j;if(uz(r),t)sz(e,r,i,t,n);else{var o=R_(r)||e.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&k_(e,r),i?A.default.nextTick(A_,e,r,o,n):A_(e,r,o,n)}}function A_(e,t,r,i){r||cz(e,t),t.pendingcb--,i(),yh(e,t)}function cz(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function k_(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,Ug(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new P_(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,m=t.objectMode?1:u.length;if(Ug(e,t,!1,m,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ur.prototype._write=function(e,t,r){r(new Yj("_write()"))};ur.prototype._writev=null;ur.prototype.end=function(e,t,r){var i=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||dz(this,i,r),this};Object.defineProperty(ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function R_(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function lz(e,t){e._final(function(r){t.pendingcb--,r&&hc(e,r),t.prefinished=!0,e.emit("prefinish"),yh(e,t)})}function hz(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,A.default.nextTick(lz,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function yh(e,t){var r=R_(t);if(r&&(hz(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}function dz(e,t,r){t.ending=!0,yh(e,t),r&&(t.finished?A.default.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function pz(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ur.prototype.destroy=Fg.destroy;ur.prototype._undestroy=Fg.undestroy;ur.prototype._destroy=function(e,t){t(e)}});var Ou=k((Ece,N_)=>{"use strict";v();var gz=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};N_.exports=yo;var M_=Kg(),zg=Hg();yu()(yo,M_);for(jg=gz(zg.prototype),Kd=0;Kd<jg.length;Kd++)Vd=jg[Kd],yo.prototype[Vd]||(yo.prototype[Vd]=zg.prototype[Vd]);var jg,Vd,Kd;function yo(e){if(!(this instanceof yo))return new yo(e);M_.call(this,e),zg.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",vz)))}Object.defineProperty(yo.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(yo.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(yo.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function vz(){this._writableState.ended||A.default.nextTick(mz,this)}function mz(e){e.end()}Object.defineProperty(yo.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var L_=k((Vg,D_)=>{v();var Gd=Kt(),ua=Gd.Buffer;function C_(e,t){for(var r in e)t[r]=e[r]}ua.from&&ua.alloc&&ua.allocUnsafe&&ua.allocUnsafeSlow?D_.exports=Gd:(C_(Gd,Vg),Vg.Buffer=dc);function dc(e,t,r){return ua(e,t,r)}C_(ua,dc);dc.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ua(e,t,r)};dc.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=ua(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};dc.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ua(e)};dc.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Gd.SlowBuffer(e)}});var pc=k(U_=>{"use strict";v();var Zg=L_().Buffer,q_=Zg.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function yz(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function bz(e){var t=yz(e);if(typeof t!="string"&&(Zg.isEncoding===q_||!q_(e)))throw new Error("Unknown encoding: "+e);return t||e}U_.StringDecoder=_h;function _h(e){this.encoding=bz(e);var t;switch(this.encoding){case"utf16le":this.text=Oz,this.end=Iz,t=4;break;case"utf8":this.fillLast=Sz,t=4;break;case"base64":this.text=Az,this.end=Pz,t=3;break;default:this.write=Tz,this.end=kz;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Zg.allocUnsafe(t)}_h.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};_h.prototype.end=Ez;_h.prototype.text=xz;_h.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Gg(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function _z(e,t,r){var i=t.length-1;if(i<r)return 0;var n=Gg(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=Gg(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=Gg(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function wz(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Sz(e){var t=this.lastTotal-this.lastNeed,r=wz(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function xz(e,t){var r=_z(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function Ez(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Oz(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Iz(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Az(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Pz(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Tz(e){return e.toString(this.encoding)}function kz(e){return e&&e.length?this.write(e):""}});var Zd=k((Tce,j_)=>{"use strict";v();var F_=Eu().codes.ERR_STREAM_PREMATURE_CLOSE;function Rz(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}function Bz(){}function Mz(e){return e.setHeader&&typeof e.abort=="function"}function H_(e,t,r){if(typeof t=="function")return H_(e,null,t);t||(t={}),r=Rz(r||Bz);var i=t.readable||t.readable!==!1&&e.readable,n=t.writable||t.writable!==!1&&e.writable,o=function(){e.writable||s()},a=e._writableState&&e._writableState.finished,s=function(){n=!1,a=!0,i||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){i=!1,u=!0,n||r.call(e)},l=function(P){r.call(e,P)},m=function(){var P;if(i&&!u)return(!e._readableState||!e._readableState.ended)&&(P=new F_),r.call(e,P);if(n&&!a)return(!e._writableState||!e._writableState.ended)&&(P=new F_),r.call(e,P)},w=function(){e.req.on("finish",s)};return Mz(e)?(e.on("complete",s),e.on("abort",m),e.req?w():e.on("request",w)):n&&!e._writableState&&(e.on("end",o),e.on("close",o)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",m),function(){e.removeListener("complete",s),e.removeListener("abort",m),e.removeListener("request",w),e.req&&e.req.removeListener("finish",s),e.removeListener("end",o),e.removeListener("close",o),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",m)}}j_.exports=H_});var K_=k((Rce,z_)=>{"use strict";v();var Wd;function ns(e,t,r){return t=Nz(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nz(e){var t=Cz(e,"string");return typeof t=="symbol"?t:String(t)}function Cz(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dz=Zd(),os=Symbol("lastResolve"),Iu=Symbol("lastReject"),wh=Symbol("error"),Yd=Symbol("ended"),Au=Symbol("lastPromise"),Wg=Symbol("handlePromise"),Pu=Symbol("stream");function as(e,t){return{value:e,done:t}}function Lz(e){var t=e[os];if(t!==null){var r=e[Pu].read();r!==null&&(e[Au]=null,e[os]=null,e[Iu]=null,t(as(r,!1)))}}function qz(e){A.default.nextTick(Lz,e)}function Uz(e,t){return function(r,i){e.then(function(){if(t[Yd]){r(as(void 0,!0));return}t[Wg](r,i)},i)}}var Fz=Object.getPrototypeOf(function(){}),Hz=Object.setPrototypeOf((Wd={get stream(){return this[Pu]},next:function(){var t=this,r=this[wh];if(r!==null)return Promise.reject(r);if(this[Yd])return Promise.resolve(as(void 0,!0));if(this[Pu].destroyed)return new Promise(function(a,s){A.default.nextTick(function(){t[wh]?s(t[wh]):a(as(void 0,!0))})});var i=this[Au],n;if(i)n=new Promise(Uz(i,this));else{var o=this[Pu].read();if(o!==null)return Promise.resolve(as(o,!1));n=new Promise(this[Wg])}return this[Au]=n,n}},ns(Wd,Symbol.asyncIterator,function(){return this}),ns(Wd,"return",function(){var t=this;return new Promise(function(r,i){t[Pu].destroy(null,function(n){if(n){i(n);return}r(as(void 0,!0))})})}),Wd),Fz),jz=function(t){var r,i=Object.create(Hz,(r={},ns(r,Pu,{value:t,writable:!0}),ns(r,os,{value:null,writable:!0}),ns(r,Iu,{value:null,writable:!0}),ns(r,wh,{value:null,writable:!0}),ns(r,Yd,{value:t._readableState.endEmitted,writable:!0}),ns(r,Wg,{value:function(o,a){var s=i[Pu].read();s?(i[Au]=null,i[os]=null,i[Iu]=null,o(as(s,!1))):(i[os]=o,i[Iu]=a)},writable:!0}),r));return i[Au]=null,Dz(t,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[Iu];o!==null&&(i[Au]=null,i[os]=null,i[Iu]=null,o(n)),i[wh]=n;return}var a=i[os];a!==null&&(i[Au]=null,i[os]=null,i[Iu]=null,a(as(void 0,!0))),i[Yd]=!0}),t.on("readable",qz.bind(null,i)),i};z_.exports=jz});var G_=k((Mce,V_)=>{v();V_.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Kg=k((Dce,rw)=>{"use strict";v();rw.exports=St;var gc;St.ReadableState=$_;var Cce=tc().EventEmitter,Y_=function(t,r){return t.listeners(r).length},xh=eg(),$d=Kt().Buffer,zz=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Kz(e){return $d.from(e)}function Vz(e){return $d.isBuffer(e)||e instanceof zz}var Yg=rn(),ft;Yg&&Yg.debuglog?ft=Yg.debuglog("stream"):ft=function(){};var Gz=b_(),rv=Cg(),Zz=Dg(),Wz=Zz.getHighWaterMark,Xd=Eu().codes,Yz=Xd.ERR_INVALID_ARG_TYPE,$z=Xd.ERR_STREAM_PUSH_AFTER_EOF,Xz=Xd.ERR_METHOD_NOT_IMPLEMENTED,Jz=Xd.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,vc,$g,Xg;yu()(St,xh);var Sh=rv.errorOrDestroy,Jg=["error","close","destroy","pause","resume"];function Qz(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function $_(e,t,r){gc=gc||Ou(),e=e||{},typeof r!="boolean"&&(r=t instanceof gc),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Wz(this,e,"readableHighWaterMark",r),this.buffer=new Gz,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(vc||(vc=pc().StringDecoder),this.decoder=new vc(e.encoding),this.encoding=e.encoding)}function St(e){if(gc=gc||Ou(),!(this instanceof St))return new St(e);var t=this instanceof gc;this._readableState=new $_(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),xh.call(this)}Object.defineProperty(St.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});St.prototype.destroy=rv.destroy;St.prototype._undestroy=rv.undestroy;St.prototype._destroy=function(e,t){t(e)};St.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=$d.from(e,t),t=""),i=!0),X_(this,e,t,!1,i)};St.prototype.unshift=function(e){return X_(this,e,null,!0,!1)};function X_(e,t,r,i,n){ft("readableAddChunk",t);var o=e._readableState;if(t===null)o.reading=!1,rK(e,o);else{var a;if(n||(a=eK(o,t)),a)Sh(e,a);else if(o.objectMode||t&&t.length>0)if(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==$d.prototype&&(t=Kz(t)),i)o.endEmitted?Sh(e,new Jz):Qg(e,o,t,!0);else if(o.ended)Sh(e,new $z);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?Qg(e,o,t,!1):tv(e,o)):Qg(e,o,t,!1)}else i||(o.reading=!1,tv(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Qg(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Jd(e)),tv(e,t)}function eK(e,t){var r;return!Vz(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Yz("chunk",["string","Buffer","Uint8Array"],t)),r}St.prototype.isPaused=function(){return this._readableState.flowing===!1};St.prototype.setEncoding=function(e){vc||(vc=pc().StringDecoder);var t=new vc(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Z_=1073741824;function tK(e){return e>=Z_?e=Z_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function W_(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=tK(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}St.prototype.read=function(e){ft("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return ft("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ev(this):Jd(this),null;if(e=W_(e,t),e===0&&t.ended)return t.length===0&&ev(this),null;var i=t.needReadable;ft("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,ft("length less than watermark",i)),t.ended||t.reading?(i=!1,ft("reading or ended",i)):i&&(ft("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=W_(r,t)));var n;return e>0?n=ew(e,t):n=null,n===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ev(this)),n!==null&&this.emit("data",n),n};function rK(e,t){if(ft("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Jd(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,J_(e)))}}function Jd(e){var t=e._readableState;ft("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(ft("emitReadable",t.flowing),t.emittedReadable=!0,A.default.nextTick(J_,e))}function J_(e){var t=e._readableState;ft("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,iv(e)}function tv(e,t){t.readingMore||(t.readingMore=!0,A.default.nextTick(iK,e,t))}function iK(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(ft("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}St.prototype._read=function(e){Sh(this,new Xz("_read()"))};St.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,ft("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==A.default.stdout&&e!==A.default.stderr,o=n?s:M;i.endEmitted?A.default.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(D,L){ft("onunpipe"),D===r&&L&&L.hasUnpiped===!1&&(L.hasUnpiped=!0,l())}function s(){ft("onend"),e.end()}var u=nK(r);e.on("drain",u);var c=!1;function l(){ft("cleanup"),e.removeListener("close",E),e.removeListener("finish",P),e.removeListener("drain",u),e.removeListener("error",w),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",M),r.removeListener("data",m),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",m);function m(D){ft("ondata");var L=e.write(D);ft("dest.write",L),L===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&tw(i.pipes,e)!==-1)&&!c&&(ft("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function w(D){ft("onerror",D),M(),e.removeListener("error",w),Y_(e,"error")===0&&Sh(e,D)}Qz(e,"error",w);function E(){e.removeListener("finish",P),M()}e.once("close",E);function P(){ft("onfinish"),e.removeListener("close",E),M()}e.once("finish",P);function M(){ft("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(ft("pipe resume"),r.resume()),e};function nK(e){return function(){var r=e._readableState;ft("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Y_(e,"data")&&(r.flowing=!0,iv(e))}}St.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=tw(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};St.prototype.on=function(e,t){var r=xh.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,ft("on readable",i.length,i.reading),i.length?Jd(this):i.reading||A.default.nextTick(oK,this)),r};St.prototype.addListener=St.prototype.on;St.prototype.removeListener=function(e,t){var r=xh.prototype.removeListener.call(this,e,t);return e==="readable"&&A.default.nextTick(Q_,this),r};St.prototype.removeAllListeners=function(e){var t=xh.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&A.default.nextTick(Q_,this),t};function Q_(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function oK(e){ft("readable nexttick read 0"),e.read(0)}St.prototype.resume=function(){var e=this._readableState;return e.flowing||(ft("resume"),e.flowing=!e.readableListening,aK(this,e)),e.paused=!1,this};function aK(e,t){t.resumeScheduled||(t.resumeScheduled=!0,A.default.nextTick(sK,e,t))}function sK(e,t){ft("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),iv(e),t.flowing&&!t.reading&&e.read(0)}St.prototype.pause=function(){return ft("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ft("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function iv(e){var t=e._readableState;for(ft("flow",t.flowing);t.flowing&&e.read()!==null;);}St.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(ft("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(ft("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(s){return function(){return e[s].apply(e,arguments)}})(n));for(var o=0;o<Jg.length;o++)e.on(Jg[o],this.emit.bind(this,Jg[o]));return this._read=function(a){ft("wrapped _read",a),i&&(i=!1,e.resume())},this};typeof Symbol=="function"&&(St.prototype[Symbol.asyncIterator]=function(){return $g===void 0&&($g=K_()),$g(this)});Object.defineProperty(St.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(St.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(St.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});St._fromList=ew;Object.defineProperty(St.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ew(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ev(e){var t=e._readableState;ft("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,A.default.nextTick(uK,t,e))}function uK(e,t){if(ft("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(St.from=function(e,t){return Xg===void 0&&(Xg=G_()),Xg(St,e,t)});function tw(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var nv=k((qce,nw)=>{"use strict";v();nw.exports=fa;var Qd=Eu().codes,fK=Qd.ERR_METHOD_NOT_IMPLEMENTED,cK=Qd.ERR_MULTIPLE_CALLBACK,lK=Qd.ERR_TRANSFORM_ALREADY_TRANSFORMING,hK=Qd.ERR_TRANSFORM_WITH_LENGTH_0,e2=Ou();yu()(fa,e2);function dK(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new cK);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function fa(e){if(!(this instanceof fa))return new fa(e);e2.call(this,e),this._transformState={afterTransform:dK.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",pK)}function pK(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){iw(e,t,r)}):iw(this,null,null)}fa.prototype.push=function(e,t){return this._transformState.needTransform=!1,e2.prototype.push.call(this,e,t)};fa.prototype._transform=function(e,t,r){r(new fK("_transform()"))};fa.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};fa.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};fa.prototype._destroy=function(e,t){e2.prototype._destroy.call(this,e,function(r){t(r)})};function iw(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new hK;if(e._transformState.transforming)throw new lK;return e.push(null)}});var sw=k((Fce,aw)=>{"use strict";v();aw.exports=Eh;var ow=nv();yu()(Eh,ow);function Eh(e){if(!(this instanceof Eh))return new Eh(e);ow.call(this,e)}Eh.prototype._transform=function(e,t,r){r(null,e)}});var hw=k((jce,lw)=>{"use strict";v();var ov;function gK(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var cw=Eu().codes,vK=cw.ERR_MISSING_ARGS,mK=cw.ERR_STREAM_DESTROYED;function uw(e){if(e)throw e}function yK(e){return e.setHeader&&typeof e.abort=="function"}function bK(e,t,r,i){i=gK(i);var n=!1;e.on("close",function(){n=!0}),ov===void 0&&(ov=Zd()),ov(e,{readable:t,writable:r},function(a){if(a)return i(a);n=!0,i()});var o=!1;return function(a){if(!n&&!o){if(o=!0,yK(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();i(a||new mK("pipe"))}}}function fw(e){e()}function _K(e,t){return e.pipe(t)}function wK(e){return!e.length||typeof e[e.length-1]!="function"?uw:e.pop()}function SK(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=wK(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new vK("streams");var n,o=t.map(function(a,s){var u=s<t.length-1,c=s>0;return bK(a,u,c,function(l){n||(n=l),l&&o.forEach(fw),!u&&(o.forEach(fw),i(n))})});return t.reduce(_K)}lw.exports=SK});var t2=k((Kce,dw)=>{v();dw.exports=on;var av=tc().EventEmitter,xK=yu();xK(on,av);on.Readable=Kg();on.Writable=Hg();on.Duplex=Ou();on.Transform=nv();on.PassThrough=sw();on.finished=Zd();on.pipeline=hw();on.Stream=on;function on(){av.call(this)}on.prototype.pipe=function(e,t){var r=this;function i(l){e.writable&&e.write(l)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}e.on("drain",n),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function u(l){if(c(),av.listenerCount(this,"error")===0)throw l}r.on("error",u),e.on("error",u);function c(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}});var pw=k((Gce,sv)=>{v();typeof Object.create=="function"?sv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:sv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var mw=k((Wce,vw)=>{"use strict";v();var bo=nt().Buffer,gw=t2().Transform,EK=pw();function ss(e){gw.call(this),this._block=bo.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}EK(ss,gw);ss.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(n){i=n}r(i)};ss.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};var OK=typeof Uint8Array<"u",IK=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(bo.prototype instanceof Uint8Array||bo.TYPED_ARRAY_SUPPORT);function AK(e,t){if(e instanceof bo)return e;if(typeof e=="string")return bo.from(e,t);if(IK&&ArrayBuffer.isView(e)){if(e.byteLength===0)return bo.alloc(0);var r=bo.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}if(OK&&e instanceof Uint8Array||bo.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return bo.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}ss.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");e=AK(e,t);for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,a=e.length*8;a>0;++o)this._length[o]+=a,a=this._length[o]/4294967296|0,a>0&&(this._length[o]-=4294967296*a);return this};ss.prototype._update=function(){throw new Error("_update is not implemented")};ss.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};ss.prototype._digest=function(){throw new Error("_digest is not implemented")};vw.exports=ss});var n2=k(($ce,bw)=>{"use strict";v();var PK=Ot(),yw=mw(),TK=nt().Buffer,kK=new Array(16);function r2(){yw.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}PK(r2,yw);r2.prototype._update=function(){for(var e=kK,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,i=this._b,n=this._c,o=this._d;r=si(r,i,n,o,e[0],3614090360,7),o=si(o,r,i,n,e[1],3905402710,12),n=si(n,o,r,i,e[2],606105819,17),i=si(i,n,o,r,e[3],3250441966,22),r=si(r,i,n,o,e[4],4118548399,7),o=si(o,r,i,n,e[5],1200080426,12),n=si(n,o,r,i,e[6],2821735955,17),i=si(i,n,o,r,e[7],4249261313,22),r=si(r,i,n,o,e[8],1770035416,7),o=si(o,r,i,n,e[9],2336552879,12),n=si(n,o,r,i,e[10],4294925233,17),i=si(i,n,o,r,e[11],2304563134,22),r=si(r,i,n,o,e[12],1804603682,7),o=si(o,r,i,n,e[13],4254626195,12),n=si(n,o,r,i,e[14],2792965006,17),i=si(i,n,o,r,e[15],1236535329,22),r=ui(r,i,n,o,e[1],4129170786,5),o=ui(o,r,i,n,e[6],3225465664,9),n=ui(n,o,r,i,e[11],643717713,14),i=ui(i,n,o,r,e[0],3921069994,20),r=ui(r,i,n,o,e[5],3593408605,5),o=ui(o,r,i,n,e[10],38016083,9),n=ui(n,o,r,i,e[15],3634488961,14),i=ui(i,n,o,r,e[4],3889429448,20),r=ui(r,i,n,o,e[9],568446438,5),o=ui(o,r,i,n,e[14],3275163606,9),n=ui(n,o,r,i,e[3],4107603335,14),i=ui(i,n,o,r,e[8],1163531501,20),r=ui(r,i,n,o,e[13],2850285829,5),o=ui(o,r,i,n,e[2],4243563512,9),n=ui(n,o,r,i,e[7],1735328473,14),i=ui(i,n,o,r,e[12],2368359562,20),r=fi(r,i,n,o,e[5],4294588738,4),o=fi(o,r,i,n,e[8],2272392833,11),n=fi(n,o,r,i,e[11],1839030562,16),i=fi(i,n,o,r,e[14],4259657740,23),r=fi(r,i,n,o,e[1],2763975236,4),o=fi(o,r,i,n,e[4],1272893353,11),n=fi(n,o,r,i,e[7],4139469664,16),i=fi(i,n,o,r,e[10],3200236656,23),r=fi(r,i,n,o,e[13],681279174,4),o=fi(o,r,i,n,e[0],3936430074,11),n=fi(n,o,r,i,e[3],3572445317,16),i=fi(i,n,o,r,e[6],76029189,23),r=fi(r,i,n,o,e[9],3654602809,4),o=fi(o,r,i,n,e[12],3873151461,11),n=fi(n,o,r,i,e[15],530742520,16),i=fi(i,n,o,r,e[2],3299628645,23),r=ci(r,i,n,o,e[0],4096336452,6),o=ci(o,r,i,n,e[7],1126891415,10),n=ci(n,o,r,i,e[14],2878612391,15),i=ci(i,n,o,r,e[5],4237533241,21),r=ci(r,i,n,o,e[12],1700485571,6),o=ci(o,r,i,n,e[3],2399980690,10),n=ci(n,o,r,i,e[10],4293915773,15),i=ci(i,n,o,r,e[1],2240044497,21),r=ci(r,i,n,o,e[8],1873313359,6),o=ci(o,r,i,n,e[15],4264355552,10),n=ci(n,o,r,i,e[6],2734768916,15),i=ci(i,n,o,r,e[13],1309151649,21),r=ci(r,i,n,o,e[4],4149444226,6),o=ci(o,r,i,n,e[11],3174756917,10),n=ci(n,o,r,i,e[2],718787259,15),i=ci(i,n,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0};r2.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=TK.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function i2(e,t){return e<<t|e>>>32-t}function si(e,t,r,i,n,o,a){return i2(e+(t&r|~t&i)+n+o|0,a)+t|0}function ui(e,t,r,i,n,o,a){return i2(e+(t&i|r&~i)+n+o|0,a)+t|0}function fi(e,t,r,i,n,o,a){return i2(e+(t^r^i)+n+o|0,a)+t|0}function ci(e,t,r,i,n,o,a){return i2(e+(r^(t|~i))+n+o|0,a)+t|0}bw.exports=r2});var fv=k((Jce,uv)=>{v();typeof Object.create=="function"?uv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:uv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var ww=k((ele,_w)=>{v();var RK={}.toString;_w.exports=Array.isArray||function(e){return RK.call(e)=="[object Array]"}});var xw=k((rle,Sw)=>{"use strict";v();var BK=bu(),MK=ts(),NK=MK("TypedArray.prototype.buffer",!0),CK=Og();Sw.exports=NK||function(t){if(!CK(t))throw new BK("Not a Typed Array");return t.buffer}});var Oh=k((nle,Ow)=>{"use strict";v();var Tn=nt().Buffer,DK=ww(),LK=xw(),qK=ArrayBuffer.isView||function(t){try{return LK(t),!0}catch{return!1}},UK=typeof Uint8Array<"u",Ew=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",FK=Ew&&(Tn.prototype instanceof Uint8Array||Tn.TYPED_ARRAY_SUPPORT);Ow.exports=function(t,r){if(Tn.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Tn.from(t):t;if(typeof t=="string")return Tn.from(t,r);if(Ew&&qK(t)){if(t.byteLength===0)return Tn.alloc(0);if(FK){var i=Tn.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}var n=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=Tn.from(n);if(o.length===t.byteLength)return o}if(UK&&t instanceof Uint8Array)return Tn.from(t);var a=DK(t);if(a)for(var s=0;s<t.length;s+=1){var u=t[s];if(typeof u!="number"||u<0||u>255||~~u!==u)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||Tn.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Tn.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var Tw=k((ale,Pw)=>{"use strict";v();var HK=nt().Buffer,jK=Oh(),Aw=typeof Uint8Array<"u",zK=Aw&&typeof ArrayBuffer<"u",Iw=zK&&ArrayBuffer.isView;Pw.exports=function(e,t){if(typeof e=="string"||HK.isBuffer(e)||Aw&&e instanceof Uint8Array||Iw&&Iw(e))return jK(e,t);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')}});var Ih=k((ule,cv)=>{"use strict";v();typeof A.default>"u"||!A.default.version||A.default.version.indexOf("v0.")===0||A.default.version.indexOf("v1.")===0&&A.default.version.indexOf("v1.8.")!==0?cv.exports={nextTick:KK}:cv.exports=A.default;function KK(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,a;switch(n){case 0:case 1:return A.default.nextTick(e);case 2:return A.default.nextTick(function(){e.call(null,t)});case 3:return A.default.nextTick(function(){e.call(null,t,r)});case 4:return A.default.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),a=0;a<o.length;)o[a++]=arguments[a];return A.default.nextTick(function(){e.apply(null,o)})}}});var Rw=k((cle,kw)=>{v();var VK={}.toString;kw.exports=Array.isArray||function(e){return VK.call(e)=="[object Array]"}});var lv=k((hle,Bw)=>{v();Bw.exports=tc().EventEmitter});var a2=k((hv,Nw)=>{v();var o2=Kt(),ca=o2.Buffer;function Mw(e,t){for(var r in e)t[r]=e[r]}ca.from&&ca.alloc&&ca.allocUnsafe&&ca.allocUnsafeSlow?Nw.exports=o2:(Mw(o2,hv),hv.Buffer=mc);function mc(e,t,r){return ca(e,t,r)}Mw(ca,mc);mc.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ca(e,t,r)};mc.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=ca(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};mc.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ca(e)};mc.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return o2.SlowBuffer(e)}});var yc=k(li=>{v();function GK(e){return Array.isArray?Array.isArray(e):s2(e)==="[object Array]"}li.isArray=GK;function ZK(e){return typeof e=="boolean"}li.isBoolean=ZK;function WK(e){return e===null}li.isNull=WK;function YK(e){return e==null}li.isNullOrUndefined=YK;function $K(e){return typeof e=="number"}li.isNumber=$K;function XK(e){return typeof e=="string"}li.isString=XK;function JK(e){return typeof e=="symbol"}li.isSymbol=JK;function QK(e){return e===void 0}li.isUndefined=QK;function eV(e){return s2(e)==="[object RegExp]"}li.isRegExp=eV;function tV(e){return typeof e=="object"&&e!==null}li.isObject=tV;function rV(e){return s2(e)==="[object Date]"}li.isDate=rV;function iV(e){return s2(e)==="[object Error]"||e instanceof Error}li.isError=iV;function nV(e){return typeof e=="function"}li.isFunction=nV;function oV(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}li.isPrimitive=oV;li.isBuffer=Kt().Buffer.isBuffer;function s2(e){return Object.prototype.toString.call(e)}});var Dw=k((mle,dv)=>{"use strict";v();function aV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Cw=a2().Buffer,Ah=rn();function sV(e,t,r){e.copy(t,r)}dv.exports=(function(){function e(){aV(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return Cw.alloc(0);for(var i=Cw.allocUnsafe(r>>>0),n=this.head,o=0;n;)sV(n.data,i,o),o+=n.data.length,n=n.next;return i},e})();Ah&&Ah.inspect&&Ah.inspect.custom&&(dv.exports.prototype[Ah.inspect.custom]=function(){var e=Ah.inspect({length:this.length});return this.constructor.name+" "+e})});var pv=k((ble,Lw)=>{"use strict";v();var u2=Ih();function uV(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u2.nextTick(f2,this,e)):u2.nextTick(f2,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,u2.nextTick(f2,r,o)):u2.nextTick(f2,r,o):t&&t(o)}),this)}function fV(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function f2(e,t){e.emit("error",t)}Lw.exports={destroy:uV,undestroy:fV}});var vv=k((wle,Vw)=>{"use strict";v();var Tu=Ih();Vw.exports=yr;function Uw(e){var t=this;this.next=null,this.entry=null,this.finish=function(){AV(t,e)}}var cV=!A.default.browser&&["v0.10","v0.9."].indexOf(A.default.version.slice(0,5))>-1?setImmediate:Tu.nextTick,bc;yr.WritableState=Th;var Fw=Object.create(yc());Fw.inherits=Ot();var lV={deprecate:qg()},Hw=lv(),l2=a2().Buffer,hV=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function dV(e){return l2.from(e)}function pV(e){return l2.isBuffer(e)||e instanceof hV}var jw=pv();Fw.inherits(yr,Hw);function gV(){}function Th(e,t){bc=bc||ku(),e=e||{};var r=t instanceof bc;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){SV(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Uw(this)}Th.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Th.prototype,"buffer",{get:lV.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var c2;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(c2=Function.prototype[Symbol.hasInstance],Object.defineProperty(yr,Symbol.hasInstance,{value:function(e){return c2.call(this,e)?!0:this!==yr?!1:e&&e._writableState instanceof Th}})):c2=function(e){return e instanceof this};function yr(e){if(bc=bc||ku(),!c2.call(yr,this)&&!(this instanceof bc))return new yr(e);this._writableState=new Th(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),Hw.call(this)}yr.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function vV(e,t){var r=new Error("write after end");e.emit("error",r),Tu.nextTick(t,r)}function mV(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),Tu.nextTick(i,o),n=!1),n}yr.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&pV(e);return o&&!l2.isBuffer(e)&&(e=dV(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=gV),i.ended?vV(this,r):(o||mV(this,i,e,r))&&(i.pendingcb++,n=bV(this,i,o,e,t,r)),n};yr.prototype.cork=function(){var e=this._writableState;e.corked++};yr.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&zw(this,e))};yr.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function yV(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=l2.from(t,r)),t}Object.defineProperty(yr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function bV(e,t,r,i,n,o){if(!r){var a=yV(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else gv(e,t,!1,s,i,n,o);return u}function gv(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function _V(e,t,r,i,n){--t.pendingcb,r?(Tu.nextTick(n,i),Tu.nextTick(Ph,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),Ph(e,t))}function wV(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function SV(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(wV(r),t)_V(e,r,i,t,n);else{var o=Kw(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&zw(e,r),i?cV(qw,e,r,o,n):qw(e,r,o,n)}}function qw(e,t,r,i){r||xV(e,t),t.pendingcb--,i(),Ph(e,t)}function xV(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function zw(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,gv(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new Uw(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,m=t.objectMode?1:u.length;if(gv(e,t,!1,m,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}yr.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};yr.prototype._writev=null;yr.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||IV(this,i,r)};function Kw(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function EV(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),Ph(e,t)})}function OV(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Tu.nextTick(EV,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Ph(e,t){var r=Kw(t);return r&&(OV(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function IV(e,t,r){t.ending=!0,Ph(e,t),r&&(t.finished?Tu.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function AV(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(yr.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});yr.prototype.destroy=jw.destroy;yr.prototype._undestroy=jw.undestroy;yr.prototype._destroy=function(e,t){this.end(),t(e)}});var ku=k((xle,Yw)=>{"use strict";v();var Gw=Ih(),PV=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Yw.exports=la;var Zw=Object.create(yc());Zw.inherits=Ot();var Ww=bv(),yv=vv();Zw.inherits(la,Ww);for(mv=PV(yv.prototype),h2=0;h2<mv.length;h2++)d2=mv[h2],la.prototype[d2]||(la.prototype[d2]=yv.prototype[d2]);var mv,d2,h2;function la(e){if(!(this instanceof la))return new la(e);Ww.call(this,e),yv.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",TV)}Object.defineProperty(la.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function TV(){this.allowHalfOpen||this._writableState.ended||Gw.nextTick(kV,this)}function kV(e){e.end()}Object.defineProperty(la.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});la.prototype._destroy=function(e,t){this.push(null),this.end(),Gw.nextTick(t,e)}});var bv=k((Ile,sS)=>{"use strict";v();var wc=Ih();sS.exports=Wt;var RV=Rw(),kh;Wt.ReadableState=rS;var Ole=tc().EventEmitter,Qw=function(e,t){return e.listeners(t).length},Ev=lv(),Rh=a2().Buffer,BV=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function MV(e){return Rh.from(e)}function NV(e){return Rh.isBuffer(e)||e instanceof BV}var eS=Object.create(yc());eS.inherits=Ot();var _v=rn(),Tt=void 0;_v&&_v.debuglog?Tt=_v.debuglog("stream"):Tt=function(){};var CV=Dw(),tS=pv(),_c;eS.inherits(Wt,Ev);var wv=["error","close","destroy","pause","resume"];function DV(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):RV(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function rS(e,t){kh=kh||ku(),e=e||{};var r=t instanceof kh;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new CV,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(_c||(_c=pc().StringDecoder),this.decoder=new _c(e.encoding),this.encoding=e.encoding)}function Wt(e){if(kh=kh||ku(),!(this instanceof Wt))return new Wt(e);this._readableState=new rS(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Ev.call(this)}Object.defineProperty(Wt.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Wt.prototype.destroy=tS.destroy;Wt.prototype._undestroy=tS.undestroy;Wt.prototype._destroy=function(e,t){this.push(null),t(e)};Wt.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Rh.from(e,t),t=""),i=!0),iS(this,e,t,!1,i)};Wt.prototype.unshift=function(e){return iS(this,e,null,!0,!1)};function iS(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,FV(e,o);else{var a;n||(a=LV(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Rh.prototype&&(t=MV(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Sv(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?Sv(e,o,t,!1):nS(e,o)):Sv(e,o,t,!1))):i||(o.reading=!1)}return qV(o)}function Sv(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&p2(e)),nS(e,t)}function LV(e,t){var r;return!NV(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function qV(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}Wt.prototype.isPaused=function(){return this._readableState.flowing===!1};Wt.prototype.setEncoding=function(e){return _c||(_c=pc().StringDecoder),this._readableState.decoder=new _c(e),this._readableState.encoding=e,this};var $w=8388608;function UV(e){return e>=$w?e=$w:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Xw(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=UV(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Wt.prototype.read=function(e){Tt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Tt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?xv(this):p2(this),null;if(e=Xw(e,t),e===0&&t.ended)return t.length===0&&xv(this),null;var i=t.needReadable;Tt("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,Tt("length less than watermark",i)),t.ended||t.reading?(i=!1,Tt("reading or ended",i)):i&&(Tt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Xw(r,t)));var n;return e>0?n=oS(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&xv(this)),n!==null&&this.emit("data",n),n};function FV(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,p2(e)}}function p2(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Tt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?wc.nextTick(Jw,e):Jw(e))}function Jw(e){Tt("emit readable"),e.emit("readable"),Ov(e)}function nS(e,t){t.readingMore||(t.readingMore=!0,wc.nextTick(HV,e,t))}function HV(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Tt("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}Wt.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};Wt.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,Tt("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==A.default.stdout&&e!==A.default.stderr,o=n?s:D;i.endEmitted?wc.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(L,U){Tt("onunpipe"),L===r&&U&&U.hasUnpiped===!1&&(U.hasUnpiped=!0,l())}function s(){Tt("onend"),e.end()}var u=jV(r);e.on("drain",u);var c=!1;function l(){Tt("cleanup"),e.removeListener("close",P),e.removeListener("finish",M),e.removeListener("drain",u),e.removeListener("error",E),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",D),r.removeListener("data",w),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}var m=!1;r.on("data",w);function w(L){Tt("ondata"),m=!1;var U=e.write(L);U===!1&&!m&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&aS(i.pipes,e)!==-1)&&!c&&(Tt("false write response, pause",i.awaitDrain),i.awaitDrain++,m=!0),r.pause())}function E(L){Tt("onerror",L),D(),e.removeListener("error",E),Qw(e,"error")===0&&e.emit("error",L)}DV(e,"error",E);function P(){e.removeListener("finish",M),D()}e.once("close",P);function M(){Tt("onfinish"),e.removeListener("close",P),D()}e.once("finish",M);function D(){Tt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(Tt("pipe resume"),r.resume()),e};function jV(e){return function(){var t=e._readableState;Tt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Qw(e,"data")&&(t.flowing=!0,Ov(e))}}Wt.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=aS(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Wt.prototype.on=function(e,t){var r=Ev.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&p2(this):wc.nextTick(zV,this))}return r};Wt.prototype.addListener=Wt.prototype.on;function zV(e){Tt("readable nexttick read 0"),e.read(0)}Wt.prototype.resume=function(){var e=this._readableState;return e.flowing||(Tt("resume"),e.flowing=!0,KV(this,e)),this};function KV(e,t){t.resumeScheduled||(t.resumeScheduled=!0,wc.nextTick(VV,e,t))}function VV(e,t){t.reading||(Tt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Ov(e),t.flowing&&!t.reading&&e.read(0)}Wt.prototype.pause=function(){return Tt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Tt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ov(e){var t=e._readableState;for(Tt("flow",t.flowing);t.flowing&&e.read()!==null;);}Wt.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(Tt("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(Tt("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(a){return function(){return e[a].apply(e,arguments)}})(n));for(var o=0;o<wv.length;o++)e.on(wv[o],this.emit.bind(this,wv[o]));return this._read=function(a){Tt("wrapped _read",a),i&&(i=!1,e.resume())},this};Object.defineProperty(Wt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Wt._fromList=oS;function oS(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=GV(e,t.buffer,t.decoder),r}function GV(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?ZV(e,t):WV(e,t),i}function ZV(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?n+=o:n+=o.slice(0,e),e-=a,e===0){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function WV(e,t){var r=Rh.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(a));break}++n}return t.length-=n,r}function xv(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,wc.nextTick(YV,t,e))}function YV(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function aS(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var Iv=k((Ple,cS)=>{"use strict";v();cS.exports=ha;var g2=ku(),fS=Object.create(yc());fS.inherits=Ot();fS.inherits(ha,g2);function $V(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function ha(e){if(!(this instanceof ha))return new ha(e);g2.call(this,e),this._transformState={afterTransform:$V.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",XV)}function XV(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){uS(e,t,r)}):uS(this,null,null)}ha.prototype.push=function(e,t){return this._transformState.needTransform=!1,g2.prototype.push.call(this,e,t)};ha.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};ha.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};ha.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ha.prototype._destroy=function(e,t){var r=this;g2.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function uS(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var pS=k((kle,dS)=>{"use strict";v();dS.exports=Bh;var lS=Iv(),hS=Object.create(yc());hS.inherits=Ot();hS.inherits(Bh,lS);function Bh(e){if(!(this instanceof Bh))return new Bh(e);lS.call(this,e)}Bh.prototype._transform=function(e,t,r){r(null,e)}});var vS=k((_o,gS)=>{v();_o=gS.exports=bv();_o.Stream=_o;_o.Readable=_o;_o.Writable=vv();_o.Duplex=ku();_o.Transform=Iv();_o.PassThrough=pS()});var bS=k((Mle,yS)=>{"use strict";v();var JV=nt().Buffer,QV=Tw(),mS=vS().Transform,eG=fv();function us(e){mS.call(this),this._block=JV.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}eG(us,mS);us.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(n){i=n}r(i)};us.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};us.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");for(var r=QV(e,t),i=this._block,n=0;this._blockOffset+r.length-n>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)i[o]=r[n],o+=1,n+=1;this._update(),this._blockOffset=0}for(;n<r.length;)i[this._blockOffset]=r[n],this._blockOffset+=1,n+=1;for(var a=0,s=r.length*8;s>0;++a)this._length[a]+=s,s=this._length[a]/4294967296|0,s>0&&(this._length[a]-=4294967296*s);return this};us.prototype._update=function(){throw new Error("_update is not implemented")};us.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};us.prototype._digest=function(){throw new Error("_digest is not implemented")};yS.exports=us});var m2=k((Cle,IS)=>{"use strict";v();var Av=Kt().Buffer,tG=fv(),OS=bS(),rG=new Array(16),Mh=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Nh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ch=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Dh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Lh=[0,1518500249,1859775393,2400959708,2840853838],qh=[1352829926,1548603684,1836072691,2053994217,0];function Ru(e,t){return e<<t|e>>>32-t}function _S(e,t,r,i,n,o,a,s){return Ru(e+(t^r^i)+o+a|0,s)+n|0}function wS(e,t,r,i,n,o,a,s){return Ru(e+(t&r|~t&i)+o+a|0,s)+n|0}function SS(e,t,r,i,n,o,a,s){return Ru(e+((t|~r)^i)+o+a|0,s)+n|0}function xS(e,t,r,i,n,o,a,s){return Ru(e+(t&i|r&~i)+o+a|0,s)+n|0}function ES(e,t,r,i,n,o,a,s){return Ru(e+(t^(r|~i))+o+a|0,s)+n|0}function v2(){OS.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}tG(v2,OS);v2.prototype._update=function(){for(var e=rG,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=this._a|0,u=this._b|0,c=this._c|0,l=this._d|0,m=this._e|0,w=0;w<80;w+=1){var E,P;w<16?(E=_S(r,i,n,o,a,e[Mh[w]],Lh[0],Ch[w]),P=ES(s,u,c,l,m,e[Nh[w]],qh[0],Dh[w])):w<32?(E=wS(r,i,n,o,a,e[Mh[w]],Lh[1],Ch[w]),P=xS(s,u,c,l,m,e[Nh[w]],qh[1],Dh[w])):w<48?(E=SS(r,i,n,o,a,e[Mh[w]],Lh[2],Ch[w]),P=SS(s,u,c,l,m,e[Nh[w]],qh[2],Dh[w])):w<64?(E=xS(r,i,n,o,a,e[Mh[w]],Lh[3],Ch[w]),P=wS(s,u,c,l,m,e[Nh[w]],qh[3],Dh[w])):(E=ES(r,i,n,o,a,e[Mh[w]],Lh[4],Ch[w]),P=_S(s,u,c,l,m,e[Nh[w]],qh[4],Dh[w])),r=a,a=o,o=Ru(n,10),n=i,i=E,s=m,m=l,l=Ru(c,10),c=u,u=P}var M=this._b+n+l|0;this._b=this._c+o+m|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=M};v2.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Av.alloc?Av.alloc(20):new Av(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};IS.exports=v2});var Bu=k((Lle,Pv)=>{v();typeof Object.create=="function"?Pv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Pv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var Mu=k((Ule,AS)=>{"use strict";v();var iG=nt().Buffer,nG=Oh();function y2(e,t){this._block=iG.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}y2.prototype.update=function(e,t){e=nG(e,t||"utf8");for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,a=0;a<n;){for(var s=o%i,u=Math.min(n-a,i-s),c=0;c<u;c++)r[s+c]=e[a+c];o+=u,a+=u,o%i===0&&this._update(r)}return this._len+=n,this};y2.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o};y2.prototype._update=function(){throw new Error("_update must be implemented by subclass")};AS.exports=y2});var kS=k((Hle,TS)=>{"use strict";v();var oG=Bu(),PS=Mu(),aG=nt().Buffer,sG=[1518500249,1859775393,-1894007588,-899497514],uG=new Array(80);function Uh(){this.init(),this._w=uG,PS.call(this,64,56)}oG(Uh,PS);Uh.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function fG(e){return e<<5|e>>>27}function cG(e){return e<<30|e>>>2}function lG(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Uh.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var u=0;u<80;++u){var c=~~(u/20),l=fG(r)+lG(c,i,n,o)+a+t[u]+sG[c]|0;a=o,o=n,n=cG(i),i=r,r=l}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};Uh.prototype._hash=function(){var e=aG.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};TS.exports=Uh});var MS=k((zle,BS)=>{"use strict";v();var hG=Bu(),RS=Mu(),dG=nt().Buffer,pG=[1518500249,1859775393,-1894007588,-899497514],gG=new Array(80);function Fh(){this.init(),this._w=gG,RS.call(this,64,56)}hG(Fh,RS);Fh.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vG(e){return e<<1|e>>>31}function mG(e){return e<<5|e>>>27}function yG(e){return e<<30|e>>>2}function bG(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Fh.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=vG(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var u=0;u<80;++u){var c=~~(u/20),l=mG(r)+bG(c,i,n,o)+a+t[u]+pG[c]|0;a=o,o=n,n=yG(i),i=r,r=l}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};Fh.prototype._hash=function(){var e=dG.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};BS.exports=Fh});var Tv=k((Vle,CS)=>{"use strict";v();var _G=Bu(),NS=Mu(),wG=nt().Buffer,SG=[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],xG=new Array(64);function Hh(){this.init(),this._w=xG,NS.call(this,64,56)}_G(Hh,NS);Hh.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function EG(e,t,r){return r^e&(t^r)}function OG(e,t,r){return e&t|r&(e|t)}function IG(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function AG(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function PG(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function TG(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Hh.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=this._f|0,u=this._g|0,c=this._h|0,l=0;l<16;++l)t[l]=e.readInt32BE(l*4);for(;l<64;++l)t[l]=TG(t[l-2])+t[l-7]+PG(t[l-15])+t[l-16]|0;for(var m=0;m<64;++m){var w=c+AG(a)+EG(a,s,u)+SG[m]+t[m]|0,E=IG(r)+OG(r,i,n)|0;c=u,u=s,s=a,a=o+w|0,o=n,n=i,i=r,r=w+E|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0};Hh.prototype._hash=function(){var e=wG.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};CS.exports=Hh});var LS=k((Zle,DS)=>{"use strict";v();var kG=Bu(),RG=Tv(),BG=Mu(),MG=nt().Buffer,NG=new Array(64);function b2(){this.init(),this._w=NG,BG.call(this,64,56)}kG(b2,RG);b2.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};b2.prototype._hash=function(){var e=MG.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};DS.exports=b2});var kv=k((Yle,KS)=>{"use strict";v();var CG=Bu(),zS=Mu(),DG=nt().Buffer,qS=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],LG=new Array(160);function jh(){this.init(),this._w=LG,zS.call(this,128,112)}CG(jh,zS);jh.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function US(e,t,r){return r^e&(t^r)}function FS(e,t,r){return e&t|r&(e|t)}function HS(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function jS(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function qG(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function UG(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function FG(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function HG(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function zr(e,t){return e>>>0<t>>>0?1:0}jh.prototype._update=function(e){for(var t=this._w,r=this._ah|0,i=this._bh|0,n=this._ch|0,o=this._dh|0,a=this._eh|0,s=this._fh|0,u=this._gh|0,c=this._hh|0,l=this._al|0,m=this._bl|0,w=this._cl|0,E=this._dl|0,P=this._el|0,M=this._fl|0,D=this._gl|0,L=this._hl|0,U=0;U<32;U+=2)t[U]=e.readInt32BE(U*4),t[U+1]=e.readInt32BE(U*4+4);for(;U<160;U+=2){var K=t[U-30],N=t[U-30+1],C=qG(K,N),F=UG(N,K);K=t[U-4],N=t[U-4+1];var H=FG(K,N),z=HG(N,K),G=t[U-14],B=t[U-14+1],g=t[U-32],O=t[U-32+1],y=F+B|0,f=C+G+zr(y,F)|0;y=y+z|0,f=f+H+zr(y,z)|0,y=y+O|0,f=f+g+zr(y,O)|0,t[U]=f,t[U+1]=y}for(var d=0;d<160;d+=2){f=t[d],y=t[d+1];var _=FS(r,i,n),x=FS(l,m,w),b=HS(r,l),p=HS(l,r),I=jS(a,P),T=jS(P,a),S=qS[d],R=qS[d+1],Y=US(a,s,u),X=US(P,M,D),ie=L+T|0,ce=c+I+zr(ie,L)|0;ie=ie+X|0,ce=ce+Y+zr(ie,X)|0,ie=ie+R|0,ce=ce+S+zr(ie,R)|0,ie=ie+y|0,ce=ce+f+zr(ie,y)|0;var pe=p+x|0,q=b+_+zr(pe,p)|0;c=u,L=D,u=s,D=M,s=a,M=P,P=E+ie|0,a=o+ce+zr(P,E)|0,o=n,E=w,n=i,w=m,i=r,m=l,l=ie+pe|0,r=ce+q+zr(l,ie)|0}this._al=this._al+l|0,this._bl=this._bl+m|0,this._cl=this._cl+w|0,this._dl=this._dl+E|0,this._el=this._el+P|0,this._fl=this._fl+M|0,this._gl=this._gl+D|0,this._hl=this._hl+L|0,this._ah=this._ah+r+zr(this._al,l)|0,this._bh=this._bh+i+zr(this._bl,m)|0,this._ch=this._ch+n+zr(this._cl,w)|0,this._dh=this._dh+o+zr(this._dl,E)|0,this._eh=this._eh+a+zr(this._el,P)|0,this._fh=this._fh+s+zr(this._fl,M)|0,this._gh=this._gh+u+zr(this._gl,D)|0,this._hh=this._hh+c+zr(this._hl,L)|0};jh.prototype._hash=function(){var e=DG.allocUnsafe(64);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};KS.exports=jh});var GS=k((Xle,VS)=>{"use strict";v();var jG=Bu(),zG=kv(),KG=Mu(),VG=nt().Buffer,GG=new Array(160);function _2(){this.init(),this._w=GG,KG.call(this,128,112)}jG(_2,zG);_2.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};_2.prototype._hash=function(){var e=VG.allocUnsafe(48);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};VS.exports=_2});var w2=k((Qle,da)=>{"use strict";v();da.exports=function(t){var r=t.toLowerCase(),i=da.exports[r];if(!i)throw new Error(r+" is not supported (we accept pull requests)");return new i};da.exports.sha=kS();da.exports.sha1=MS();da.exports.sha224=LS();da.exports.sha256=Tv();da.exports.sha384=GS();da.exports.sha512=kv()});var ZS=k((the,Rv)=>{v();typeof Object.create=="function"?Rv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Rv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var pa=k((ihe,YS)=>{"use strict";v();var ZG=nt().Buffer,WS=t2().Transform,WG=pc().StringDecoder,YG=ZS(),$G=Oh();function kn(e){WS.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}YG(kn,WS);kn.prototype.update=function(e,t,r){var i=$G(e,t),n=this._update(i);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)};kn.prototype.setAutoPadding=function(){};kn.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};kn.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};kn.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};kn.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(n){i=n}finally{r(i)}};kn.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};kn.prototype._finalOrDigest=function(e){var t=this.__final()||ZG.alloc(0);return e&&(t=this._toString(t,e,!0)),t};kn.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new WG(t),this._encoding=t),this._encoding!==t)throw new Error("can\u2019t switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i};YS.exports=kn});var zh=k((ohe,XS)=>{"use strict";v();var XG=Ot(),JG=n2(),QG=m2(),eZ=w2(),$S=pa();function S2(e){$S.call(this,"digest"),this._hash=e}XG(S2,$S);S2.prototype._update=function(e){this._hash.update(e)};S2.prototype._final=function(){return this._hash.digest()};XS.exports=function(t){return t=t.toLowerCase(),t==="md5"?new JG:t==="rmd160"||t==="ripemd160"?new QG:new S2(eZ(t))}});var ex=k((she,QS)=>{"use strict";v();var tZ=Ot(),Nu=nt().Buffer,JS=pa(),rZ=Nu.alloc(128),Sc=64;function x2(e,t){JS.call(this,"digest"),typeof t=="string"&&(t=Nu.from(t)),this._alg=e,this._key=t,t.length>Sc?t=e(t):t.length<Sc&&(t=Nu.concat([t,rZ],Sc));for(var r=this._ipad=Nu.allocUnsafe(Sc),i=this._opad=Nu.allocUnsafe(Sc),n=0;n<Sc;n++)r[n]=t[n]^54,i[n]=t[n]^92;this._hash=[r]}tZ(x2,JS);x2.prototype._update=function(e){this._hash.push(e)};x2.prototype._final=function(){var e=this._alg(Nu.concat(this._hash));return this._alg(Nu.concat([this._opad,e]))};QS.exports=x2});var Bv=k((fhe,tx)=>{v();var iZ=n2();tx.exports=function(e){return new iZ().update(e).digest()}});var nx=k((lhe,ix)=>{"use strict";v();var nZ=Ot(),oZ=ex(),rx=pa(),Kh=nt().Buffer,aZ=Bv(),Mv=m2(),Nv=w2(),sZ=Kh.alloc(128);function Vh(e,t){rx.call(this,"digest"),typeof t=="string"&&(t=Kh.from(t));var r=e==="sha512"||e==="sha384"?128:64;if(this._alg=e,this._key=t,t.length>r){var i=e==="rmd160"?new Mv:Nv(e);t=i.update(t).digest()}else t.length<r&&(t=Kh.concat([t,sZ],r));for(var n=this._ipad=Kh.allocUnsafe(r),o=this._opad=Kh.allocUnsafe(r),a=0;a<r;a++)n[a]=t[a]^54,o[a]=t[a]^92;this._hash=e==="rmd160"?new Mv:Nv(e),this._hash.update(n)}nZ(Vh,rx);Vh.prototype._update=function(e){this._hash.update(e)};Vh.prototype._final=function(){var e=this._hash.digest(),t=this._alg==="rmd160"?new Mv:Nv(this._alg);return t.update(this._opad).update(e).digest()};ix.exports=function(t,r){return t=t.toLowerCase(),t==="rmd160"||t==="ripemd160"?new Vh("rmd160",r):t==="md5"?new oZ(aZ,r):new Vh(t,r)}});var fs=k((dhe,ox)=>{"use strict";v();ox.exports={}});var Cv=k((ghe,ax)=>{"use strict";v();var uZ=isFinite,fZ=Math.pow(2,30)-1;ax.exports=function(e,t){if(typeof e!="number")throw new TypeError("Iterations not a number");if(e<0||!uZ(e))throw new TypeError("Bad iterations");if(typeof t!="number")throw new TypeError("Key length not a number");if(t<0||t>fZ||t!==t)throw new TypeError("Bad key length")}});var Dv=k((mhe,ux)=>{"use strict";v();var E2;globalThis.process&&globalThis.process.browser?E2="utf-8":globalThis.process&&globalThis.process.version?(sx=parseInt(A.default.version.split(".")[0].slice(1),10),E2=sx>=6?"utf-8":"binary"):E2="utf-8";var sx;ux.exports=E2});var Lv=k((bhe,lx)=>{"use strict";v();var cZ=nt().Buffer,lZ=Oh(),cx=typeof Uint8Array<"u",hZ=cx&&typeof ArrayBuffer<"u",fx=hZ&&ArrayBuffer.isView;lx.exports=function(e,t,r){if(typeof e=="string"||cZ.isBuffer(e)||cx&&e instanceof Uint8Array||fx&&fx(e))return lZ(e,t);throw new TypeError(r+" must be a string, a Buffer, a Uint8Array, or a DataView")}});var qv=k((whe,gx)=>{"use strict";v();var dZ=Bv(),pZ=m2(),gZ=w2(),Cu=nt().Buffer,vZ=Cv(),hx=Dv(),dx=Lv(),mZ=Cu.alloc(128),O2={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},yZ={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function bZ(e){return new pZ().update(e).digest()}function _Z(e){function t(r){return gZ(e).update(r).digest()}return e==="rmd160"||e==="ripemd160"?bZ:e==="md5"?dZ:t}function px(e,t,r){var i=_Z(e),n=e==="sha512"||e==="sha384"?128:64;t.length>n?t=i(t):t.length<n&&(t=Cu.concat([t,mZ],n));for(var o=Cu.allocUnsafe(n+O2[e]),a=Cu.allocUnsafe(n+O2[e]),s=0;s<n;s++)o[s]=t[s]^54,a[s]=t[s]^92;var u=Cu.allocUnsafe(n+r+4);o.copy(u,0,0,n),this.ipad1=u,this.ipad2=o,this.opad=a,this.alg=e,this.blocksize=n,this.hash=i,this.size=O2[e]}px.prototype.run=function(e,t){e.copy(t,this.blocksize);var r=this.hash(t);return r.copy(this.opad,this.blocksize),this.hash(this.opad)};function wZ(e,t,r,i,n){vZ(r,i),e=dx(e,hx,"Password"),t=dx(t,hx,"Salt");var o=(n||"sha1").toLowerCase(),a=yZ[o]||o,s=O2[a];if(typeof s!="number"||!s)throw new TypeError("Digest algorithm not supported: "+n);var u=new px(a,e,t.length),c=Cu.allocUnsafe(i),l=Cu.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);for(var m=0,w=s,E=Math.ceil(i/w),P=1;P<=E;P++){l.writeUInt32BE(P,t.length);for(var M=u.run(l,u.ipad1),D=M,L=1;L<r;L++){D=u.run(D,u.ipad2);for(var U=0;U<w;U++)M[U]^=D[U]}M.copy(c,m),m+=w}return c}gx.exports=wZ});var Sx=k((xhe,wx)=>{"use strict";v();var bx=nt().Buffer,SZ=Cv(),vx=Dv(),mx=qv(),yx=Lv(),I2,Gh=globalThis.crypto&&globalThis.crypto.subtle,xZ={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},Uv=[],Du;function Fv(){return Du||(globalThis.process&&globalThis.process.nextTick?Du=globalThis.process.nextTick:globalThis.queueMicrotask?Du=globalThis.queueMicrotask:globalThis.setImmediate?Du=globalThis.setImmediate:Du=globalThis.setTimeout,Du)}function _x(e,t,r,i,n){return Gh.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(o){return Gh.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:n}},o,i<<3)}).then(function(o){return bx.from(o)})}function EZ(e){if(globalThis.process&&!globalThis.process.browser||!Gh||!Gh.importKey||!Gh.deriveBits)return Promise.resolve(!1);if(Uv[e]!==void 0)return Uv[e];I2=I2||bx.alloc(8);var t=_x(I2,I2,10,128,e).then(function(){return!0},function(){return!1});return Uv[e]=t,t}function OZ(e,t){e.then(function(r){Fv()(function(){t(null,r)})},function(r){Fv()(function(){t(r)})})}wx.exports=function(e,t,r,i,n,o){if(typeof n=="function"&&(o=n,n=void 0),SZ(r,i),e=yx(e,vx,"Password"),t=yx(t,vx,"Salt"),typeof o!="function")throw new Error("No callback provided to pbkdf2");n=n||"sha1";var a=xZ[n.toLowerCase()];if(!a||typeof globalThis.Promise!="function"){Fv()(function(){var s;try{s=mx(e,t,r,i,n)}catch(u){o(u);return}o(null,s)});return}OZ(EZ(a).then(function(s){return s?_x(e,t,r,i,a):mx(e,t,r,i,n)}),o)}});var jv=k(Hv=>{"use strict";v();Hv.pbkdf2=Sx();Hv.pbkdf2Sync=qv()});var zv=k(an=>{"use strict";v();an.readUInt32BE=function(t,r){var i=t[0+r]<<24|t[1+r]<<16|t[2+r]<<8|t[3+r];return i>>>0};an.writeUInt32BE=function(t,r,i){t[0+i]=r>>>24,t[1+i]=r>>>16&255,t[2+i]=r>>>8&255,t[3+i]=r&255};an.ip=function(t,r,i,n){for(var o=0,a=0,s=6;s>=0;s-=2){for(var u=0;u<=24;u+=8)o<<=1,o|=r>>>u+s&1;for(var u=0;u<=24;u+=8)o<<=1,o|=t>>>u+s&1}for(var s=6;s>=0;s-=2){for(var u=1;u<=25;u+=8)a<<=1,a|=r>>>u+s&1;for(var u=1;u<=25;u+=8)a<<=1,a|=t>>>u+s&1}i[n+0]=o>>>0,i[n+1]=a>>>0};an.rip=function(t,r,i,n){for(var o=0,a=0,s=0;s<4;s++)for(var u=24;u>=0;u-=8)o<<=1,o|=r>>>u+s&1,o<<=1,o|=t>>>u+s&1;for(var s=4;s<8;s++)for(var u=24;u>=0;u-=8)a<<=1,a|=r>>>u+s&1,a<<=1,a|=t>>>u+s&1;i[n+0]=o>>>0,i[n+1]=a>>>0};an.pc1=function(t,r,i,n){for(var o=0,a=0,s=7;s>=5;s--){for(var u=0;u<=24;u+=8)o<<=1,o|=r>>u+s&1;for(var u=0;u<=24;u+=8)o<<=1,o|=t>>u+s&1}for(var u=0;u<=24;u+=8)o<<=1,o|=r>>u+s&1;for(var s=1;s<=3;s++){for(var u=0;u<=24;u+=8)a<<=1,a|=r>>u+s&1;for(var u=0;u<=24;u+=8)a<<=1,a|=t>>u+s&1}for(var u=0;u<=24;u+=8)a<<=1,a|=t>>u+s&1;i[n+0]=o>>>0,i[n+1]=a>>>0};an.r28shl=function(t,r){return t<<r&268435455|t>>>28-r};var A2=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];an.pc2=function(t,r,i,n){for(var o=0,a=0,s=A2.length>>>1,u=0;u<s;u++)o<<=1,o|=t>>>A2[u]&1;for(var u=s;u<A2.length;u++)a<<=1,a|=r>>>A2[u]&1;i[n+0]=o>>>0,i[n+1]=a>>>0};an.expand=function(t,r,i){var n=0,o=0;n=(t&1)<<5|t>>>27;for(var a=23;a>=15;a-=4)n<<=6,n|=t>>>a&63;for(var a=11;a>=3;a-=4)o|=t>>>a&63,o<<=6;o|=(t&31)<<1|t>>>31,r[i+0]=n>>>0,r[i+1]=o>>>0};var xx=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];an.substitute=function(t,r){for(var i=0,n=0;n<4;n++){var o=t>>>18-n*6&63,a=xx[n*64+o];i<<=4,i|=a}for(var n=0;n<4;n++){var o=r>>>18-n*6&63,a=xx[256+n*64+o];i<<=4,i|=a}return i>>>0};var Ex=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];an.permute=function(t){for(var r=0,i=0;i<Ex.length;i++)r<<=1,r|=t>>>Ex[i]&1;return r>>>0};an.padSplit=function(t,r,i){for(var n=t.toString(2);n.length<r;)n="0"+n;for(var o=[],a=0;a<r;a+=i)o.push(n.slice(a,a+i));return o.join(" ")}});var Rn=k((The,Ix)=>{v();Ix.exports=Ox;function Ox(e,t){if(!e)throw new Error(t||"Assertion failed")}Ox.equal=function(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)}});var P2=k((Rhe,Ax)=>{"use strict";v();var IZ=Rn();function sn(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=e.padding!==!1}Ax.exports=sn;sn.prototype._init=function(){};sn.prototype.update=function(t){return t.length===0?[]:this.type==="decrypt"?this._updateDecrypt(t):this._updateEncrypt(t)};sn.prototype._buffer=function(t,r){for(var i=Math.min(this.buffer.length-this.bufferOff,t.length-r),n=0;n<i;n++)this.buffer[this.bufferOff+n]=t[r+n];return this.bufferOff+=i,i};sn.prototype._flushBuffer=function(t,r){return this._update(this.buffer,0,t,r),this.bufferOff=0,this.blockSize};sn.prototype._updateEncrypt=function(t){var r=0,i=0,n=(this.bufferOff+t.length)/this.blockSize|0,o=new Array(n*this.blockSize);this.bufferOff!==0&&(r+=this._buffer(t,r),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(o,i)));for(var a=t.length-(t.length-r)%this.blockSize;r<a;r+=this.blockSize)this._update(t,r,o,i),i+=this.blockSize;for(;r<t.length;r++,this.bufferOff++)this.buffer[this.bufferOff]=t[r];return o};sn.prototype._updateDecrypt=function(t){for(var r=0,i=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,o=new Array(n*this.blockSize);n>0;n--)r+=this._buffer(t,r),i+=this._flushBuffer(o,i);return r+=this._buffer(t,r),o};sn.prototype.final=function(t){var r;t&&(r=this.update(t));var i;return this.type==="encrypt"?i=this._finalEncrypt():i=this._finalDecrypt(),r?r.concat(i):i};sn.prototype._pad=function(t,r){if(r===0)return!1;for(;r<t.length;)t[r++]=0;return!0};sn.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t};sn.prototype._unpad=function(t){return t};sn.prototype._finalDecrypt=function(){IZ.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}});var Kv=k((Mhe,kx)=>{"use strict";v();var Px=Rn(),AZ=Ot(),Rr=zv(),Tx=P2();function PZ(){this.tmp=new Array(2),this.keys=null}function wo(e){Tx.call(this,e);var t=new PZ;this._desState=t,this.deriveKeys(t,e.key)}AZ(wo,Tx);kx.exports=wo;wo.create=function(t){return new wo(t)};var TZ=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];wo.prototype.deriveKeys=function(t,r){t.keys=new Array(32),Px.equal(r.length,this.blockSize,"Invalid key length");var i=Rr.readUInt32BE(r,0),n=Rr.readUInt32BE(r,4);Rr.pc1(i,n,t.tmp,0),i=t.tmp[0],n=t.tmp[1];for(var o=0;o<t.keys.length;o+=2){var a=TZ[o>>>1];i=Rr.r28shl(i,a),n=Rr.r28shl(n,a),Rr.pc2(i,n,t.keys,o)}};wo.prototype._update=function(t,r,i,n){var o=this._desState,a=Rr.readUInt32BE(t,r),s=Rr.readUInt32BE(t,r+4);Rr.ip(a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],this.type==="encrypt"?this._encrypt(o,a,s,o.tmp,0):this._decrypt(o,a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],Rr.writeUInt32BE(i,a,n),Rr.writeUInt32BE(i,s,n+4)};wo.prototype._pad=function(t,r){if(this.padding===!1)return!1;for(var i=t.length-r,n=r;n<t.length;n++)t[n]=i;return!0};wo.prototype._unpad=function(t){if(this.padding===!1)return t;for(var r=t[t.length-1],i=t.length-r;i<t.length;i++)Px.equal(t[i],r);return t.slice(0,t.length-r)};wo.prototype._encrypt=function(t,r,i,n,o){for(var a=r,s=i,u=0;u<t.keys.length;u+=2){var c=t.keys[u],l=t.keys[u+1];Rr.expand(s,t.tmp,0),c^=t.tmp[0],l^=t.tmp[1];var m=Rr.substitute(c,l),w=Rr.permute(m),E=s;s=(a^w)>>>0,a=E}Rr.rip(s,a,n,o)};wo.prototype._decrypt=function(t,r,i,n,o){for(var a=i,s=r,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],l=t.keys[u+1];Rr.expand(a,t.tmp,0),c^=t.tmp[0],l^=t.tmp[1];var m=Rr.substitute(c,l),w=Rr.permute(m),E=a;a=(s^w)>>>0,s=E}Rr.rip(a,s,n,o)}});var Bx=k(Rx=>{"use strict";v();var kZ=Rn(),RZ=Ot(),T2={};function BZ(e){kZ.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}function MZ(e){function t(o){e.call(this,o),this._cbcInit()}RZ(t,e);for(var r=Object.keys(T2),i=0;i<r.length;i++){var n=r[i];t.prototype[n]=T2[n]}return t.create=function(a){return new t(a)},t}Rx.instantiate=MZ;T2._cbcInit=function(){var t=new BZ(this.options.iv);this._cbcState=t};T2._update=function(t,r,i,n){var o=this._cbcState,a=this.constructor.super_.prototype,s=o.iv;if(this.type==="encrypt"){for(var u=0;u<this.blockSize;u++)s[u]^=t[r+u];a._update.call(this,s,0,i,n);for(var u=0;u<this.blockSize;u++)s[u]=i[n+u]}else{a._update.call(this,t,r,i,n);for(var u=0;u<this.blockSize;u++)i[n+u]^=s[u];for(var u=0;u<this.blockSize;u++)s[u]=t[r+u]}}});var Cx=k((Lhe,Nx)=>{"use strict";v();var NZ=Rn(),CZ=Ot(),Mx=P2(),cs=Kv();function DZ(e,t){NZ.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);e==="encrypt"?this.ciphers=[cs.create({type:"encrypt",key:r}),cs.create({type:"decrypt",key:i}),cs.create({type:"encrypt",key:n})]:this.ciphers=[cs.create({type:"decrypt",key:n}),cs.create({type:"encrypt",key:i}),cs.create({type:"decrypt",key:r})]}function Lu(e){Mx.call(this,e);var t=new DZ(this.type,this.options.key);this._edeState=t}CZ(Lu,Mx);Nx.exports=Lu;Lu.create=function(t){return new Lu(t)};Lu.prototype._update=function(t,r,i,n){var o=this._edeState;o.ciphers[0]._update(t,r,i,n),o.ciphers[1]._update(i,n,i,n),o.ciphers[2]._update(i,n,i,n)};Lu.prototype._pad=cs.prototype._pad;Lu.prototype._unpad=cs.prototype._unpad});var Dx=k(xc=>{"use strict";v();xc.utils=zv();xc.Cipher=P2();xc.DES=Kv();xc.CBC=Bx();xc.EDE=Cx()});var Ux=k((Hhe,qx)=>{v();var Lx=pa(),ga=Dx(),LZ=Ot(),qu=nt().Buffer,Zh={"des-ede3-cbc":ga.CBC.instantiate(ga.EDE),"des-ede3":ga.EDE,"des-ede-cbc":ga.CBC.instantiate(ga.EDE),"des-ede":ga.EDE,"des-cbc":ga.CBC.instantiate(ga.DES),"des-ecb":ga.DES};Zh.des=Zh["des-cbc"];Zh.des3=Zh["des-ede3-cbc"];qx.exports=k2;LZ(k2,Lx);function k2(e){Lx.call(this);var t=e.mode.toLowerCase(),r=Zh[t],i;e.decrypt?i="decrypt":i="encrypt";var n=e.key;qu.isBuffer(n)||(n=qu.from(n)),(t==="des-ede"||t==="des-ede-cbc")&&(n=qu.concat([n,n.slice(0,8)]));var o=e.iv;qu.isBuffer(o)||(o=qu.from(o)),this._des=r.create({key:n,iv:o,type:i})}k2.prototype._update=function(e){return qu.from(this._des.update(e))};k2.prototype._final=function(){return qu.from(this._des.final())}});var Fx=k(Vv=>{v();Vv.encrypt=function(e,t){return e._cipher.encryptBlock(t)};Vv.decrypt=function(e,t){return e._cipher.decryptBlock(t)}});var Ec=k((Vhe,Hx)=>{v();Hx.exports=function(t,r){for(var i=Math.min(t.length,r.length),n=new h.Buffer(i),o=0;o<i;++o)n[o]=t[o]^r[o];return n}});var zx=k(Gv=>{v();var jx=Ec();Gv.encrypt=function(e,t){var r=jx(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev};Gv.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return jx(i,r)}});var Gx=k(Vx=>{v();var Wh=nt().Buffer,qZ=Ec();function Kx(e,t,r){var i=t.length,n=qZ(t,e._cache);return e._cache=e._cache.slice(i),e._prev=Wh.concat([e._prev,r?t:n]),n}Vx.encrypt=function(e,t,r){for(var i=Wh.allocUnsafe(0),n;t.length;)if(e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=Wh.allocUnsafe(0)),e._cache.length<=t.length)n=e._cache.length,i=Wh.concat([i,Kx(e,t.slice(0,n),r)]),t=t.slice(n);else{i=Wh.concat([i,Kx(e,t,r)]);break}return i}});var Wx=k(Zx=>{v();var Zv=nt().Buffer;function UZ(e,t,r){var i=e._cipher.encryptBlock(e._prev),n=i[0]^t;return e._prev=Zv.concat([e._prev.slice(1),Zv.from([r?t:n])]),n}Zx.encrypt=function(e,t,r){for(var i=t.length,n=Zv.allocUnsafe(i),o=-1;++o<i;)n[o]=UZ(e,t[o],r);return n}});var $x=k(Yx=>{v();var R2=nt().Buffer;function FZ(e,t,r){for(var i,n=-1,o=8,a=0,s,u;++n<o;)i=e._cipher.encryptBlock(e._prev),s=t&1<<7-n?128:0,u=i[0]^s,a+=(u&128)>>n%8,e._prev=HZ(e._prev,r?s:u);return a}function HZ(e,t){var r=e.length,i=-1,n=R2.allocUnsafe(e.length);for(e=R2.concat([e,R2.from([t])]);++i<r;)n[i]=e[i]<<1|e[i+1]>>7;return n}Yx.encrypt=function(e,t,r){for(var i=t.length,n=R2.allocUnsafe(i),o=-1;++o<i;)n[o]=FZ(e,t[o],r);return n}});var Jx=k(Xx=>{v();var jZ=Ec();function zZ(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}Xx.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=h.Buffer.concat([e._cache,zZ(e)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),jZ(t,r)}});var Wv=k((i0e,Qx)=>{v();function KZ(e){for(var t=e.length,r;t--;)if(r=e.readUInt8(t),r===255)e.writeUInt8(0,t);else{r++,e.writeUInt8(r,t);break}}Qx.exports=KZ});var $v=k(tE=>{v();var VZ=Ec(),eE=nt().Buffer,GZ=Wv();function ZZ(e){var t=e._cipher.encryptBlockRaw(e._prev);return GZ(e._prev),t}var Yv=16;tE.encrypt=function(e,t){var r=Math.ceil(t.length/Yv),i=e._cache.length;e._cache=eE.concat([e._cache,eE.allocUnsafe(r*Yv)]);for(var n=0;n<r;n++){var o=ZZ(e),a=i+n*Yv;e._cache.writeUInt32BE(o[0],a+0),e._cache.writeUInt32BE(o[1],a+4),e._cache.writeUInt32BE(o[2],a+8),e._cache.writeUInt32BE(o[3],a+12)}var s=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),VZ(t,s)}});var Xv=k((s0e,WZ)=>{WZ.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}});var M2=k((u0e,rE)=>{v();var YZ={ECB:Fx(),CBC:zx(),CFB:Gx(),CFB8:Wx(),CFB1:$x(),OFB:Jx(),CTR:$v(),GCM:$v()},B2=Xv();for(Jv in B2)B2[Jv].module=YZ[B2[Jv].mode];var Jv;rE.exports=B2});var Yh=k((c0e,nE)=>{v();var N2=nt().Buffer;function em(e){N2.isBuffer(e)||(e=N2.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(i*4);return r}function Qv(e){for(var t=0;t<e.length;e++)e[t]=0}function iE(e,t,r,i,n){for(var o=r[0],a=r[1],s=r[2],u=r[3],c=e[0]^t[0],l=e[1]^t[1],m=e[2]^t[2],w=e[3]^t[3],E,P,M,D,L=4,U=1;U<n;U++)E=o[c>>>24]^a[l>>>16&255]^s[m>>>8&255]^u[w&255]^t[L++],P=o[l>>>24]^a[m>>>16&255]^s[w>>>8&255]^u[c&255]^t[L++],M=o[m>>>24]^a[w>>>16&255]^s[c>>>8&255]^u[l&255]^t[L++],D=o[w>>>24]^a[c>>>16&255]^s[l>>>8&255]^u[m&255]^t[L++],c=E,l=P,m=M,w=D;return E=(i[c>>>24]<<24|i[l>>>16&255]<<16|i[m>>>8&255]<<8|i[w&255])^t[L++],P=(i[l>>>24]<<24|i[m>>>16&255]<<16|i[w>>>8&255]<<8|i[c&255])^t[L++],M=(i[m>>>24]<<24|i[w>>>16&255]<<16|i[c>>>8&255]<<8|i[l&255])^t[L++],D=(i[w>>>24]<<24|i[c>>>16&255]<<16|i[l>>>8&255]<<8|i[m&255])^t[L++],E=E>>>0,P=P>>>0,M=M>>>0,D=D>>>0,[E,P,M,D]}var $Z=[0,1,2,4,8,16,32,64,128,27,54],br=(function(){for(var e=new Array(256),t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^c&255^99,r[a]=c,i[c]=a;var l=e[a],m=e[l],w=e[m],E=e[c]*257^c*16843008;n[0][a]=E<<24|E>>>8,n[1][a]=E<<16|E>>>16,n[2][a]=E<<8|E>>>24,n[3][a]=E,E=w*16843009^m*65537^l*257^a*16843008,o[0][c]=E<<24|E>>>8,o[1][c]=E<<16|E>>>16,o[2][c]=E<<8|E>>>24,o[3][c]=E,a===0?a=s=1:(a=l^e[e[e[w^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}})();function un(e){this._key=em(e),this._reset()}un.blockSize=16;un.keySize=256/8;un.prototype.blockSize=un.blockSize;un.prototype.keySize=un.keySize;un.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=(r+1)*4,n=[],o=0;o<t;o++)n[o]=e[o];for(o=t;o<i;o++){var a=n[o-1];o%t===0?(a=a<<8|a>>>24,a=br.SBOX[a>>>24]<<24|br.SBOX[a>>>16&255]<<16|br.SBOX[a>>>8&255]<<8|br.SBOX[a&255],a^=$Z[o/t|0]<<24):t>6&&o%t===4&&(a=br.SBOX[a>>>24]<<24|br.SBOX[a>>>16&255]<<16|br.SBOX[a>>>8&255]<<8|br.SBOX[a&255]),n[o]=n[o-t]^a}for(var s=[],u=0;u<i;u++){var c=i-u,l=n[c-(u%4?0:4)];u<4||c<=4?s[u]=l:s[u]=br.INV_SUB_MIX[0][br.SBOX[l>>>24]]^br.INV_SUB_MIX[1][br.SBOX[l>>>16&255]]^br.INV_SUB_MIX[2][br.SBOX[l>>>8&255]]^br.INV_SUB_MIX[3][br.SBOX[l&255]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s};un.prototype.encryptBlockRaw=function(e){return e=em(e),iE(e,this._keySchedule,br.SUB_MIX,br.SBOX,this._nRounds)};un.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=N2.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r};un.prototype.decryptBlock=function(e){e=em(e);var t=e[1];e[1]=e[3],e[3]=t;var r=iE(e,this._invKeySchedule,br.INV_SUB_MIX,br.INV_SBOX,this._nRounds),i=N2.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i};un.prototype.scrub=function(){Qv(this._keySchedule),Qv(this._invKeySchedule),Qv(this._key)};nE.exports.AES=un});var sE=k((h0e,aE)=>{v();var Oc=nt().Buffer,XZ=Oc.alloc(16,0);function JZ(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}function oE(e){var t=Oc.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function $h(e){this.h=e,this.state=Oc.alloc(16,0),this.cache=Oc.allocUnsafe(0)}$h.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()};$h.prototype._multiply=function(){for(var e=JZ(this.h),t=[0,0,0,0],r,i,n,o=-1;++o<128;){for(i=(this.state[~~(o/8)]&1<<7-o%8)!==0,i&&(t[0]^=e[0],t[1]^=e[1],t[2]^=e[2],t[3]^=e[3]),n=(e[3]&1)!==0,r=3;r>0;r--)e[r]=e[r]>>>1|(e[r-1]&1)<<31;e[0]=e[0]>>>1,n&&(e[0]=e[0]^225<<24)}this.state=oE(t)};$h.prototype.update=function(e){this.cache=Oc.concat([this.cache,e]);for(var t;this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)};$h.prototype.final=function(e,t){return this.cache.length&&this.ghash(Oc.concat([this.cache,XZ],16)),this.ghash(oE([0,e,0,t])),this.state};aE.exports=$h});var tm=k((p0e,cE)=>{v();var QZ=Yh(),Pi=nt().Buffer,uE=pa(),eW=Ot(),fE=sE(),tW=Ec(),rW=Wv();function iW(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n<i;++n)r+=e[n]^t[n];return r}function nW(e,t,r){if(t.length===12)return e._finID=Pi.concat([t,Pi.from([0,0,0,1])]),Pi.concat([t,Pi.from([0,0,0,2])]);var i=new fE(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(Pi.alloc(o,0))),i.update(Pi.alloc(8,0));var a=n*8,s=Pi.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=Pi.from(e._finID);return rW(u),u}function Uu(e,t,r,i){uE.call(this);var n=Pi.alloc(4,0);this._cipher=new QZ.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new fE(o),r=nW(this,r,o),this._prev=Pi.from(r),this._cache=Pi.allocUnsafe(0),this._secCache=Pi.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}eW(Uu,uE);Uu.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=Pi.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r};Uu.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=tW(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&iW(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()};Uu.prototype.getAuthTag=function(){if(this._decrypt||!Pi.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag};Uu.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t};Uu.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length};cE.exports=Uu});var im=k((v0e,hE)=>{v();var oW=Yh(),rm=nt().Buffer,lE=pa(),aW=Ot();function C2(e,t,r,i){lE.call(this),this._cipher=new oW.AES(t),this._prev=rm.from(r),this._cache=rm.allocUnsafe(0),this._secCache=rm.allocUnsafe(0),this._decrypt=i,this._mode=e}aW(C2,lE);C2.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)};C2.prototype._final=function(){this._cipher.scrub()};hE.exports=C2});var Xh=k((y0e,dE)=>{v();var Fu=nt().Buffer,sW=n2();function uW(e,t,r,i){if(Fu.isBuffer(e)||(e=Fu.from(e,"binary")),t&&(Fu.isBuffer(t)||(t=Fu.from(t,"binary")),t.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var n=r/8,o=Fu.alloc(n),a=Fu.alloc(i||0),s=Fu.alloc(0);n>0||i>0;){var u=new sW;u.update(s),u.update(e),t&&u.update(t),s=u.digest();var c=0;if(n>0){var l=o.length-n;c=Math.min(n,s.length),s.copy(o,l,0,c),n-=c}if(c<s.length&&i>0){var m=a.length-i,w=Math.min(i,s.length-c);s.copy(a,m,c,c+w),i-=w}}return s.fill(0),{key:o,iv:a}}dE.exports=uW});var mE=k(nm=>{v();var pE=M2(),fW=tm(),va=nt().Buffer,cW=im(),gE=pa(),lW=Yh(),hW=Xh(),dW=Ot();function Jh(e,t,r){gE.call(this),this._cache=new D2,this._cipher=new lW.AES(t),this._prev=va.from(r),this._mode=e,this._autopadding=!0}dW(Jh,gE);Jh.prototype._update=function(e){this._cache.add(e);for(var t,r,i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return va.concat(i)};var pW=va.alloc(16,16);Jh.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(pW))throw this._cipher.scrub(),new Error("data not multiple of block length")};Jh.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this};function D2(){this.cache=va.allocUnsafe(0)}D2.prototype.add=function(e){this.cache=va.concat([this.cache,e])};D2.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null};D2.prototype.flush=function(){for(var e=16-this.cache.length,t=va.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return va.concat([this.cache,t])};function vE(e,t,r){var i=pE[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if(typeof t=="string"&&(t=va.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);if(typeof r=="string"&&(r=va.from(r)),i.mode!=="GCM"&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);return i.type==="stream"?new cW(i.module,t,r):i.type==="auth"?new fW(i.module,t,r):new Jh(i.module,t,r)}function gW(e,t){var r=pE[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=hW(t,!1,r.key,r.iv);return vE(e,i.key,i.iv)}nm.createCipheriv=vE;nm.createCipher=gW});var wE=k(om=>{v();var vW=tm(),Ic=nt().Buffer,yE=M2(),mW=im(),bE=pa(),yW=Yh(),bW=Xh(),_W=Ot();function Qh(e,t,r){bE.call(this),this._cache=new L2,this._last=void 0,this._cipher=new yW.AES(t),this._prev=Ic.from(r),this._mode=e,this._autopadding=!0}_W(Qh,bE);Qh.prototype._update=function(e){this._cache.add(e);for(var t,r,i=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),i.push(r);return Ic.concat(i)};Qh.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return wW(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")};Qh.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this};function L2(){this.cache=Ic.allocUnsafe(0)}L2.prototype.add=function(e){this.cache=Ic.concat([this.cache,e])};L2.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null};L2.prototype.flush=function(){if(this.cache.length)return this.cache};function wW(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(t!==16)return e.slice(0,16-t)}function _E(e,t,r){var i=yE[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if(typeof r=="string"&&(r=Ic.from(r)),i.mode!=="GCM"&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);if(typeof t=="string"&&(t=Ic.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);return i.type==="stream"?new mW(i.module,t,r,!0):i.type==="auth"?new vW(i.module,t,r,!0):new Qh(i.module,t,r)}function SW(e,t){var r=yE[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=bW(t,!1,r.key,r.iv);return _E(e,i.key,i.iv)}om.createDecipher=SW;om.createDecipheriv=_E});var q2=k(Bn=>{v();var SE=mE(),xE=wE(),xW=Xv();function EW(){return Object.keys(xW)}Bn.createCipher=Bn.Cipher=SE.createCipher;Bn.createCipheriv=Bn.Cipheriv=SE.createCipheriv;Bn.createDecipher=Bn.Decipher=xE.createDecipher;Bn.createDecipheriv=Bn.Decipheriv=xE.createDecipheriv;Bn.listCiphers=Bn.getCiphers=EW});var EE=k(ma=>{v();ma["des-ecb"]={key:8,iv:0};ma["des-cbc"]=ma.des={key:8,iv:8};ma["des-ede3-cbc"]=ma.des3={key:24,iv:8};ma["des-ede3"]={key:24,iv:0};ma["des-ede-cbc"]={key:16,iv:8};ma["des-ede"]={key:16,iv:0}});var TE=k(Mn=>{v();var OE=Ux(),am=q2(),ls=M2(),ya=EE(),IE=Xh();function OW(e,t){e=e.toLowerCase();var r,i;if(ls[e])r=ls[e].key,i=ls[e].iv;else if(ya[e])r=ya[e].key*8,i=ya[e].iv;else throw new TypeError("invalid suite type");var n=IE(t,!1,r,i);return AE(e,n.key,n.iv)}function IW(e,t){e=e.toLowerCase();var r,i;if(ls[e])r=ls[e].key,i=ls[e].iv;else if(ya[e])r=ya[e].key*8,i=ya[e].iv;else throw new TypeError("invalid suite type");var n=IE(t,!1,r,i);return PE(e,n.key,n.iv)}function AE(e,t,r){if(e=e.toLowerCase(),ls[e])return am.createCipheriv(e,t,r);if(ya[e])return new OE({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function PE(e,t,r){if(e=e.toLowerCase(),ls[e])return am.createDecipheriv(e,t,r);if(ya[e])return new OE({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function AW(){return Object.keys(ya).concat(am.getCiphers())}Mn.createCipher=Mn.Cipher=OW;Mn.createCipheriv=Mn.Cipheriv=AE;Mn.createDecipher=Mn.Decipher=IW;Mn.createDecipheriv=Mn.Decipheriv=PE;Mn.listCiphers=Mn.getCiphers=AW});var Nn=k((kE,sm)=>{v();(function(e,t){"use strict";function r(B,g){if(!B)throw new Error(g||"Assertion failed")}function i(B,g){B.super_=g;var O=function(){};O.prototype=g.prototype,B.prototype=new O,B.prototype.constructor=B}function n(B,g,O){if(n.isBN(B))return B;this.negative=0,this.words=null,this.length=0,this.red=null,B!==null&&((g==="le"||g==="be")&&(O=g,g=10),this._init(B||0,g||10,O||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Kt().Buffer}catch{}n.isBN=function(g){return g instanceof n?!0:g!==null&&typeof g=="object"&&g.constructor.wordSize===n.wordSize&&Array.isArray(g.words)},n.max=function(g,O){return g.cmp(O)>0?g:O},n.min=function(g,O){return g.cmp(O)<0?g:O},n.prototype._init=function(g,O,y){if(typeof g=="number")return this._initNumber(g,O,y);if(typeof g=="object")return this._initArray(g,O,y);O==="hex"&&(O=16),r(O===(O|0)&&O>=2&&O<=36),g=g.toString().replace(/\s+/g,"");var f=0;g[0]==="-"&&(f++,this.negative=1),f<g.length&&(O===16?this._parseHex(g,f,y):(this._parseBase(g,O,f),y==="le"&&this._initArray(this.toArray(),O,y)))},n.prototype._initNumber=function(g,O,y){g<0&&(this.negative=1,g=-g),g<67108864?(this.words=[g&67108863],this.length=1):g<4503599627370496?(this.words=[g&67108863,g/67108864&67108863],this.length=2):(r(g<9007199254740992),this.words=[g&67108863,g/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),O,y)},n.prototype._initArray=function(g,O,y){if(r(typeof g.length=="number"),g.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(g.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var d,_,x=0;if(y==="be")for(f=g.length-1,d=0;f>=0;f-=3)_=g[f]|g[f-1]<<8|g[f-2]<<16,this.words[d]|=_<<x&67108863,this.words[d+1]=_>>>26-x&67108863,x+=24,x>=26&&(x-=26,d++);else if(y==="le")for(f=0,d=0;f<g.length;f+=3)_=g[f]|g[f+1]<<8|g[f+2]<<16,this.words[d]|=_<<x&67108863,this.words[d+1]=_>>>26-x&67108863,x+=24,x>=26&&(x-=26,d++);return this.strip()};function a(B,g){var O=B.charCodeAt(g);return O>=65&&O<=70?O-55:O>=97&&O<=102?O-87:O-48&15}function s(B,g,O){var y=a(B,O);return O-1>=g&&(y|=a(B,O-1)<<4),y}n.prototype._parseHex=function(g,O,y){this.length=Math.ceil((g.length-O)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var d=0,_=0,x;if(y==="be")for(f=g.length-1;f>=O;f-=2)x=s(g,O,f)<<d,this.words[_]|=x&67108863,d>=18?(d-=18,_+=1,this.words[_]|=x>>>26):d+=8;else{var b=g.length-O;for(f=b%2===0?O+1:O;f<g.length;f+=2)x=s(g,O,f)<<d,this.words[_]|=x&67108863,d>=18?(d-=18,_+=1,this.words[_]|=x>>>26):d+=8}this.strip()};function u(B,g,O,y){for(var f=0,d=Math.min(B.length,O),_=g;_<d;_++){var x=B.charCodeAt(_)-48;f*=y,x>=49?f+=x-49+10:x>=17?f+=x-17+10:f+=x}return f}n.prototype._parseBase=function(g,O,y){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=O)f++;f--,d=d/O|0;for(var _=g.length-y,x=_%f,b=Math.min(_,_-x)+y,p=0,I=y;I<b;I+=f)p=u(g,I,I+f,O),this.imuln(d),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(x!==0){var T=1;for(p=u(g,I,g.length,O),I=0;I<x;I++)T*=O;this.imuln(T),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},n.prototype.copy=function(g){g.words=new Array(this.length);for(var O=0;O<this.length;O++)g.words[O]=this.words[O];g.length=this.length,g.negative=this.negative,g.red=this.red},n.prototype.clone=function(){var g=new n(null);return this.copy(g),g},n.prototype._expand=function(g){for(;this.length<g;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(g,O){g=g||10,O=O|0||1;var y;if(g===16||g==="hex"){y="";for(var f=0,d=0,_=0;_<this.length;_++){var x=this.words[_],b=((x<<f|d)&16777215).toString(16);d=x>>>24-f&16777215,f+=2,f>=26&&(f-=26,_--),d!==0||_!==this.length-1?y=c[6-b.length]+b+y:y=b+y}for(d!==0&&(y=d.toString(16)+y);y.length%O!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(g===(g|0)&&g>=2&&g<=36){var p=l[g],I=m[g];y="";var T=this.clone();for(T.negative=0;!T.isZero();){var S=T.modn(I).toString(g);T=T.idivn(I),T.isZero()?y=S+y:y=c[p-S.length]+S+y}for(this.isZero()&&(y="0"+y);y.length%O!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var g=this.words[0];return this.length===2?g+=this.words[1]*67108864:this.length===3&&this.words[2]===1?g+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-g:g},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(g,O){return r(typeof o<"u"),this.toArrayLike(o,g,O)},n.prototype.toArray=function(g,O){return this.toArrayLike(Array,g,O)},n.prototype.toArrayLike=function(g,O,y){var f=this.byteLength(),d=y||Math.max(1,f);r(f<=d,"byte array longer than desired length"),r(d>0,"Requested array length <= 0"),this.strip();var _=O==="le",x=new g(d),b,p,I=this.clone();if(_){for(p=0;!I.isZero();p++)b=I.andln(255),I.iushrn(8),x[p]=b;for(;p<d;p++)x[p]=0}else{for(p=0;p<d-f;p++)x[p]=0;for(p=0;!I.isZero();p++)b=I.andln(255),I.iushrn(8),x[d-p-1]=b}return x},Math.clz32?n.prototype._countBits=function(g){return 32-Math.clz32(g)}:n.prototype._countBits=function(g){var O=g,y=0;return O>=4096&&(y+=13,O>>>=13),O>=64&&(y+=7,O>>>=7),O>=8&&(y+=4,O>>>=4),O>=2&&(y+=2,O>>>=2),y+O},n.prototype._zeroBits=function(g){if(g===0)return 26;var O=g,y=0;return(O&8191)===0&&(y+=13,O>>>=13),(O&127)===0&&(y+=7,O>>>=7),(O&15)===0&&(y+=4,O>>>=4),(O&3)===0&&(y+=2,O>>>=2),(O&1)===0&&y++,y},n.prototype.bitLength=function(){var g=this.words[this.length-1],O=this._countBits(g);return(this.length-1)*26+O};function w(B){for(var g=new Array(B.bitLength()),O=0;O<g.length;O++){var y=O/26|0,f=O%26;g[O]=(B.words[y]&1<<f)>>>f}return g}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var g=0,O=0;O<this.length;O++){var y=this._zeroBits(this.words[O]);if(g+=y,y!==26)break}return g},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(g){return this.negative!==0?this.abs().inotn(g).iaddn(1):this.clone()},n.prototype.fromTwos=function(g){return this.testn(g-1)?this.notn(g).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(g){for(;this.length<g.length;)this.words[this.length++]=0;for(var O=0;O<g.length;O++)this.words[O]=this.words[O]|g.words[O];return this.strip()},n.prototype.ior=function(g){return r((this.negative|g.negative)===0),this.iuor(g)},n.prototype.or=function(g){return this.length>g.length?this.clone().ior(g):g.clone().ior(this)},n.prototype.uor=function(g){return this.length>g.length?this.clone().iuor(g):g.clone().iuor(this)},n.prototype.iuand=function(g){var O;this.length>g.length?O=g:O=this;for(var y=0;y<O.length;y++)this.words[y]=this.words[y]&g.words[y];return this.length=O.length,this.strip()},n.prototype.iand=function(g){return r((this.negative|g.negative)===0),this.iuand(g)},n.prototype.and=function(g){return this.length>g.length?this.clone().iand(g):g.clone().iand(this)},n.prototype.uand=function(g){return this.length>g.length?this.clone().iuand(g):g.clone().iuand(this)},n.prototype.iuxor=function(g){var O,y;this.length>g.length?(O=this,y=g):(O=g,y=this);for(var f=0;f<y.length;f++)this.words[f]=O.words[f]^y.words[f];if(this!==O)for(;f<O.length;f++)this.words[f]=O.words[f];return this.length=O.length,this.strip()},n.prototype.ixor=function(g){return r((this.negative|g.negative)===0),this.iuxor(g)},n.prototype.xor=function(g){return this.length>g.length?this.clone().ixor(g):g.clone().ixor(this)},n.prototype.uxor=function(g){return this.length>g.length?this.clone().iuxor(g):g.clone().iuxor(this)},n.prototype.inotn=function(g){r(typeof g=="number"&&g>=0);var O=Math.ceil(g/26)|0,y=g%26;this._expand(O),y>0&&O--;for(var f=0;f<O;f++)this.words[f]=~this.words[f]&67108863;return y>0&&(this.words[f]=~this.words[f]&67108863>>26-y),this.strip()},n.prototype.notn=function(g){return this.clone().inotn(g)},n.prototype.setn=function(g,O){r(typeof g=="number"&&g>=0);var y=g/26|0,f=g%26;return this._expand(y+1),O?this.words[y]=this.words[y]|1<<f:this.words[y]=this.words[y]&~(1<<f),this.strip()},n.prototype.iadd=function(g){var O;if(this.negative!==0&&g.negative===0)return this.negative=0,O=this.isub(g),this.negative^=1,this._normSign();if(this.negative===0&&g.negative!==0)return g.negative=0,O=this.isub(g),g.negative=1,O._normSign();var y,f;this.length>g.length?(y=this,f=g):(y=g,f=this);for(var d=0,_=0;_<f.length;_++)O=(y.words[_]|0)+(f.words[_]|0)+d,this.words[_]=O&67108863,d=O>>>26;for(;d!==0&&_<y.length;_++)O=(y.words[_]|0)+d,this.words[_]=O&67108863,d=O>>>26;if(this.length=y.length,d!==0)this.words[this.length]=d,this.length++;else if(y!==this)for(;_<y.length;_++)this.words[_]=y.words[_];return this},n.prototype.add=function(g){var O;return g.negative!==0&&this.negative===0?(g.negative=0,O=this.sub(g),g.negative^=1,O):g.negative===0&&this.negative!==0?(this.negative=0,O=g.sub(this),this.negative=1,O):this.length>g.length?this.clone().iadd(g):g.clone().iadd(this)},n.prototype.isub=function(g){if(g.negative!==0){g.negative=0;var O=this.iadd(g);return g.negative=1,O._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(g),this.negative=1,this._normSign();var y=this.cmp(g);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,d;y>0?(f=this,d=g):(f=g,d=this);for(var _=0,x=0;x<d.length;x++)O=(f.words[x]|0)-(d.words[x]|0)+_,_=O>>26,this.words[x]=O&67108863;for(;_!==0&&x<f.length;x++)O=(f.words[x]|0)+_,_=O>>26,this.words[x]=O&67108863;if(_===0&&x<f.length&&f!==this)for(;x<f.length;x++)this.words[x]=f.words[x];return this.length=Math.max(this.length,x),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(g){return this.clone().isub(g)};function E(B,g,O){O.negative=g.negative^B.negative;var y=B.length+g.length|0;O.length=y,y=y-1|0;var f=B.words[0]|0,d=g.words[0]|0,_=f*d,x=_&67108863,b=_/67108864|0;O.words[0]=x;for(var p=1;p<y;p++){for(var I=b>>>26,T=b&67108863,S=Math.min(p,g.length-1),R=Math.max(0,p-B.length+1);R<=S;R++){var Y=p-R|0;f=B.words[Y]|0,d=g.words[R]|0,_=f*d+T,I+=_/67108864|0,T=_&67108863}O.words[p]=T|0,b=I|0}return b!==0?O.words[p]=b|0:O.length--,O.strip()}var P=function(g,O,y){var f=g.words,d=O.words,_=y.words,x=0,b,p,I,T=f[0]|0,S=T&8191,R=T>>>13,Y=f[1]|0,X=Y&8191,ie=Y>>>13,ce=f[2]|0,pe=ce&8191,q=ce>>>13,W=f[3]|0,$=W&8191,ee=W>>>13,se=f[4]|0,ue=se&8191,le=se>>>13,Ae=f[5]|0,ge=Ae&8191,ve=Ae>>>13,sr=f[6]|0,xe=sr&8191,ye=sr>>>13,Re=f[7]|0,be=Re&8191,_e=Re>>>13,Qi=f[8]|0,Be=Qi&8191,ke=Qi>>>13,$s=f[9]|0,Ce=$s&8191,Le=$s>>>13,$l=d[0]|0,qe=$l&8191,Ue=$l>>>13,Xl=d[1]|0,Fe=Xl&8191,He=Xl>>>13,Jl=d[2]|0,je=Jl&8191,ze=Jl>>>13,Ql=d[3]|0,Ke=Ql&8191,Ve=Ql>>>13,eh=d[4]|0,Ge=eh&8191,Ze=eh>>>13,th=d[5]|0,We=th&8191,Ye=th>>>13,rh=d[6]|0,$e=rh&8191,Xe=rh>>>13,ih=d[7]|0,Je=ih&8191,Qe=ih>>>13,nh=d[8]|0,et=nh&8191,tt=nh>>>13,oh=d[9]|0,rt=oh&8191,it=oh>>>13;y.negative=g.negative^O.negative,y.length=19,b=Math.imul(S,qe),p=Math.imul(S,Ue),p=p+Math.imul(R,qe)|0,I=Math.imul(R,Ue);var Wf=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Wf>>>26)|0,Wf&=67108863,b=Math.imul(X,qe),p=Math.imul(X,Ue),p=p+Math.imul(ie,qe)|0,I=Math.imul(ie,Ue),b=b+Math.imul(S,Fe)|0,p=p+Math.imul(S,He)|0,p=p+Math.imul(R,Fe)|0,I=I+Math.imul(R,He)|0;var Jt=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,b=Math.imul(pe,qe),p=Math.imul(pe,Ue),p=p+Math.imul(q,qe)|0,I=Math.imul(q,Ue),b=b+Math.imul(X,Fe)|0,p=p+Math.imul(X,He)|0,p=p+Math.imul(ie,Fe)|0,I=I+Math.imul(ie,He)|0,b=b+Math.imul(S,je)|0,p=p+Math.imul(S,ze)|0,p=p+Math.imul(R,je)|0,I=I+Math.imul(R,ze)|0;var Qt=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul($,qe),p=Math.imul($,Ue),p=p+Math.imul(ee,qe)|0,I=Math.imul(ee,Ue),b=b+Math.imul(pe,Fe)|0,p=p+Math.imul(pe,He)|0,p=p+Math.imul(q,Fe)|0,I=I+Math.imul(q,He)|0,b=b+Math.imul(X,je)|0,p=p+Math.imul(X,ze)|0,p=p+Math.imul(ie,je)|0,I=I+Math.imul(ie,ze)|0,b=b+Math.imul(S,Ke)|0,p=p+Math.imul(S,Ve)|0,p=p+Math.imul(R,Ke)|0,I=I+Math.imul(R,Ve)|0;var Xs=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,b=Math.imul(ue,qe),p=Math.imul(ue,Ue),p=p+Math.imul(le,qe)|0,I=Math.imul(le,Ue),b=b+Math.imul($,Fe)|0,p=p+Math.imul($,He)|0,p=p+Math.imul(ee,Fe)|0,I=I+Math.imul(ee,He)|0,b=b+Math.imul(pe,je)|0,p=p+Math.imul(pe,ze)|0,p=p+Math.imul(q,je)|0,I=I+Math.imul(q,ze)|0,b=b+Math.imul(X,Ke)|0,p=p+Math.imul(X,Ve)|0,p=p+Math.imul(ie,Ke)|0,I=I+Math.imul(ie,Ve)|0,b=b+Math.imul(S,Ge)|0,p=p+Math.imul(S,Ze)|0,p=p+Math.imul(R,Ge)|0,I=I+Math.imul(R,Ze)|0;var Js=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Js>>>26)|0,Js&=67108863,b=Math.imul(ge,qe),p=Math.imul(ge,Ue),p=p+Math.imul(ve,qe)|0,I=Math.imul(ve,Ue),b=b+Math.imul(ue,Fe)|0,p=p+Math.imul(ue,He)|0,p=p+Math.imul(le,Fe)|0,I=I+Math.imul(le,He)|0,b=b+Math.imul($,je)|0,p=p+Math.imul($,ze)|0,p=p+Math.imul(ee,je)|0,I=I+Math.imul(ee,ze)|0,b=b+Math.imul(pe,Ke)|0,p=p+Math.imul(pe,Ve)|0,p=p+Math.imul(q,Ke)|0,I=I+Math.imul(q,Ve)|0,b=b+Math.imul(X,Ge)|0,p=p+Math.imul(X,Ze)|0,p=p+Math.imul(ie,Ge)|0,I=I+Math.imul(ie,Ze)|0,b=b+Math.imul(S,We)|0,p=p+Math.imul(S,Ye)|0,p=p+Math.imul(R,We)|0,I=I+Math.imul(R,Ye)|0;var Qs=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Qs>>>26)|0,Qs&=67108863,b=Math.imul(xe,qe),p=Math.imul(xe,Ue),p=p+Math.imul(ye,qe)|0,I=Math.imul(ye,Ue),b=b+Math.imul(ge,Fe)|0,p=p+Math.imul(ge,He)|0,p=p+Math.imul(ve,Fe)|0,I=I+Math.imul(ve,He)|0,b=b+Math.imul(ue,je)|0,p=p+Math.imul(ue,ze)|0,p=p+Math.imul(le,je)|0,I=I+Math.imul(le,ze)|0,b=b+Math.imul($,Ke)|0,p=p+Math.imul($,Ve)|0,p=p+Math.imul(ee,Ke)|0,I=I+Math.imul(ee,Ve)|0,b=b+Math.imul(pe,Ge)|0,p=p+Math.imul(pe,Ze)|0,p=p+Math.imul(q,Ge)|0,I=I+Math.imul(q,Ze)|0,b=b+Math.imul(X,We)|0,p=p+Math.imul(X,Ye)|0,p=p+Math.imul(ie,We)|0,I=I+Math.imul(ie,Ye)|0,b=b+Math.imul(S,$e)|0,p=p+Math.imul(S,Xe)|0,p=p+Math.imul(R,$e)|0,I=I+Math.imul(R,Xe)|0;var eu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(eu>>>26)|0,eu&=67108863,b=Math.imul(be,qe),p=Math.imul(be,Ue),p=p+Math.imul(_e,qe)|0,I=Math.imul(_e,Ue),b=b+Math.imul(xe,Fe)|0,p=p+Math.imul(xe,He)|0,p=p+Math.imul(ye,Fe)|0,I=I+Math.imul(ye,He)|0,b=b+Math.imul(ge,je)|0,p=p+Math.imul(ge,ze)|0,p=p+Math.imul(ve,je)|0,I=I+Math.imul(ve,ze)|0,b=b+Math.imul(ue,Ke)|0,p=p+Math.imul(ue,Ve)|0,p=p+Math.imul(le,Ke)|0,I=I+Math.imul(le,Ve)|0,b=b+Math.imul($,Ge)|0,p=p+Math.imul($,Ze)|0,p=p+Math.imul(ee,Ge)|0,I=I+Math.imul(ee,Ze)|0,b=b+Math.imul(pe,We)|0,p=p+Math.imul(pe,Ye)|0,p=p+Math.imul(q,We)|0,I=I+Math.imul(q,Ye)|0,b=b+Math.imul(X,$e)|0,p=p+Math.imul(X,Xe)|0,p=p+Math.imul(ie,$e)|0,I=I+Math.imul(ie,Xe)|0,b=b+Math.imul(S,Je)|0,p=p+Math.imul(S,Qe)|0,p=p+Math.imul(R,Je)|0,I=I+Math.imul(R,Qe)|0;var tu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(tu>>>26)|0,tu&=67108863,b=Math.imul(Be,qe),p=Math.imul(Be,Ue),p=p+Math.imul(ke,qe)|0,I=Math.imul(ke,Ue),b=b+Math.imul(be,Fe)|0,p=p+Math.imul(be,He)|0,p=p+Math.imul(_e,Fe)|0,I=I+Math.imul(_e,He)|0,b=b+Math.imul(xe,je)|0,p=p+Math.imul(xe,ze)|0,p=p+Math.imul(ye,je)|0,I=I+Math.imul(ye,ze)|0,b=b+Math.imul(ge,Ke)|0,p=p+Math.imul(ge,Ve)|0,p=p+Math.imul(ve,Ke)|0,I=I+Math.imul(ve,Ve)|0,b=b+Math.imul(ue,Ge)|0,p=p+Math.imul(ue,Ze)|0,p=p+Math.imul(le,Ge)|0,I=I+Math.imul(le,Ze)|0,b=b+Math.imul($,We)|0,p=p+Math.imul($,Ye)|0,p=p+Math.imul(ee,We)|0,I=I+Math.imul(ee,Ye)|0,b=b+Math.imul(pe,$e)|0,p=p+Math.imul(pe,Xe)|0,p=p+Math.imul(q,$e)|0,I=I+Math.imul(q,Xe)|0,b=b+Math.imul(X,Je)|0,p=p+Math.imul(X,Qe)|0,p=p+Math.imul(ie,Je)|0,I=I+Math.imul(ie,Qe)|0,b=b+Math.imul(S,et)|0,p=p+Math.imul(S,tt)|0,p=p+Math.imul(R,et)|0,I=I+Math.imul(R,tt)|0;var ru=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(ru>>>26)|0,ru&=67108863,b=Math.imul(Ce,qe),p=Math.imul(Ce,Ue),p=p+Math.imul(Le,qe)|0,I=Math.imul(Le,Ue),b=b+Math.imul(Be,Fe)|0,p=p+Math.imul(Be,He)|0,p=p+Math.imul(ke,Fe)|0,I=I+Math.imul(ke,He)|0,b=b+Math.imul(be,je)|0,p=p+Math.imul(be,ze)|0,p=p+Math.imul(_e,je)|0,I=I+Math.imul(_e,ze)|0,b=b+Math.imul(xe,Ke)|0,p=p+Math.imul(xe,Ve)|0,p=p+Math.imul(ye,Ke)|0,I=I+Math.imul(ye,Ve)|0,b=b+Math.imul(ge,Ge)|0,p=p+Math.imul(ge,Ze)|0,p=p+Math.imul(ve,Ge)|0,I=I+Math.imul(ve,Ze)|0,b=b+Math.imul(ue,We)|0,p=p+Math.imul(ue,Ye)|0,p=p+Math.imul(le,We)|0,I=I+Math.imul(le,Ye)|0,b=b+Math.imul($,$e)|0,p=p+Math.imul($,Xe)|0,p=p+Math.imul(ee,$e)|0,I=I+Math.imul(ee,Xe)|0,b=b+Math.imul(pe,Je)|0,p=p+Math.imul(pe,Qe)|0,p=p+Math.imul(q,Je)|0,I=I+Math.imul(q,Qe)|0,b=b+Math.imul(X,et)|0,p=p+Math.imul(X,tt)|0,p=p+Math.imul(ie,et)|0,I=I+Math.imul(ie,tt)|0,b=b+Math.imul(S,rt)|0,p=p+Math.imul(S,it)|0,p=p+Math.imul(R,rt)|0,I=I+Math.imul(R,it)|0;var iu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(iu>>>26)|0,iu&=67108863,b=Math.imul(Ce,Fe),p=Math.imul(Ce,He),p=p+Math.imul(Le,Fe)|0,I=Math.imul(Le,He),b=b+Math.imul(Be,je)|0,p=p+Math.imul(Be,ze)|0,p=p+Math.imul(ke,je)|0,I=I+Math.imul(ke,ze)|0,b=b+Math.imul(be,Ke)|0,p=p+Math.imul(be,Ve)|0,p=p+Math.imul(_e,Ke)|0,I=I+Math.imul(_e,Ve)|0,b=b+Math.imul(xe,Ge)|0,p=p+Math.imul(xe,Ze)|0,p=p+Math.imul(ye,Ge)|0,I=I+Math.imul(ye,Ze)|0,b=b+Math.imul(ge,We)|0,p=p+Math.imul(ge,Ye)|0,p=p+Math.imul(ve,We)|0,I=I+Math.imul(ve,Ye)|0,b=b+Math.imul(ue,$e)|0,p=p+Math.imul(ue,Xe)|0,p=p+Math.imul(le,$e)|0,I=I+Math.imul(le,Xe)|0,b=b+Math.imul($,Je)|0,p=p+Math.imul($,Qe)|0,p=p+Math.imul(ee,Je)|0,I=I+Math.imul(ee,Qe)|0,b=b+Math.imul(pe,et)|0,p=p+Math.imul(pe,tt)|0,p=p+Math.imul(q,et)|0,I=I+Math.imul(q,tt)|0,b=b+Math.imul(X,rt)|0,p=p+Math.imul(X,it)|0,p=p+Math.imul(ie,rt)|0,I=I+Math.imul(ie,it)|0;var nu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(nu>>>26)|0,nu&=67108863,b=Math.imul(Ce,je),p=Math.imul(Ce,ze),p=p+Math.imul(Le,je)|0,I=Math.imul(Le,ze),b=b+Math.imul(Be,Ke)|0,p=p+Math.imul(Be,Ve)|0,p=p+Math.imul(ke,Ke)|0,I=I+Math.imul(ke,Ve)|0,b=b+Math.imul(be,Ge)|0,p=p+Math.imul(be,Ze)|0,p=p+Math.imul(_e,Ge)|0,I=I+Math.imul(_e,Ze)|0,b=b+Math.imul(xe,We)|0,p=p+Math.imul(xe,Ye)|0,p=p+Math.imul(ye,We)|0,I=I+Math.imul(ye,Ye)|0,b=b+Math.imul(ge,$e)|0,p=p+Math.imul(ge,Xe)|0,p=p+Math.imul(ve,$e)|0,I=I+Math.imul(ve,Xe)|0,b=b+Math.imul(ue,Je)|0,p=p+Math.imul(ue,Qe)|0,p=p+Math.imul(le,Je)|0,I=I+Math.imul(le,Qe)|0,b=b+Math.imul($,et)|0,p=p+Math.imul($,tt)|0,p=p+Math.imul(ee,et)|0,I=I+Math.imul(ee,tt)|0,b=b+Math.imul(pe,rt)|0,p=p+Math.imul(pe,it)|0,p=p+Math.imul(q,rt)|0,I=I+Math.imul(q,it)|0;var ou=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(ou>>>26)|0,ou&=67108863,b=Math.imul(Ce,Ke),p=Math.imul(Ce,Ve),p=p+Math.imul(Le,Ke)|0,I=Math.imul(Le,Ve),b=b+Math.imul(Be,Ge)|0,p=p+Math.imul(Be,Ze)|0,p=p+Math.imul(ke,Ge)|0,I=I+Math.imul(ke,Ze)|0,b=b+Math.imul(be,We)|0,p=p+Math.imul(be,Ye)|0,p=p+Math.imul(_e,We)|0,I=I+Math.imul(_e,Ye)|0,b=b+Math.imul(xe,$e)|0,p=p+Math.imul(xe,Xe)|0,p=p+Math.imul(ye,$e)|0,I=I+Math.imul(ye,Xe)|0,b=b+Math.imul(ge,Je)|0,p=p+Math.imul(ge,Qe)|0,p=p+Math.imul(ve,Je)|0,I=I+Math.imul(ve,Qe)|0,b=b+Math.imul(ue,et)|0,p=p+Math.imul(ue,tt)|0,p=p+Math.imul(le,et)|0,I=I+Math.imul(le,tt)|0,b=b+Math.imul($,rt)|0,p=p+Math.imul($,it)|0,p=p+Math.imul(ee,rt)|0,I=I+Math.imul(ee,it)|0;var au=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(au>>>26)|0,au&=67108863,b=Math.imul(Ce,Ge),p=Math.imul(Ce,Ze),p=p+Math.imul(Le,Ge)|0,I=Math.imul(Le,Ze),b=b+Math.imul(Be,We)|0,p=p+Math.imul(Be,Ye)|0,p=p+Math.imul(ke,We)|0,I=I+Math.imul(ke,Ye)|0,b=b+Math.imul(be,$e)|0,p=p+Math.imul(be,Xe)|0,p=p+Math.imul(_e,$e)|0,I=I+Math.imul(_e,Xe)|0,b=b+Math.imul(xe,Je)|0,p=p+Math.imul(xe,Qe)|0,p=p+Math.imul(ye,Je)|0,I=I+Math.imul(ye,Qe)|0,b=b+Math.imul(ge,et)|0,p=p+Math.imul(ge,tt)|0,p=p+Math.imul(ve,et)|0,I=I+Math.imul(ve,tt)|0,b=b+Math.imul(ue,rt)|0,p=p+Math.imul(ue,it)|0,p=p+Math.imul(le,rt)|0,I=I+Math.imul(le,it)|0;var su=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(su>>>26)|0,su&=67108863,b=Math.imul(Ce,We),p=Math.imul(Ce,Ye),p=p+Math.imul(Le,We)|0,I=Math.imul(Le,Ye),b=b+Math.imul(Be,$e)|0,p=p+Math.imul(Be,Xe)|0,p=p+Math.imul(ke,$e)|0,I=I+Math.imul(ke,Xe)|0,b=b+Math.imul(be,Je)|0,p=p+Math.imul(be,Qe)|0,p=p+Math.imul(_e,Je)|0,I=I+Math.imul(_e,Qe)|0,b=b+Math.imul(xe,et)|0,p=p+Math.imul(xe,tt)|0,p=p+Math.imul(ye,et)|0,I=I+Math.imul(ye,tt)|0,b=b+Math.imul(ge,rt)|0,p=p+Math.imul(ge,it)|0,p=p+Math.imul(ve,rt)|0,I=I+Math.imul(ve,it)|0;var uu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(uu>>>26)|0,uu&=67108863,b=Math.imul(Ce,$e),p=Math.imul(Ce,Xe),p=p+Math.imul(Le,$e)|0,I=Math.imul(Le,Xe),b=b+Math.imul(Be,Je)|0,p=p+Math.imul(Be,Qe)|0,p=p+Math.imul(ke,Je)|0,I=I+Math.imul(ke,Qe)|0,b=b+Math.imul(be,et)|0,p=p+Math.imul(be,tt)|0,p=p+Math.imul(_e,et)|0,I=I+Math.imul(_e,tt)|0,b=b+Math.imul(xe,rt)|0,p=p+Math.imul(xe,it)|0,p=p+Math.imul(ye,rt)|0,I=I+Math.imul(ye,it)|0;var fu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(fu>>>26)|0,fu&=67108863,b=Math.imul(Ce,Je),p=Math.imul(Ce,Qe),p=p+Math.imul(Le,Je)|0,I=Math.imul(Le,Qe),b=b+Math.imul(Be,et)|0,p=p+Math.imul(Be,tt)|0,p=p+Math.imul(ke,et)|0,I=I+Math.imul(ke,tt)|0,b=b+Math.imul(be,rt)|0,p=p+Math.imul(be,it)|0,p=p+Math.imul(_e,rt)|0,I=I+Math.imul(_e,it)|0;var cu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(cu>>>26)|0,cu&=67108863,b=Math.imul(Ce,et),p=Math.imul(Ce,tt),p=p+Math.imul(Le,et)|0,I=Math.imul(Le,tt),b=b+Math.imul(Be,rt)|0,p=p+Math.imul(Be,it)|0,p=p+Math.imul(ke,rt)|0,I=I+Math.imul(ke,it)|0;var lu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(lu>>>26)|0,lu&=67108863,b=Math.imul(Ce,rt),p=Math.imul(Ce,it),p=p+Math.imul(Le,rt)|0,I=Math.imul(Le,it);var hu=(x+b|0)+((p&8191)<<13)|0;return x=(I+(p>>>13)|0)+(hu>>>26)|0,hu&=67108863,_[0]=Wf,_[1]=Jt,_[2]=Qt,_[3]=Xs,_[4]=Js,_[5]=Qs,_[6]=eu,_[7]=tu,_[8]=ru,_[9]=iu,_[10]=nu,_[11]=ou,_[12]=au,_[13]=su,_[14]=uu,_[15]=fu,_[16]=cu,_[17]=lu,_[18]=hu,x!==0&&(_[19]=x,y.length++),y};Math.imul||(P=E);function M(B,g,O){O.negative=g.negative^B.negative,O.length=B.length+g.length;for(var y=0,f=0,d=0;d<O.length-1;d++){var _=f;f=0;for(var x=y&67108863,b=Math.min(d,g.length-1),p=Math.max(0,d-B.length+1);p<=b;p++){var I=d-p,T=B.words[I]|0,S=g.words[p]|0,R=T*S,Y=R&67108863;_=_+(R/67108864|0)|0,Y=Y+x|0,x=Y&67108863,_=_+(Y>>>26)|0,f+=_>>>26,_&=67108863}O.words[d]=x,y=_,_=f}return y!==0?O.words[d]=y:O.length--,O.strip()}function D(B,g,O){var y=new L;return y.mulp(B,g,O)}n.prototype.mulTo=function(g,O){var y,f=this.length+g.length;return this.length===10&&g.length===10?y=P(this,g,O):f<63?y=E(this,g,O):f<1024?y=M(this,g,O):y=D(this,g,O),y};function L(B,g){this.x=B,this.y=g}L.prototype.makeRBT=function(g){for(var O=new Array(g),y=n.prototype._countBits(g)-1,f=0;f<g;f++)O[f]=this.revBin(f,y,g);return O},L.prototype.revBin=function(g,O,y){if(g===0||g===y-1)return g;for(var f=0,d=0;d<O;d++)f|=(g&1)<<O-d-1,g>>=1;return f},L.prototype.permute=function(g,O,y,f,d,_){for(var x=0;x<_;x++)f[x]=O[g[x]],d[x]=y[g[x]]},L.prototype.transform=function(g,O,y,f,d,_){this.permute(_,g,O,y,f,d);for(var x=1;x<d;x<<=1)for(var b=x<<1,p=Math.cos(2*Math.PI/b),I=Math.sin(2*Math.PI/b),T=0;T<d;T+=b)for(var S=p,R=I,Y=0;Y<x;Y++){var X=y[T+Y],ie=f[T+Y],ce=y[T+Y+x],pe=f[T+Y+x],q=S*ce-R*pe;pe=S*pe+R*ce,ce=q,y[T+Y]=X+ce,f[T+Y]=ie+pe,y[T+Y+x]=X-ce,f[T+Y+x]=ie-pe,Y!==b&&(q=p*S-I*R,R=p*R+I*S,S=q)}},L.prototype.guessLen13b=function(g,O){var y=Math.max(O,g)|1,f=y&1,d=0;for(y=y/2|0;y;y=y>>>1)d++;return 1<<d+1+f},L.prototype.conjugate=function(g,O,y){if(!(y<=1))for(var f=0;f<y/2;f++){var d=g[f];g[f]=g[y-f-1],g[y-f-1]=d,d=O[f],O[f]=-O[y-f-1],O[y-f-1]=-d}},L.prototype.normalize13b=function(g,O){for(var y=0,f=0;f<O/2;f++){var d=Math.round(g[2*f+1]/O)*8192+Math.round(g[2*f]/O)+y;g[f]=d&67108863,d<67108864?y=0:y=d/67108864|0}return g},L.prototype.convert13b=function(g,O,y,f){for(var d=0,_=0;_<O;_++)d=d+(g[_]|0),y[2*_]=d&8191,d=d>>>13,y[2*_+1]=d&8191,d=d>>>13;for(_=2*O;_<f;++_)y[_]=0;r(d===0),r((d&-8192)===0)},L.prototype.stub=function(g){for(var O=new Array(g),y=0;y<g;y++)O[y]=0;return O},L.prototype.mulp=function(g,O,y){var f=2*this.guessLen13b(g.length,O.length),d=this.makeRBT(f),_=this.stub(f),x=new Array(f),b=new Array(f),p=new Array(f),I=new Array(f),T=new Array(f),S=new Array(f),R=y.words;R.length=f,this.convert13b(g.words,g.length,x,f),this.convert13b(O.words,O.length,I,f),this.transform(x,_,b,p,f,d),this.transform(I,_,T,S,f,d);for(var Y=0;Y<f;Y++){var X=b[Y]*T[Y]-p[Y]*S[Y];p[Y]=b[Y]*S[Y]+p[Y]*T[Y],b[Y]=X}return this.conjugate(b,p,f),this.transform(b,p,R,_,f,d),this.conjugate(R,_,f),this.normalize13b(R,f),y.negative=g.negative^O.negative,y.length=g.length+O.length,y.strip()},n.prototype.mul=function(g){var O=new n(null);return O.words=new Array(this.length+g.length),this.mulTo(g,O)},n.prototype.mulf=function(g){var O=new n(null);return O.words=new Array(this.length+g.length),D(this,g,O)},n.prototype.imul=function(g){return this.clone().mulTo(g,this)},n.prototype.imuln=function(g){r(typeof g=="number"),r(g<67108864);for(var O=0,y=0;y<this.length;y++){var f=(this.words[y]|0)*g,d=(f&67108863)+(O&67108863);O>>=26,O+=f/67108864|0,O+=d>>>26,this.words[y]=d&67108863}return O!==0&&(this.words[y]=O,this.length++),this.length=g===0?1:this.length,this},n.prototype.muln=function(g){return this.clone().imuln(g)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(g){var O=w(g);if(O.length===0)return new n(1);for(var y=this,f=0;f<O.length&&O[f]===0;f++,y=y.sqr());if(++f<O.length)for(var d=y.sqr();f<O.length;f++,d=d.sqr())O[f]!==0&&(y=y.mul(d));return y},n.prototype.iushln=function(g){r(typeof g=="number"&&g>=0);var O=g%26,y=(g-O)/26,f=67108863>>>26-O<<26-O,d;if(O!==0){var _=0;for(d=0;d<this.length;d++){var x=this.words[d]&f,b=(this.words[d]|0)-x<<O;this.words[d]=b|_,_=x>>>26-O}_&&(this.words[d]=_,this.length++)}if(y!==0){for(d=this.length-1;d>=0;d--)this.words[d+y]=this.words[d];for(d=0;d<y;d++)this.words[d]=0;this.length+=y}return this.strip()},n.prototype.ishln=function(g){return r(this.negative===0),this.iushln(g)},n.prototype.iushrn=function(g,O,y){r(typeof g=="number"&&g>=0);var f;O?f=(O-O%26)/26:f=0;var d=g%26,_=Math.min((g-d)/26,this.length),x=67108863^67108863>>>d<<d,b=y;if(f-=_,f=Math.max(0,f),b){for(var p=0;p<_;p++)b.words[p]=this.words[p];b.length=_}if(_!==0)if(this.length>_)for(this.length-=_,p=0;p<this.length;p++)this.words[p]=this.words[p+_];else this.words[0]=0,this.length=1;var I=0;for(p=this.length-1;p>=0&&(I!==0||p>=f);p--){var T=this.words[p]|0;this.words[p]=I<<26-d|T>>>d,I=T&x}return b&&I!==0&&(b.words[b.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(g,O,y){return r(this.negative===0),this.iushrn(g,O,y)},n.prototype.shln=function(g){return this.clone().ishln(g)},n.prototype.ushln=function(g){return this.clone().iushln(g)},n.prototype.shrn=function(g){return this.clone().ishrn(g)},n.prototype.ushrn=function(g){return this.clone().iushrn(g)},n.prototype.testn=function(g){r(typeof g=="number"&&g>=0);var O=g%26,y=(g-O)/26,f=1<<O;if(this.length<=y)return!1;var d=this.words[y];return!!(d&f)},n.prototype.imaskn=function(g){r(typeof g=="number"&&g>=0);var O=g%26,y=(g-O)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(O!==0&&y++,this.length=Math.min(y,this.length),O!==0){var f=67108863^67108863>>>O<<O;this.words[this.length-1]&=f}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(g){return this.clone().imaskn(g)},n.prototype.iaddn=function(g){return r(typeof g=="number"),r(g<67108864),g<0?this.isubn(-g):this.negative!==0?this.length===1&&(this.words[0]|0)<g?(this.words[0]=g-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(g),this.negative=1,this):this._iaddn(g)},n.prototype._iaddn=function(g){this.words[0]+=g;for(var O=0;O<this.length&&this.words[O]>=67108864;O++)this.words[O]-=67108864,O===this.length-1?this.words[O+1]=1:this.words[O+1]++;return this.length=Math.max(this.length,O+1),this},n.prototype.isubn=function(g){if(r(typeof g=="number"),r(g<67108864),g<0)return this.iaddn(-g);if(this.negative!==0)return this.negative=0,this.iaddn(g),this.negative=1,this;if(this.words[0]-=g,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var O=0;O<this.length&&this.words[O]<0;O++)this.words[O]+=67108864,this.words[O+1]-=1;return this.strip()},n.prototype.addn=function(g){return this.clone().iaddn(g)},n.prototype.subn=function(g){return this.clone().isubn(g)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(g,O,y){var f=g.length+y,d;this._expand(f);var _,x=0;for(d=0;d<g.length;d++){_=(this.words[d+y]|0)+x;var b=(g.words[d]|0)*O;_-=b&67108863,x=(_>>26)-(b/67108864|0),this.words[d+y]=_&67108863}for(;d<this.length-y;d++)_=(this.words[d+y]|0)+x,x=_>>26,this.words[d+y]=_&67108863;if(x===0)return this.strip();for(r(x===-1),x=0,d=0;d<this.length;d++)_=-(this.words[d]|0)+x,x=_>>26,this.words[d]=_&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(g,O){var y=this.length-g.length,f=this.clone(),d=g,_=d.words[d.length-1]|0,x=this._countBits(_);y=26-x,y!==0&&(d=d.ushln(y),f.iushln(y),_=d.words[d.length-1]|0);var b=f.length-d.length,p;if(O!=="mod"){p=new n(null),p.length=b+1,p.words=new Array(p.length);for(var I=0;I<p.length;I++)p.words[I]=0}var T=f.clone()._ishlnsubmul(d,1,b);T.negative===0&&(f=T,p&&(p.words[b]=1));for(var S=b-1;S>=0;S--){var R=(f.words[d.length+S]|0)*67108864+(f.words[d.length+S-1]|0);for(R=Math.min(R/_|0,67108863),f._ishlnsubmul(d,R,S);f.negative!==0;)R--,f.negative=0,f._ishlnsubmul(d,1,S),f.isZero()||(f.negative^=1);p&&(p.words[S]=R)}return p&&p.strip(),f.strip(),O!=="div"&&y!==0&&f.iushrn(y),{div:p||null,mod:f}},n.prototype.divmod=function(g,O,y){if(r(!g.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,d,_;return this.negative!==0&&g.negative===0?(_=this.neg().divmod(g,O),O!=="mod"&&(f=_.div.neg()),O!=="div"&&(d=_.mod.neg(),y&&d.negative!==0&&d.iadd(g)),{div:f,mod:d}):this.negative===0&&g.negative!==0?(_=this.divmod(g.neg(),O),O!=="mod"&&(f=_.div.neg()),{div:f,mod:_.mod}):(this.negative&g.negative)!==0?(_=this.neg().divmod(g.neg(),O),O!=="div"&&(d=_.mod.neg(),y&&d.negative!==0&&d.isub(g)),{div:_.div,mod:d}):g.length>this.length||this.cmp(g)<0?{div:new n(0),mod:this}:g.length===1?O==="div"?{div:this.divn(g.words[0]),mod:null}:O==="mod"?{div:null,mod:new n(this.modn(g.words[0]))}:{div:this.divn(g.words[0]),mod:new n(this.modn(g.words[0]))}:this._wordDiv(g,O)},n.prototype.div=function(g){return this.divmod(g,"div",!1).div},n.prototype.mod=function(g){return this.divmod(g,"mod",!1).mod},n.prototype.umod=function(g){return this.divmod(g,"mod",!0).mod},n.prototype.divRound=function(g){var O=this.divmod(g);if(O.mod.isZero())return O.div;var y=O.div.negative!==0?O.mod.isub(g):O.mod,f=g.ushrn(1),d=g.andln(1),_=y.cmp(f);return _<0||d===1&&_===0?O.div:O.div.negative!==0?O.div.isubn(1):O.div.iaddn(1)},n.prototype.modn=function(g){r(g<=67108863);for(var O=(1<<26)%g,y=0,f=this.length-1;f>=0;f--)y=(O*y+(this.words[f]|0))%g;return y},n.prototype.idivn=function(g){r(g<=67108863);for(var O=0,y=this.length-1;y>=0;y--){var f=(this.words[y]|0)+O*67108864;this.words[y]=f/g|0,O=f%g}return this.strip()},n.prototype.divn=function(g){return this.clone().idivn(g)},n.prototype.egcd=function(g){r(g.negative===0),r(!g.isZero());var O=this,y=g.clone();O.negative!==0?O=O.umod(g):O=O.clone();for(var f=new n(1),d=new n(0),_=new n(0),x=new n(1),b=0;O.isEven()&&y.isEven();)O.iushrn(1),y.iushrn(1),++b;for(var p=y.clone(),I=O.clone();!O.isZero();){for(var T=0,S=1;(O.words[0]&S)===0&&T<26;++T,S<<=1);if(T>0)for(O.iushrn(T);T-- >0;)(f.isOdd()||d.isOdd())&&(f.iadd(p),d.isub(I)),f.iushrn(1),d.iushrn(1);for(var R=0,Y=1;(y.words[0]&Y)===0&&R<26;++R,Y<<=1);if(R>0)for(y.iushrn(R);R-- >0;)(_.isOdd()||x.isOdd())&&(_.iadd(p),x.isub(I)),_.iushrn(1),x.iushrn(1);O.cmp(y)>=0?(O.isub(y),f.isub(_),d.isub(x)):(y.isub(O),_.isub(f),x.isub(d))}return{a:_,b:x,gcd:y.iushln(b)}},n.prototype._invmp=function(g){r(g.negative===0),r(!g.isZero());var O=this,y=g.clone();O.negative!==0?O=O.umod(g):O=O.clone();for(var f=new n(1),d=new n(0),_=y.clone();O.cmpn(1)>0&&y.cmpn(1)>0;){for(var x=0,b=1;(O.words[0]&b)===0&&x<26;++x,b<<=1);if(x>0)for(O.iushrn(x);x-- >0;)f.isOdd()&&f.iadd(_),f.iushrn(1);for(var p=0,I=1;(y.words[0]&I)===0&&p<26;++p,I<<=1);if(p>0)for(y.iushrn(p);p-- >0;)d.isOdd()&&d.iadd(_),d.iushrn(1);O.cmp(y)>=0?(O.isub(y),f.isub(d)):(y.isub(O),d.isub(f))}var T;return O.cmpn(1)===0?T=f:T=d,T.cmpn(0)<0&&T.iadd(g),T},n.prototype.gcd=function(g){if(this.isZero())return g.abs();if(g.isZero())return this.abs();var O=this.clone(),y=g.clone();O.negative=0,y.negative=0;for(var f=0;O.isEven()&&y.isEven();f++)O.iushrn(1),y.iushrn(1);do{for(;O.isEven();)O.iushrn(1);for(;y.isEven();)y.iushrn(1);var d=O.cmp(y);if(d<0){var _=O;O=y,y=_}else if(d===0||y.cmpn(1)===0)break;O.isub(y)}while(!0);return y.iushln(f)},n.prototype.invm=function(g){return this.egcd(g).a.umod(g)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(g){return this.words[0]&g},n.prototype.bincn=function(g){r(typeof g=="number");var O=g%26,y=(g-O)/26,f=1<<O;if(this.length<=y)return this._expand(y+1),this.words[y]|=f,this;for(var d=f,_=y;d!==0&&_<this.length;_++){var x=this.words[_]|0;x+=d,d=x>>>26,x&=67108863,this.words[_]=x}return d!==0&&(this.words[_]=d,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(g){var O=g<0;if(this.negative!==0&&!O)return-1;if(this.negative===0&&O)return 1;this.strip();var y;if(this.length>1)y=1;else{O&&(g=-g),r(g<=67108863,"Number is too big");var f=this.words[0]|0;y=f===g?0:f<g?-1:1}return this.negative!==0?-y|0:y},n.prototype.cmp=function(g){if(this.negative!==0&&g.negative===0)return-1;if(this.negative===0&&g.negative!==0)return 1;var O=this.ucmp(g);return this.negative!==0?-O|0:O},n.prototype.ucmp=function(g){if(this.length>g.length)return 1;if(this.length<g.length)return-1;for(var O=0,y=this.length-1;y>=0;y--){var f=this.words[y]|0,d=g.words[y]|0;if(f!==d){f<d?O=-1:f>d&&(O=1);break}}return O},n.prototype.gtn=function(g){return this.cmpn(g)===1},n.prototype.gt=function(g){return this.cmp(g)===1},n.prototype.gten=function(g){return this.cmpn(g)>=0},n.prototype.gte=function(g){return this.cmp(g)>=0},n.prototype.ltn=function(g){return this.cmpn(g)===-1},n.prototype.lt=function(g){return this.cmp(g)===-1},n.prototype.lten=function(g){return this.cmpn(g)<=0},n.prototype.lte=function(g){return this.cmp(g)<=0},n.prototype.eqn=function(g){return this.cmpn(g)===0},n.prototype.eq=function(g){return this.cmp(g)===0},n.red=function(g){return new z(g)},n.prototype.toRed=function(g){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),g.convertTo(this)._forceRed(g)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(g){return this.red=g,this},n.prototype.forceRed=function(g){return r(!this.red,"Already a number in reduction context"),this._forceRed(g)},n.prototype.redAdd=function(g){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,g)},n.prototype.redIAdd=function(g){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,g)},n.prototype.redSub=function(g){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,g)},n.prototype.redISub=function(g){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,g)},n.prototype.redShl=function(g){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,g)},n.prototype.redMul=function(g){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.mul(this,g)},n.prototype.redIMul=function(g){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.imul(this,g)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(g){return r(this.red&&!g.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,g)};var U={k256:null,p224:null,p192:null,p25519:null};function K(B,g){this.name=B,this.p=new n(g,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}K.prototype._tmp=function(){var g=new n(null);return g.words=new Array(Math.ceil(this.n/13)),g},K.prototype.ireduce=function(g){var O=g,y;do this.split(O,this.tmp),O=this.imulK(O),O=O.iadd(this.tmp),y=O.bitLength();while(y>this.n);var f=y<this.n?-1:O.ucmp(this.p);return f===0?(O.words[0]=0,O.length=1):f>0?O.isub(this.p):O.strip!==void 0?O.strip():O._strip(),O},K.prototype.split=function(g,O){g.iushrn(this.n,0,O)},K.prototype.imulK=function(g){return g.imul(this.k)};function N(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(N,K),N.prototype.split=function(g,O){for(var y=4194303,f=Math.min(g.length,9),d=0;d<f;d++)O.words[d]=g.words[d];if(O.length=f,g.length<=9){g.words[0]=0,g.length=1;return}var _=g.words[9];for(O.words[O.length++]=_&y,d=10;d<g.length;d++){var x=g.words[d]|0;g.words[d-10]=(x&y)<<4|_>>>22,_=x}_>>>=22,g.words[d-10]=_,_===0&&g.length>10?g.length-=10:g.length-=9},N.prototype.imulK=function(g){g.words[g.length]=0,g.words[g.length+1]=0,g.length+=2;for(var O=0,y=0;y<g.length;y++){var f=g.words[y]|0;O+=f*977,g.words[y]=O&67108863,O=f*64+(O/67108864|0)}return g.words[g.length-1]===0&&(g.length--,g.words[g.length-1]===0&&g.length--),g};function C(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(C,K);function F(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(F,K);function H(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(H,K),H.prototype.imulK=function(g){for(var O=0,y=0;y<g.length;y++){var f=(g.words[y]|0)*19+O,d=f&67108863;f>>>=26,g.words[y]=d,O=f}return O!==0&&(g.words[g.length++]=O),g},n._prime=function(g){if(U[g])return U[g];var O;if(g==="k256")O=new N;else if(g==="p224")O=new C;else if(g==="p192")O=new F;else if(g==="p25519")O=new H;else throw new Error("Unknown prime "+g);return U[g]=O,O};function z(B){if(typeof B=="string"){var g=n._prime(B);this.m=g.p,this.prime=g}else r(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}z.prototype._verify1=function(g){r(g.negative===0,"red works only with positives"),r(g.red,"red works only with red numbers")},z.prototype._verify2=function(g,O){r((g.negative|O.negative)===0,"red works only with positives"),r(g.red&&g.red===O.red,"red works only with red numbers")},z.prototype.imod=function(g){return this.prime?this.prime.ireduce(g)._forceRed(this):g.umod(this.m)._forceRed(this)},z.prototype.neg=function(g){return g.isZero()?g.clone():this.m.sub(g)._forceRed(this)},z.prototype.add=function(g,O){this._verify2(g,O);var y=g.add(O);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},z.prototype.iadd=function(g,O){this._verify2(g,O);var y=g.iadd(O);return y.cmp(this.m)>=0&&y.isub(this.m),y},z.prototype.sub=function(g,O){this._verify2(g,O);var y=g.sub(O);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},z.prototype.isub=function(g,O){this._verify2(g,O);var y=g.isub(O);return y.cmpn(0)<0&&y.iadd(this.m),y},z.prototype.shl=function(g,O){return this._verify1(g),this.imod(g.ushln(O))},z.prototype.imul=function(g,O){return this._verify2(g,O),this.imod(g.imul(O))},z.prototype.mul=function(g,O){return this._verify2(g,O),this.imod(g.mul(O))},z.prototype.isqr=function(g){return this.imul(g,g.clone())},z.prototype.sqr=function(g){return this.mul(g,g)},z.prototype.sqrt=function(g){if(g.isZero())return g.clone();var O=this.m.andln(3);if(r(O%2===1),O===3){var y=this.m.add(new n(1)).iushrn(2);return this.pow(g,y)}for(var f=this.m.subn(1),d=0;!f.isZero()&&f.andln(1)===0;)d++,f.iushrn(1);r(!f.isZero());var _=new n(1).toRed(this),x=_.redNeg(),b=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new n(2*p*p).toRed(this);this.pow(p,b).cmp(x)!==0;)p.redIAdd(x);for(var I=this.pow(p,f),T=this.pow(g,f.addn(1).iushrn(1)),S=this.pow(g,f),R=d;S.cmp(_)!==0;){for(var Y=S,X=0;Y.cmp(_)!==0;X++)Y=Y.redSqr();r(X<R);var ie=this.pow(I,new n(1).iushln(R-X-1));T=T.redMul(ie),I=ie.redSqr(),S=S.redMul(I),R=X}return T},z.prototype.invm=function(g){var O=g._invmp(this.m);return O.negative!==0?(O.negative=0,this.imod(O).redNeg()):this.imod(O)},z.prototype.pow=function(g,O){if(O.isZero())return new n(1).toRed(this);if(O.cmpn(1)===0)return g.clone();var y=4,f=new Array(1<<y);f[0]=new n(1).toRed(this),f[1]=g;for(var d=2;d<f.length;d++)f[d]=this.mul(f[d-1],g);var _=f[0],x=0,b=0,p=O.bitLength()%26;for(p===0&&(p=26),d=O.length-1;d>=0;d--){for(var I=O.words[d],T=p-1;T>=0;T--){var S=I>>T&1;if(_!==f[0]&&(_=this.sqr(_)),S===0&&x===0){b=0;continue}x<<=1,x|=S,b++,!(b!==y&&(d!==0||T!==0))&&(_=this.mul(_,f[x]),b=0,x=0)}p=26}return _},z.prototype.convertTo=function(g){var O=g.umod(this.m);return O===g?O.clone():O},z.prototype.convertFrom=function(g){var O=g.clone();return O.red=null,O},n.mont=function(g){return new G(g)};function G(B){z.call(this,B),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(G,z),G.prototype.convertTo=function(g){return this.imod(g.ushln(this.shift))},G.prototype.convertFrom=function(g){var O=this.imod(g.mul(this.rinv));return O.red=null,O},G.prototype.imul=function(g,O){if(g.isZero()||O.isZero())return g.words[0]=0,g.length=1,g;var y=g.imul(O),f=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=y.isub(f).iushrn(this.shift),_=d;return d.cmp(this.m)>=0?_=d.isub(this.m):d.cmpn(0)<0&&(_=d.iadd(this.m)),_._forceRed(this)},G.prototype.mul=function(g,O){if(g.isZero()||O.isZero())return new n(0)._forceRed(this);var y=g.mul(O),f=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=y.isub(f).iushrn(this.shift),_=d;return d.cmp(this.m)>=0?_=d.isub(this.m):d.cmpn(0)<0&&(_=d.iadd(this.m)),_._forceRed(this)},G.prototype.invm=function(g){var O=this.imod(g._invmp(this.m).mul(this.r2));return O._forceRed(this)}})(typeof sm>"u"||sm,kE)});var RE=k((R0e,cm)=>{v();var um;cm.exports=function(t){return um||(um=new hs(null)),um.generate(t)};function hs(e){this.rand=e}cm.exports.Rand=hs;hs.prototype.generate=function(t){return this._rand(t)};hs.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?hs.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?hs.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(hs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(fm=_r(),typeof fm.randomBytes!="function")throw new Error("Not supported");hs.prototype._rand=function(t){return fm.randomBytes(t)}}catch{}var fm});var lm=k((M0e,BE)=>{v();var Hu=Nn(),PW=RE();function ju(e){this.rand=e||new PW.Rand}BE.exports=ju;ju.create=function(t){return new ju(t)};ju.prototype._randbelow=function(t){var r=t.bitLength(),i=Math.ceil(r/8);do var n=new Hu(this.rand.generate(i));while(n.cmp(t)>=0);return n};ju.prototype._randrange=function(t,r){var i=r.sub(t);return t.add(this._randbelow(i))};ju.prototype.test=function(t,r,i){var n=t.bitLength(),o=Hu.mont(t),a=new Hu(1).toRed(o);r||(r=Math.max(1,n/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var c=t.shrn(u),l=s.toRed(o),m=!0;r>0;r--){var w=this._randrange(new Hu(2),s);i&&i(w);var E=w.toRed(o).redPow(c);if(!(E.cmp(a)===0||E.cmp(l)===0)){for(var P=1;P<u;P++){if(E=E.redSqr(),E.cmp(a)===0)return!1;if(E.cmp(l)===0)break}if(P===u)return!1}}return m};ju.prototype.getDivisor=function(t,r){var i=t.bitLength(),n=Hu.mont(t),o=new Hu(1).toRed(n);r||(r=Math.max(1,i/48|0));for(var a=t.subn(1),s=0;!a.testn(s);s++);for(var u=t.shrn(s),c=a.toRed(n);r>0;r--){var l=this._randrange(new Hu(2),a),m=t.gcd(l);if(m.cmpn(1)!==0)return m;var w=l.toRed(n).redPow(u);if(!(w.cmp(o)===0||w.cmp(c)===0)){for(var E=1;E<s;E++){if(w=w.redSqr(),w.cmp(o)===0)return w.fromRed().subn(1).gcd(t);if(w.cmp(c)===0)break}if(E===s)return w=w.redSqr(),w.fromRed().subn(1).gcd(t)}}return!1}});var mm=k((U0e,CE)=>{v();var TW=mu();CE.exports=vm;vm.simpleSieve=pm;vm.fermatTest=gm;var Jr=Nn(),kW=new Jr(24),RW=lm(),ME=new RW,BW=new Jr(1),dm=new Jr(2),MW=new Jr(5),C0e=new Jr(16),D0e=new Jr(8),NW=new Jr(10),CW=new Jr(3),L0e=new Jr(7),DW=new Jr(11),NE=new Jr(4),q0e=new Jr(12),hm=null;function LW(){if(hm!==null)return hm;var e=1048576,t=[];t[0]=2;for(var r=1,i=3;i<e;i+=2){for(var n=Math.ceil(Math.sqrt(i)),o=0;o<r&&t[o]<=n&&i%t[o]!==0;o++);r!==o&&t[o]<=n||(t[r++]=i)}return hm=t,t}function pm(e){for(var t=LW(),r=0;r<t.length;r++)if(e.modn(t[r])===0)return e.cmpn(t[r])===0;return!0}function gm(e){var t=Jr.mont(e);return dm.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)===0}function vm(e,t){if(e<16)return t===2||t===5?new Jr([140,123]):new Jr([140,39]);t=new Jr(t);for(var r,i;;){for(r=new Jr(TW(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(BW),r.testn(1)||r.iadd(dm),t.cmp(dm)){if(!t.cmp(MW))for(;r.mod(NW).cmp(CW);)r.iadd(NE)}else for(;r.mod(kW).cmp(DW);)r.iadd(NE);if(i=r.shrn(1),pm(i)&&pm(r)&&gm(i)&&gm(r)&&ME.test(i)&&ME.test(r))return r}}});var DE=k((H0e,qW)=>{qW.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}});var FE=k((j0e,UE)=>{v();var fn=Nn(),UW=lm(),LE=new UW,FW=new fn(24),HW=new fn(11),jW=new fn(10),zW=new fn(3),KW=new fn(7),qE=mm(),VW=mu();UE.exports=ba;function GW(e,t){return t=t||"utf8",h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),this._pub=new fn(e),this}function ZW(e,t){return t=t||"utf8",h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),this._priv=new fn(e),this}var U2={};function WW(e,t){var r=t.toString("hex"),i=[r,e.toString(16)].join("_");if(i in U2)return U2[i];var n=0;if(e.isEven()||!qE.simpleSieve||!qE.fermatTest(e)||!LE.test(e))return n+=1,r==="02"||r==="05"?n+=8:n+=4,U2[i]=n,n;LE.test(e.shrn(1))||(n+=2);var o;switch(r){case"02":e.mod(FW).cmp(HW)&&(n+=8);break;case"05":o=e.mod(jW),o.cmp(zW)&&o.cmp(KW)&&(n+=8);break;default:n+=4}return U2[i]=n,n}function ba(e,t,r){this.setGenerator(t),this.__prime=new fn(e),this._prime=fn.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=GW,this.setPrivateKey=ZW):this._primeCode=8}Object.defineProperty(ba.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=WW(this.__prime,this.__gen)),this._primeCode}});ba.prototype.generateKeys=function(){return this._priv||(this._priv=new fn(VW(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()};ba.prototype.computeSecret=function(e){e=new fn(e),e=e.toRed(this._prime);var t=e.redPow(this._priv).fromRed(),r=new h.Buffer(t.toArray()),i=this.getPrime();if(r.length<i.length){var n=new h.Buffer(i.length-r.length);n.fill(0),r=h.Buffer.concat([n,r])}return r};ba.prototype.getPublicKey=function(t){return F2(this._pub,t)};ba.prototype.getPrivateKey=function(t){return F2(this._priv,t)};ba.prototype.getPrime=function(e){return F2(this.__prime,e)};ba.prototype.getGenerator=function(e){return F2(this._gen,e)};ba.prototype.setGenerator=function(e,t){return t=t||"utf8",h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),this.__gen=e,this._gen=new fn(e),this};function F2(e,t){var r=new h.Buffer(e.toArray());return t?r.toString(t):r}});var zE=k(Ac=>{v();var YW=mm(),HE=DE(),ym=FE();function $W(e){var t=new h.Buffer(HE[e].prime,"hex"),r=new h.Buffer(HE[e].gen,"hex");return new ym(t,r)}var XW={binary:!0,hex:!0,base64:!0};function jE(e,t,r,i){return h.Buffer.isBuffer(t)||XW[t]===void 0?jE(e,"binary",t,r):(t=t||"binary",i=i||"binary",r=r||new h.Buffer([2]),h.Buffer.isBuffer(r)||(r=new h.Buffer(r,i)),typeof e=="number"?new ym(YW(e,r),r,!0):(h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),new ym(e,r,!0)))}Ac.DiffieHellmanGroup=Ac.createDiffieHellmanGroup=Ac.getDiffieHellman=$W;Ac.createDiffieHellman=Ac.DiffieHellman=jE});var KE=k((exports,module)=>{v();var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch{return function(t,r,i){t[r]=i}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,i=r.eval,n=r.execScript;!i&&n&&(n.call(r,"null"),i=r.eval),forEach(Object_keys(e),function(s){r[s]=e[s]}),forEach(globals,function(s){e[s]&&(r[s]=e[s])});var o=Object_keys(r),a=i.call(r,this.code);return forEach(Object_keys(r),function(s){(s in e||indexOf(o,s)===-1)&&(e[s]=r[s])}),forEach(globals,function(s){s in e||defineProp(e,s,r[s])}),document.body.removeChild(t),a};Script.prototype.runInThisContext=function(){return eval(this.code)};Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),function(i){e[i]=t[i]}),r};forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}});exports.isContext=function(e){return e instanceof Context};exports.createScript=function(e){return exports.Script(e)};exports.createContext=Script.createContext=function(e){var t=new Context;return typeof e=="object"&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}});var ZE=k(GE=>{v();var VE=Tc(),JW=Ot(),QW=GE;QW.define=function(t,r){return new Pc(t,r)};function Pc(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}Pc.prototype._createNamed=function(t){var r;try{r=KE().runInThisContext("(function "+this.name+`(entity) {
|
|
11
|
+
`)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}ht.types=a_();function l_(e){return Array.isArray(e)}ht.isArray=l_;function Rg(e){return typeof e=="boolean"}ht.isBoolean=Rg;function qd(e){return e===null}ht.isNull=qd;function vj(e){return e==null}ht.isNullOrUndefined=vj;function h_(e){return typeof e=="number"}ht.isNumber=h_;function Ud(e){return typeof e=="string"}ht.isString=Ud;function mj(e){return typeof e=="symbol"}ht.isSymbol=mj;function xu(e){return e===void 0}ht.isUndefined=xu;function vh(e){return cc(e)&&Bg(e)==="[object RegExp]"}ht.isRegExp=vh;ht.types.isRegExp=vh;function cc(e){return typeof e=="object"&&e!==null}ht.isObject=cc;function Ld(e){return cc(e)&&Bg(e)==="[object Date]"}ht.isDate=Ld;ht.types.isDate=Ld;function mh(e){return cc(e)&&(Bg(e)==="[object Error]"||e instanceof Error)}ht.isError=mh;ht.types.isNativeError=mh;function Cd(e){return typeof e=="function"}ht.isFunction=Cd;function yj(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}ht.isPrimitive=yj;ht.isBuffer=u_();function Bg(e){return Object.prototype.toString.call(e)}function Tg(e){return e<10?"0"+e.toString(10):e.toString(10)}var bj=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _j(){var e=new Date,t=[Tg(e.getHours()),Tg(e.getMinutes()),Tg(e.getSeconds())].join(":");return[e.getDate(),bj[e.getMonth()],t].join(" ")}ht.log=function(){console.log("%s - %s",_j(),ht.format.apply(ht,arguments))};ht.inherits=Ot();ht._extend=function(e,t){if(!t||!cc(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};function d_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Su=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ht.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(Su&&t[Su]){var r=t[Su];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,Su,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var i,n,o=new Promise(function(u,c){i=u,n=c}),a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);a.push(function(u,c){u?n(u):i(c)});try{t.apply(this,a)}catch(u){n(u)}return o}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Su&&Object.defineProperty(r,Su,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,f_(t))};ht.promisify.custom=Su;function wj(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function Sj(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');function t(){for(var r=[],i=0;i<arguments.length;i++)r.push(arguments[i]);var n=r.pop();if(typeof n!="function")throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return n.apply(o,arguments)};e.apply(this,r).then(function(s){A.default.nextTick(a.bind(null,null,s))},function(s){A.default.nextTick(wj.bind(null,s,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,f_(e)),t}ht.callbackify=Sj});var b_=k((hce,y_)=>{"use strict";v();function p_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function g_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p_(Object(r),!0).forEach(function(i){xj(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p_(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function xj(e,t,r){return t=m_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ej(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v_(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,m_(i.key),i)}}function Oj(e,t,r){return t&&v_(e.prototype,t),r&&v_(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function m_(e){var t=Ij(e,"string");return typeof t=="symbol"?t:String(t)}function Ij(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Aj=Kt(),Fd=Aj.Buffer,Pj=rn(),Mg=Pj.inspect,Tj=Mg&&Mg.custom||"inspect";function kj(e,t,r){Fd.prototype.copy.call(e,t,r)}y_.exports=(function(){function e(){Ej(this,e),this.head=null,this.tail=null,this.length=0}return Oj(e,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return Fd.alloc(0);for(var i=Fd.allocUnsafe(r>>>0),n=this.head,o=0;n;)kj(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var a=i.data,s=r>a.length?a.length:r;if(s===a.length?o+=a:o+=a.slice(0,r),r-=s,r===0){s===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=Fd.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,s=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,s),r-=s,r===0){s===a.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++o}return this.length-=o,i}},{key:Tj,value:function(r,i){return Mg(this,g_(g_({},i),{},{depth:0,customInspect:!1}))}}]),e})()});var Cg=k((pce,w_)=>{"use strict";v();function Rj(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,A.default.nextTick(Ng,this,e)):A.default.nextTick(Ng,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted?A.default.nextTick(Hd,r):(r._writableState.errorEmitted=!0,A.default.nextTick(__,r,o)):A.default.nextTick(__,r,o):t?(A.default.nextTick(Hd,r),t(o)):A.default.nextTick(Hd,r)}),this)}function __(e,t){Ng(e,t),Hd(e)}function Hd(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Bj(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ng(e,t){e.emit("error",t)}function Mj(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}w_.exports={destroy:Rj,undestroy:Bj,errorOrDestroy:Mj}});var Eu=k((vce,E_)=>{"use strict";v();function Nj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var x_={};function nn(e,t,r){r||(r=Error);function i(o,a,s){return typeof t=="string"?t:t(o,a,s)}var n=(function(o){Nj(a,o);function a(s,u,c){return o.call(this,i(s,u,c))||this}return a})(r);n.prototype.name=r.name,n.prototype.code=e,x_[e]=n}function S_(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Cj(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Dj(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Lj(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}nn("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);nn("ERR_INVALID_ARG_TYPE",function(e,t,r){var i;typeof t=="string"&&Cj(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(Dj(e," argument"))n="The ".concat(e," ").concat(i," ").concat(S_(t,"type"));else{var o=Lj(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(i," ").concat(S_(t,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);nn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");nn("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});nn("ERR_STREAM_PREMATURE_CLOSE","Premature close");nn("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});nn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");nn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");nn("ERR_STREAM_WRITE_AFTER_END","write after end");nn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);nn("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);nn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");E_.exports.codes=x_});var Dg=k((yce,O_)=>{"use strict";v();var qj=Eu().codes.ERR_INVALID_OPT_VALUE;function Uj(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Fj(e,t,r,i){var n=Uj(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new qj(o,n)}return Math.floor(n)}return e.objectMode?16:16*1024}O_.exports={getHighWaterMark:Fj}});var qg=k((_ce,I_)=>{v();I_.exports=Hj;function Hj(e,t){if(Lg("noDeprecation"))return e;var r=!1;function i(){if(!r){if(Lg("throwDeprecation"))throw new Error(t);Lg("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return i}function Lg(e){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}});var Hg=k((Sce,B_)=>{"use strict";v();B_.exports=ur;function P_(e){var t=this;this.next=null,this.entry=null,this.finish=function(){pz(t,e)}}var lc;ur.WritableState=bh;var jj={deprecate:qg()},T_=eg(),zd=Kt().Buffer,zj=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Kj(e){return zd.from(e)}function Vj(e){return zd.isBuffer(e)||e instanceof zj}var Fg=Cg(),Gj=Dg(),Zj=Gj.getHighWaterMark,is=Eu().codes,Wj=is.ERR_INVALID_ARG_TYPE,Yj=is.ERR_METHOD_NOT_IMPLEMENTED,$j=is.ERR_MULTIPLE_CALLBACK,Xj=is.ERR_STREAM_CANNOT_PIPE,Jj=is.ERR_STREAM_DESTROYED,Qj=is.ERR_STREAM_NULL_VALUES,ez=is.ERR_STREAM_WRITE_AFTER_END,tz=is.ERR_UNKNOWN_ENCODING,hc=Fg.errorOrDestroy;yu()(ur,T_);function rz(){}function bh(e,t,r){lc=lc||Ou(),e=e||{},typeof r!="boolean"&&(r=t instanceof lc),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Zj(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){fz(t,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new P_(this)}bh.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(bh.prototype,"buffer",{get:jj.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var jd;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(jd=Function.prototype[Symbol.hasInstance],Object.defineProperty(ur,Symbol.hasInstance,{value:function(t){return jd.call(this,t)?!0:this!==ur?!1:t&&t._writableState instanceof bh}})):jd=function(t){return t instanceof this};function ur(e){lc=lc||Ou();var t=this instanceof lc;if(!t&&!jd.call(ur,this))return new ur(e);this._writableState=new bh(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),T_.call(this)}ur.prototype.pipe=function(){hc(this,new Xj)};function iz(e,t){var r=new ez;hc(e,r),A.default.nextTick(t,r)}function nz(e,t,r,i){var n;return r===null?n=new Qj:typeof r!="string"&&!t.objectMode&&(n=new Wj("chunk",["string","Buffer"],r)),n?(hc(e,n),A.default.nextTick(i,n),!1):!0}ur.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&Vj(e);return o&&!zd.isBuffer(e)&&(e=Kj(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=rz),i.ending?iz(this,r):(o||nz(this,i,e,r))&&(i.pendingcb++,n=az(this,i,o,e,t,r)),n};ur.prototype.cork=function(){this._writableState.corked++};ur.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&k_(this,e))};ur.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new tz(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oz(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=zd.from(t,r)),t}Object.defineProperty(ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function az(e,t,r,i,n,o){if(!r){var a=oz(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Ug(e,t,!1,s,i,n,o);return u}function Ug(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Jj("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function sz(e,t,r,i,n){--t.pendingcb,r?(A.default.nextTick(n,i),A.default.nextTick(yh,e,t),e._writableState.errorEmitted=!0,hc(e,i)):(n(i),e._writableState.errorEmitted=!0,hc(e,i),yh(e,t))}function uz(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function fz(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new $j;if(uz(r),t)sz(e,r,i,t,n);else{var o=R_(r)||e.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&k_(e,r),i?A.default.nextTick(A_,e,r,o,n):A_(e,r,o,n)}}function A_(e,t,r,i){r||cz(e,t),t.pendingcb--,i(),yh(e,t)}function cz(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function k_(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,Ug(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new P_(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,m=t.objectMode?1:u.length;if(Ug(e,t,!1,m,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ur.prototype._write=function(e,t,r){r(new Yj("_write()"))};ur.prototype._writev=null;ur.prototype.end=function(e,t,r){var i=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||dz(this,i,r),this};Object.defineProperty(ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function R_(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function lz(e,t){e._final(function(r){t.pendingcb--,r&&hc(e,r),t.prefinished=!0,e.emit("prefinish"),yh(e,t)})}function hz(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,A.default.nextTick(lz,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function yh(e,t){var r=R_(t);if(r&&(hz(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}function dz(e,t,r){t.ending=!0,yh(e,t),r&&(t.finished?A.default.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function pz(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ur.prototype.destroy=Fg.destroy;ur.prototype._undestroy=Fg.undestroy;ur.prototype._destroy=function(e,t){t(e)}});var Ou=k((Ece,N_)=>{"use strict";v();var gz=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};N_.exports=yo;var M_=Kg(),zg=Hg();yu()(yo,M_);for(jg=gz(zg.prototype),Kd=0;Kd<jg.length;Kd++)Vd=jg[Kd],yo.prototype[Vd]||(yo.prototype[Vd]=zg.prototype[Vd]);var jg,Vd,Kd;function yo(e){if(!(this instanceof yo))return new yo(e);M_.call(this,e),zg.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",vz)))}Object.defineProperty(yo.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(yo.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(yo.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function vz(){this._writableState.ended||A.default.nextTick(mz,this)}function mz(e){e.end()}Object.defineProperty(yo.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var L_=k((Vg,D_)=>{v();var Gd=Kt(),ua=Gd.Buffer;function C_(e,t){for(var r in e)t[r]=e[r]}ua.from&&ua.alloc&&ua.allocUnsafe&&ua.allocUnsafeSlow?D_.exports=Gd:(C_(Gd,Vg),Vg.Buffer=dc);function dc(e,t,r){return ua(e,t,r)}C_(ua,dc);dc.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ua(e,t,r)};dc.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=ua(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};dc.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ua(e)};dc.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Gd.SlowBuffer(e)}});var pc=k(U_=>{"use strict";v();var Zg=L_().Buffer,q_=Zg.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function yz(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function bz(e){var t=yz(e);if(typeof t!="string"&&(Zg.isEncoding===q_||!q_(e)))throw new Error("Unknown encoding: "+e);return t||e}U_.StringDecoder=_h;function _h(e){this.encoding=bz(e);var t;switch(this.encoding){case"utf16le":this.text=Oz,this.end=Iz,t=4;break;case"utf8":this.fillLast=Sz,t=4;break;case"base64":this.text=Az,this.end=Pz,t=3;break;default:this.write=Tz,this.end=kz;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Zg.allocUnsafe(t)}_h.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};_h.prototype.end=Ez;_h.prototype.text=xz;_h.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Gg(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function _z(e,t,r){var i=t.length-1;if(i<r)return 0;var n=Gg(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=Gg(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=Gg(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function wz(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Sz(e){var t=this.lastTotal-this.lastNeed,r=wz(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function xz(e,t){var r=_z(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function Ez(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Oz(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Iz(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Az(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Pz(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Tz(e){return e.toString(this.encoding)}function kz(e){return e&&e.length?this.write(e):""}});var Zd=k((Tce,j_)=>{"use strict";v();var F_=Eu().codes.ERR_STREAM_PREMATURE_CLOSE;function Rz(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}function Bz(){}function Mz(e){return e.setHeader&&typeof e.abort=="function"}function H_(e,t,r){if(typeof t=="function")return H_(e,null,t);t||(t={}),r=Rz(r||Bz);var i=t.readable||t.readable!==!1&&e.readable,n=t.writable||t.writable!==!1&&e.writable,o=function(){e.writable||s()},a=e._writableState&&e._writableState.finished,s=function(){n=!1,a=!0,i||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){i=!1,u=!0,n||r.call(e)},l=function(P){r.call(e,P)},m=function(){var P;if(i&&!u)return(!e._readableState||!e._readableState.ended)&&(P=new F_),r.call(e,P);if(n&&!a)return(!e._writableState||!e._writableState.ended)&&(P=new F_),r.call(e,P)},w=function(){e.req.on("finish",s)};return Mz(e)?(e.on("complete",s),e.on("abort",m),e.req?w():e.on("request",w)):n&&!e._writableState&&(e.on("end",o),e.on("close",o)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",m),function(){e.removeListener("complete",s),e.removeListener("abort",m),e.removeListener("request",w),e.req&&e.req.removeListener("finish",s),e.removeListener("end",o),e.removeListener("close",o),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",m)}}j_.exports=H_});var K_=k((Rce,z_)=>{"use strict";v();var Wd;function ns(e,t,r){return t=Nz(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nz(e){var t=Cz(e,"string");return typeof t=="symbol"?t:String(t)}function Cz(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dz=Zd(),os=Symbol("lastResolve"),Iu=Symbol("lastReject"),wh=Symbol("error"),Yd=Symbol("ended"),Au=Symbol("lastPromise"),Wg=Symbol("handlePromise"),Pu=Symbol("stream");function as(e,t){return{value:e,done:t}}function Lz(e){var t=e[os];if(t!==null){var r=e[Pu].read();r!==null&&(e[Au]=null,e[os]=null,e[Iu]=null,t(as(r,!1)))}}function qz(e){A.default.nextTick(Lz,e)}function Uz(e,t){return function(r,i){e.then(function(){if(t[Yd]){r(as(void 0,!0));return}t[Wg](r,i)},i)}}var Fz=Object.getPrototypeOf(function(){}),Hz=Object.setPrototypeOf((Wd={get stream(){return this[Pu]},next:function(){var t=this,r=this[wh];if(r!==null)return Promise.reject(r);if(this[Yd])return Promise.resolve(as(void 0,!0));if(this[Pu].destroyed)return new Promise(function(a,s){A.default.nextTick(function(){t[wh]?s(t[wh]):a(as(void 0,!0))})});var i=this[Au],n;if(i)n=new Promise(Uz(i,this));else{var o=this[Pu].read();if(o!==null)return Promise.resolve(as(o,!1));n=new Promise(this[Wg])}return this[Au]=n,n}},ns(Wd,Symbol.asyncIterator,function(){return this}),ns(Wd,"return",function(){var t=this;return new Promise(function(r,i){t[Pu].destroy(null,function(n){if(n){i(n);return}r(as(void 0,!0))})})}),Wd),Fz),jz=function(t){var r,i=Object.create(Hz,(r={},ns(r,Pu,{value:t,writable:!0}),ns(r,os,{value:null,writable:!0}),ns(r,Iu,{value:null,writable:!0}),ns(r,wh,{value:null,writable:!0}),ns(r,Yd,{value:t._readableState.endEmitted,writable:!0}),ns(r,Wg,{value:function(o,a){var s=i[Pu].read();s?(i[Au]=null,i[os]=null,i[Iu]=null,o(as(s,!1))):(i[os]=o,i[Iu]=a)},writable:!0}),r));return i[Au]=null,Dz(t,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[Iu];o!==null&&(i[Au]=null,i[os]=null,i[Iu]=null,o(n)),i[wh]=n;return}var a=i[os];a!==null&&(i[Au]=null,i[os]=null,i[Iu]=null,a(as(void 0,!0))),i[Yd]=!0}),t.on("readable",qz.bind(null,i)),i};z_.exports=jz});var G_=k((Mce,V_)=>{v();V_.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Kg=k((Dce,rw)=>{"use strict";v();rw.exports=St;var gc;St.ReadableState=$_;var Cce=tc().EventEmitter,Y_=function(t,r){return t.listeners(r).length},xh=eg(),$d=Kt().Buffer,zz=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Kz(e){return $d.from(e)}function Vz(e){return $d.isBuffer(e)||e instanceof zz}var Yg=rn(),ft;Yg&&Yg.debuglog?ft=Yg.debuglog("stream"):ft=function(){};var Gz=b_(),rv=Cg(),Zz=Dg(),Wz=Zz.getHighWaterMark,Xd=Eu().codes,Yz=Xd.ERR_INVALID_ARG_TYPE,$z=Xd.ERR_STREAM_PUSH_AFTER_EOF,Xz=Xd.ERR_METHOD_NOT_IMPLEMENTED,Jz=Xd.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,vc,$g,Xg;yu()(St,xh);var Sh=rv.errorOrDestroy,Jg=["error","close","destroy","pause","resume"];function Qz(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function $_(e,t,r){gc=gc||Ou(),e=e||{},typeof r!="boolean"&&(r=t instanceof gc),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Wz(this,e,"readableHighWaterMark",r),this.buffer=new Gz,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(vc||(vc=pc().StringDecoder),this.decoder=new vc(e.encoding),this.encoding=e.encoding)}function St(e){if(gc=gc||Ou(),!(this instanceof St))return new St(e);var t=this instanceof gc;this._readableState=new $_(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),xh.call(this)}Object.defineProperty(St.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});St.prototype.destroy=rv.destroy;St.prototype._undestroy=rv.undestroy;St.prototype._destroy=function(e,t){t(e)};St.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=$d.from(e,t),t=""),i=!0),X_(this,e,t,!1,i)};St.prototype.unshift=function(e){return X_(this,e,null,!0,!1)};function X_(e,t,r,i,n){ft("readableAddChunk",t);var o=e._readableState;if(t===null)o.reading=!1,rK(e,o);else{var a;if(n||(a=eK(o,t)),a)Sh(e,a);else if(o.objectMode||t&&t.length>0)if(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==$d.prototype&&(t=Kz(t)),i)o.endEmitted?Sh(e,new Jz):Qg(e,o,t,!0);else if(o.ended)Sh(e,new $z);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?Qg(e,o,t,!1):tv(e,o)):Qg(e,o,t,!1)}else i||(o.reading=!1,tv(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Qg(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Jd(e)),tv(e,t)}function eK(e,t){var r;return!Vz(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Yz("chunk",["string","Buffer","Uint8Array"],t)),r}St.prototype.isPaused=function(){return this._readableState.flowing===!1};St.prototype.setEncoding=function(e){vc||(vc=pc().StringDecoder);var t=new vc(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Z_=1073741824;function tK(e){return e>=Z_?e=Z_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function W_(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=tK(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}St.prototype.read=function(e){ft("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return ft("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ev(this):Jd(this),null;if(e=W_(e,t),e===0&&t.ended)return t.length===0&&ev(this),null;var i=t.needReadable;ft("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,ft("length less than watermark",i)),t.ended||t.reading?(i=!1,ft("reading or ended",i)):i&&(ft("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=W_(r,t)));var n;return e>0?n=ew(e,t):n=null,n===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ev(this)),n!==null&&this.emit("data",n),n};function rK(e,t){if(ft("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Jd(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,J_(e)))}}function Jd(e){var t=e._readableState;ft("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(ft("emitReadable",t.flowing),t.emittedReadable=!0,A.default.nextTick(J_,e))}function J_(e){var t=e._readableState;ft("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,iv(e)}function tv(e,t){t.readingMore||(t.readingMore=!0,A.default.nextTick(iK,e,t))}function iK(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(ft("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}St.prototype._read=function(e){Sh(this,new Xz("_read()"))};St.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,ft("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==A.default.stdout&&e!==A.default.stderr,o=n?s:M;i.endEmitted?A.default.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(D,L){ft("onunpipe"),D===r&&L&&L.hasUnpiped===!1&&(L.hasUnpiped=!0,l())}function s(){ft("onend"),e.end()}var u=nK(r);e.on("drain",u);var c=!1;function l(){ft("cleanup"),e.removeListener("close",E),e.removeListener("finish",P),e.removeListener("drain",u),e.removeListener("error",w),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",M),r.removeListener("data",m),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",m);function m(D){ft("ondata");var L=e.write(D);ft("dest.write",L),L===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&tw(i.pipes,e)!==-1)&&!c&&(ft("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function w(D){ft("onerror",D),M(),e.removeListener("error",w),Y_(e,"error")===0&&Sh(e,D)}Qz(e,"error",w);function E(){e.removeListener("finish",P),M()}e.once("close",E);function P(){ft("onfinish"),e.removeListener("close",E),M()}e.once("finish",P);function M(){ft("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(ft("pipe resume"),r.resume()),e};function nK(e){return function(){var r=e._readableState;ft("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Y_(e,"data")&&(r.flowing=!0,iv(e))}}St.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=tw(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};St.prototype.on=function(e,t){var r=xh.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,ft("on readable",i.length,i.reading),i.length?Jd(this):i.reading||A.default.nextTick(oK,this)),r};St.prototype.addListener=St.prototype.on;St.prototype.removeListener=function(e,t){var r=xh.prototype.removeListener.call(this,e,t);return e==="readable"&&A.default.nextTick(Q_,this),r};St.prototype.removeAllListeners=function(e){var t=xh.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&A.default.nextTick(Q_,this),t};function Q_(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function oK(e){ft("readable nexttick read 0"),e.read(0)}St.prototype.resume=function(){var e=this._readableState;return e.flowing||(ft("resume"),e.flowing=!e.readableListening,aK(this,e)),e.paused=!1,this};function aK(e,t){t.resumeScheduled||(t.resumeScheduled=!0,A.default.nextTick(sK,e,t))}function sK(e,t){ft("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),iv(e),t.flowing&&!t.reading&&e.read(0)}St.prototype.pause=function(){return ft("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ft("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function iv(e){var t=e._readableState;for(ft("flow",t.flowing);t.flowing&&e.read()!==null;);}St.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(ft("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(ft("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(s){return function(){return e[s].apply(e,arguments)}})(n));for(var o=0;o<Jg.length;o++)e.on(Jg[o],this.emit.bind(this,Jg[o]));return this._read=function(a){ft("wrapped _read",a),i&&(i=!1,e.resume())},this};typeof Symbol=="function"&&(St.prototype[Symbol.asyncIterator]=function(){return $g===void 0&&($g=K_()),$g(this)});Object.defineProperty(St.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(St.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(St.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});St._fromList=ew;Object.defineProperty(St.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ew(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ev(e){var t=e._readableState;ft("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,A.default.nextTick(uK,t,e))}function uK(e,t){if(ft("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(St.from=function(e,t){return Xg===void 0&&(Xg=G_()),Xg(St,e,t)});function tw(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var nv=k((qce,nw)=>{"use strict";v();nw.exports=fa;var Qd=Eu().codes,fK=Qd.ERR_METHOD_NOT_IMPLEMENTED,cK=Qd.ERR_MULTIPLE_CALLBACK,lK=Qd.ERR_TRANSFORM_ALREADY_TRANSFORMING,hK=Qd.ERR_TRANSFORM_WITH_LENGTH_0,e2=Ou();yu()(fa,e2);function dK(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new cK);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function fa(e){if(!(this instanceof fa))return new fa(e);e2.call(this,e),this._transformState={afterTransform:dK.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",pK)}function pK(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){iw(e,t,r)}):iw(this,null,null)}fa.prototype.push=function(e,t){return this._transformState.needTransform=!1,e2.prototype.push.call(this,e,t)};fa.prototype._transform=function(e,t,r){r(new fK("_transform()"))};fa.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};fa.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};fa.prototype._destroy=function(e,t){e2.prototype._destroy.call(this,e,function(r){t(r)})};function iw(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new hK;if(e._transformState.transforming)throw new lK;return e.push(null)}});var sw=k((Fce,aw)=>{"use strict";v();aw.exports=Eh;var ow=nv();yu()(Eh,ow);function Eh(e){if(!(this instanceof Eh))return new Eh(e);ow.call(this,e)}Eh.prototype._transform=function(e,t,r){r(null,e)}});var hw=k((jce,lw)=>{"use strict";v();var ov;function gK(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var cw=Eu().codes,vK=cw.ERR_MISSING_ARGS,mK=cw.ERR_STREAM_DESTROYED;function uw(e){if(e)throw e}function yK(e){return e.setHeader&&typeof e.abort=="function"}function bK(e,t,r,i){i=gK(i);var n=!1;e.on("close",function(){n=!0}),ov===void 0&&(ov=Zd()),ov(e,{readable:t,writable:r},function(a){if(a)return i(a);n=!0,i()});var o=!1;return function(a){if(!n&&!o){if(o=!0,yK(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();i(a||new mK("pipe"))}}}function fw(e){e()}function _K(e,t){return e.pipe(t)}function wK(e){return!e.length||typeof e[e.length-1]!="function"?uw:e.pop()}function SK(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=wK(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new vK("streams");var n,o=t.map(function(a,s){var u=s<t.length-1,c=s>0;return bK(a,u,c,function(l){n||(n=l),l&&o.forEach(fw),!u&&(o.forEach(fw),i(n))})});return t.reduce(_K)}lw.exports=SK});var t2=k((Kce,dw)=>{v();dw.exports=on;var av=tc().EventEmitter,xK=yu();xK(on,av);on.Readable=Kg();on.Writable=Hg();on.Duplex=Ou();on.Transform=nv();on.PassThrough=sw();on.finished=Zd();on.pipeline=hw();on.Stream=on;function on(){av.call(this)}on.prototype.pipe=function(e,t){var r=this;function i(l){e.writable&&e.write(l)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}e.on("drain",n),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function u(l){if(c(),av.listenerCount(this,"error")===0)throw l}r.on("error",u),e.on("error",u);function c(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}});var pw=k((Gce,sv)=>{v();typeof Object.create=="function"?sv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:sv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var mw=k((Wce,vw)=>{"use strict";v();var bo=nt().Buffer,gw=t2().Transform,EK=pw();function ss(e){gw.call(this),this._block=bo.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}EK(ss,gw);ss.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(n){i=n}r(i)};ss.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};var OK=typeof Uint8Array<"u",IK=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(bo.prototype instanceof Uint8Array||bo.TYPED_ARRAY_SUPPORT);function AK(e,t){if(e instanceof bo)return e;if(typeof e=="string")return bo.from(e,t);if(IK&&ArrayBuffer.isView(e)){if(e.byteLength===0)return bo.alloc(0);var r=bo.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}if(OK&&e instanceof Uint8Array||bo.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return bo.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}ss.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");e=AK(e,t);for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,a=e.length*8;a>0;++o)this._length[o]+=a,a=this._length[o]/4294967296|0,a>0&&(this._length[o]-=4294967296*a);return this};ss.prototype._update=function(){throw new Error("_update is not implemented")};ss.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};ss.prototype._digest=function(){throw new Error("_digest is not implemented")};vw.exports=ss});var n2=k(($ce,bw)=>{"use strict";v();var PK=Ot(),yw=mw(),TK=nt().Buffer,kK=new Array(16);function r2(){yw.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}PK(r2,yw);r2.prototype._update=function(){for(var e=kK,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,i=this._b,n=this._c,o=this._d;r=si(r,i,n,o,e[0],3614090360,7),o=si(o,r,i,n,e[1],3905402710,12),n=si(n,o,r,i,e[2],606105819,17),i=si(i,n,o,r,e[3],3250441966,22),r=si(r,i,n,o,e[4],4118548399,7),o=si(o,r,i,n,e[5],1200080426,12),n=si(n,o,r,i,e[6],2821735955,17),i=si(i,n,o,r,e[7],4249261313,22),r=si(r,i,n,o,e[8],1770035416,7),o=si(o,r,i,n,e[9],2336552879,12),n=si(n,o,r,i,e[10],4294925233,17),i=si(i,n,o,r,e[11],2304563134,22),r=si(r,i,n,o,e[12],1804603682,7),o=si(o,r,i,n,e[13],4254626195,12),n=si(n,o,r,i,e[14],2792965006,17),i=si(i,n,o,r,e[15],1236535329,22),r=ui(r,i,n,o,e[1],4129170786,5),o=ui(o,r,i,n,e[6],3225465664,9),n=ui(n,o,r,i,e[11],643717713,14),i=ui(i,n,o,r,e[0],3921069994,20),r=ui(r,i,n,o,e[5],3593408605,5),o=ui(o,r,i,n,e[10],38016083,9),n=ui(n,o,r,i,e[15],3634488961,14),i=ui(i,n,o,r,e[4],3889429448,20),r=ui(r,i,n,o,e[9],568446438,5),o=ui(o,r,i,n,e[14],3275163606,9),n=ui(n,o,r,i,e[3],4107603335,14),i=ui(i,n,o,r,e[8],1163531501,20),r=ui(r,i,n,o,e[13],2850285829,5),o=ui(o,r,i,n,e[2],4243563512,9),n=ui(n,o,r,i,e[7],1735328473,14),i=ui(i,n,o,r,e[12],2368359562,20),r=fi(r,i,n,o,e[5],4294588738,4),o=fi(o,r,i,n,e[8],2272392833,11),n=fi(n,o,r,i,e[11],1839030562,16),i=fi(i,n,o,r,e[14],4259657740,23),r=fi(r,i,n,o,e[1],2763975236,4),o=fi(o,r,i,n,e[4],1272893353,11),n=fi(n,o,r,i,e[7],4139469664,16),i=fi(i,n,o,r,e[10],3200236656,23),r=fi(r,i,n,o,e[13],681279174,4),o=fi(o,r,i,n,e[0],3936430074,11),n=fi(n,o,r,i,e[3],3572445317,16),i=fi(i,n,o,r,e[6],76029189,23),r=fi(r,i,n,o,e[9],3654602809,4),o=fi(o,r,i,n,e[12],3873151461,11),n=fi(n,o,r,i,e[15],530742520,16),i=fi(i,n,o,r,e[2],3299628645,23),r=ci(r,i,n,o,e[0],4096336452,6),o=ci(o,r,i,n,e[7],1126891415,10),n=ci(n,o,r,i,e[14],2878612391,15),i=ci(i,n,o,r,e[5],4237533241,21),r=ci(r,i,n,o,e[12],1700485571,6),o=ci(o,r,i,n,e[3],2399980690,10),n=ci(n,o,r,i,e[10],4293915773,15),i=ci(i,n,o,r,e[1],2240044497,21),r=ci(r,i,n,o,e[8],1873313359,6),o=ci(o,r,i,n,e[15],4264355552,10),n=ci(n,o,r,i,e[6],2734768916,15),i=ci(i,n,o,r,e[13],1309151649,21),r=ci(r,i,n,o,e[4],4149444226,6),o=ci(o,r,i,n,e[11],3174756917,10),n=ci(n,o,r,i,e[2],718787259,15),i=ci(i,n,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0};r2.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=TK.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function i2(e,t){return e<<t|e>>>32-t}function si(e,t,r,i,n,o,a){return i2(e+(t&r|~t&i)+n+o|0,a)+t|0}function ui(e,t,r,i,n,o,a){return i2(e+(t&i|r&~i)+n+o|0,a)+t|0}function fi(e,t,r,i,n,o,a){return i2(e+(t^r^i)+n+o|0,a)+t|0}function ci(e,t,r,i,n,o,a){return i2(e+(r^(t|~i))+n+o|0,a)+t|0}bw.exports=r2});var fv=k((Jce,uv)=>{v();typeof Object.create=="function"?uv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:uv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var ww=k((ele,_w)=>{v();var RK={}.toString;_w.exports=Array.isArray||function(e){return RK.call(e)=="[object Array]"}});var xw=k((rle,Sw)=>{"use strict";v();var BK=bu(),MK=ts(),NK=MK("TypedArray.prototype.buffer",!0),CK=Og();Sw.exports=NK||function(t){if(!CK(t))throw new BK("Not a Typed Array");return t.buffer}});var Oh=k((nle,Ow)=>{"use strict";v();var Tn=nt().Buffer,DK=ww(),LK=xw(),qK=ArrayBuffer.isView||function(t){try{return LK(t),!0}catch{return!1}},UK=typeof Uint8Array<"u",Ew=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",FK=Ew&&(Tn.prototype instanceof Uint8Array||Tn.TYPED_ARRAY_SUPPORT);Ow.exports=function(t,r){if(Tn.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Tn.from(t):t;if(typeof t=="string")return Tn.from(t,r);if(Ew&&qK(t)){if(t.byteLength===0)return Tn.alloc(0);if(FK){var i=Tn.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}var n=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=Tn.from(n);if(o.length===t.byteLength)return o}if(UK&&t instanceof Uint8Array)return Tn.from(t);var a=DK(t);if(a)for(var s=0;s<t.length;s+=1){var u=t[s];if(typeof u!="number"||u<0||u>255||~~u!==u)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||Tn.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Tn.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var Tw=k((ale,Pw)=>{"use strict";v();var HK=nt().Buffer,jK=Oh(),Aw=typeof Uint8Array<"u",zK=Aw&&typeof ArrayBuffer<"u",Iw=zK&&ArrayBuffer.isView;Pw.exports=function(e,t){if(typeof e=="string"||HK.isBuffer(e)||Aw&&e instanceof Uint8Array||Iw&&Iw(e))return jK(e,t);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')}});var Ih=k((ule,cv)=>{"use strict";v();typeof A.default>"u"||!A.default.version||A.default.version.indexOf("v0.")===0||A.default.version.indexOf("v1.")===0&&A.default.version.indexOf("v1.8.")!==0?cv.exports={nextTick:KK}:cv.exports=A.default;function KK(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,a;switch(n){case 0:case 1:return A.default.nextTick(e);case 2:return A.default.nextTick(function(){e.call(null,t)});case 3:return A.default.nextTick(function(){e.call(null,t,r)});case 4:return A.default.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),a=0;a<o.length;)o[a++]=arguments[a];return A.default.nextTick(function(){e.apply(null,o)})}}});var Rw=k((cle,kw)=>{v();var VK={}.toString;kw.exports=Array.isArray||function(e){return VK.call(e)=="[object Array]"}});var lv=k((hle,Bw)=>{v();Bw.exports=tc().EventEmitter});var a2=k((hv,Nw)=>{v();var o2=Kt(),ca=o2.Buffer;function Mw(e,t){for(var r in e)t[r]=e[r]}ca.from&&ca.alloc&&ca.allocUnsafe&&ca.allocUnsafeSlow?Nw.exports=o2:(Mw(o2,hv),hv.Buffer=mc);function mc(e,t,r){return ca(e,t,r)}Mw(ca,mc);mc.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ca(e,t,r)};mc.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=ca(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};mc.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ca(e)};mc.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return o2.SlowBuffer(e)}});var yc=k(li=>{v();function GK(e){return Array.isArray?Array.isArray(e):s2(e)==="[object Array]"}li.isArray=GK;function ZK(e){return typeof e=="boolean"}li.isBoolean=ZK;function WK(e){return e===null}li.isNull=WK;function YK(e){return e==null}li.isNullOrUndefined=YK;function $K(e){return typeof e=="number"}li.isNumber=$K;function XK(e){return typeof e=="string"}li.isString=XK;function JK(e){return typeof e=="symbol"}li.isSymbol=JK;function QK(e){return e===void 0}li.isUndefined=QK;function eV(e){return s2(e)==="[object RegExp]"}li.isRegExp=eV;function tV(e){return typeof e=="object"&&e!==null}li.isObject=tV;function rV(e){return s2(e)==="[object Date]"}li.isDate=rV;function iV(e){return s2(e)==="[object Error]"||e instanceof Error}li.isError=iV;function nV(e){return typeof e=="function"}li.isFunction=nV;function oV(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}li.isPrimitive=oV;li.isBuffer=Kt().Buffer.isBuffer;function s2(e){return Object.prototype.toString.call(e)}});var Dw=k((mle,dv)=>{"use strict";v();function aV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Cw=a2().Buffer,Ah=rn();function sV(e,t,r){e.copy(t,r)}dv.exports=(function(){function e(){aV(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return Cw.alloc(0);for(var i=Cw.allocUnsafe(r>>>0),n=this.head,o=0;n;)sV(n.data,i,o),o+=n.data.length,n=n.next;return i},e})();Ah&&Ah.inspect&&Ah.inspect.custom&&(dv.exports.prototype[Ah.inspect.custom]=function(){var e=Ah.inspect({length:this.length});return this.constructor.name+" "+e})});var pv=k((ble,Lw)=>{"use strict";v();var u2=Ih();function uV(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u2.nextTick(f2,this,e)):u2.nextTick(f2,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,u2.nextTick(f2,r,o)):u2.nextTick(f2,r,o):t&&t(o)}),this)}function fV(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function f2(e,t){e.emit("error",t)}Lw.exports={destroy:uV,undestroy:fV}});var vv=k((wle,Vw)=>{"use strict";v();var Tu=Ih();Vw.exports=yr;function Uw(e){var t=this;this.next=null,this.entry=null,this.finish=function(){AV(t,e)}}var cV=!A.default.browser&&["v0.10","v0.9."].indexOf(A.default.version.slice(0,5))>-1?setImmediate:Tu.nextTick,bc;yr.WritableState=Th;var Fw=Object.create(yc());Fw.inherits=Ot();var lV={deprecate:qg()},Hw=lv(),l2=a2().Buffer,hV=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function dV(e){return l2.from(e)}function pV(e){return l2.isBuffer(e)||e instanceof hV}var jw=pv();Fw.inherits(yr,Hw);function gV(){}function Th(e,t){bc=bc||ku(),e=e||{};var r=t instanceof bc;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){SV(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Uw(this)}Th.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Th.prototype,"buffer",{get:lV.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var c2;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(c2=Function.prototype[Symbol.hasInstance],Object.defineProperty(yr,Symbol.hasInstance,{value:function(e){return c2.call(this,e)?!0:this!==yr?!1:e&&e._writableState instanceof Th}})):c2=function(e){return e instanceof this};function yr(e){if(bc=bc||ku(),!c2.call(yr,this)&&!(this instanceof bc))return new yr(e);this._writableState=new Th(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),Hw.call(this)}yr.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function vV(e,t){var r=new Error("write after end");e.emit("error",r),Tu.nextTick(t,r)}function mV(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),Tu.nextTick(i,o),n=!1),n}yr.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&pV(e);return o&&!l2.isBuffer(e)&&(e=dV(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=gV),i.ended?vV(this,r):(o||mV(this,i,e,r))&&(i.pendingcb++,n=bV(this,i,o,e,t,r)),n};yr.prototype.cork=function(){var e=this._writableState;e.corked++};yr.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&zw(this,e))};yr.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function yV(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=l2.from(t,r)),t}Object.defineProperty(yr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function bV(e,t,r,i,n,o){if(!r){var a=yV(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else gv(e,t,!1,s,i,n,o);return u}function gv(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function _V(e,t,r,i,n){--t.pendingcb,r?(Tu.nextTick(n,i),Tu.nextTick(Ph,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),Ph(e,t))}function wV(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function SV(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(wV(r),t)_V(e,r,i,t,n);else{var o=Kw(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&zw(e,r),i?cV(qw,e,r,o,n):qw(e,r,o,n)}}function qw(e,t,r,i){r||xV(e,t),t.pendingcb--,i(),Ph(e,t)}function xV(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function zw(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,gv(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new Uw(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,m=t.objectMode?1:u.length;if(gv(e,t,!1,m,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}yr.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};yr.prototype._writev=null;yr.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||IV(this,i,r)};function Kw(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function EV(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),Ph(e,t)})}function OV(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Tu.nextTick(EV,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Ph(e,t){var r=Kw(t);return r&&(OV(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function IV(e,t,r){t.ending=!0,Ph(e,t),r&&(t.finished?Tu.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function AV(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(yr.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});yr.prototype.destroy=jw.destroy;yr.prototype._undestroy=jw.undestroy;yr.prototype._destroy=function(e,t){this.end(),t(e)}});var ku=k((xle,Yw)=>{"use strict";v();var Gw=Ih(),PV=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Yw.exports=la;var Zw=Object.create(yc());Zw.inherits=Ot();var Ww=bv(),yv=vv();Zw.inherits(la,Ww);for(mv=PV(yv.prototype),h2=0;h2<mv.length;h2++)d2=mv[h2],la.prototype[d2]||(la.prototype[d2]=yv.prototype[d2]);var mv,d2,h2;function la(e){if(!(this instanceof la))return new la(e);Ww.call(this,e),yv.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",TV)}Object.defineProperty(la.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function TV(){this.allowHalfOpen||this._writableState.ended||Gw.nextTick(kV,this)}function kV(e){e.end()}Object.defineProperty(la.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});la.prototype._destroy=function(e,t){this.push(null),this.end(),Gw.nextTick(t,e)}});var bv=k((Ile,sS)=>{"use strict";v();var wc=Ih();sS.exports=Wt;var RV=Rw(),kh;Wt.ReadableState=rS;var Ole=tc().EventEmitter,Qw=function(e,t){return e.listeners(t).length},Ev=lv(),Rh=a2().Buffer,BV=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function MV(e){return Rh.from(e)}function NV(e){return Rh.isBuffer(e)||e instanceof BV}var eS=Object.create(yc());eS.inherits=Ot();var _v=rn(),Tt=void 0;_v&&_v.debuglog?Tt=_v.debuglog("stream"):Tt=function(){};var CV=Dw(),tS=pv(),_c;eS.inherits(Wt,Ev);var wv=["error","close","destroy","pause","resume"];function DV(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):RV(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function rS(e,t){kh=kh||ku(),e=e||{};var r=t instanceof kh;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new CV,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(_c||(_c=pc().StringDecoder),this.decoder=new _c(e.encoding),this.encoding=e.encoding)}function Wt(e){if(kh=kh||ku(),!(this instanceof Wt))return new Wt(e);this._readableState=new rS(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Ev.call(this)}Object.defineProperty(Wt.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Wt.prototype.destroy=tS.destroy;Wt.prototype._undestroy=tS.undestroy;Wt.prototype._destroy=function(e,t){this.push(null),t(e)};Wt.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Rh.from(e,t),t=""),i=!0),iS(this,e,t,!1,i)};Wt.prototype.unshift=function(e){return iS(this,e,null,!0,!1)};function iS(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,FV(e,o);else{var a;n||(a=LV(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Rh.prototype&&(t=MV(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Sv(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?Sv(e,o,t,!1):nS(e,o)):Sv(e,o,t,!1))):i||(o.reading=!1)}return qV(o)}function Sv(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&p2(e)),nS(e,t)}function LV(e,t){var r;return!NV(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function qV(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}Wt.prototype.isPaused=function(){return this._readableState.flowing===!1};Wt.prototype.setEncoding=function(e){return _c||(_c=pc().StringDecoder),this._readableState.decoder=new _c(e),this._readableState.encoding=e,this};var $w=8388608;function UV(e){return e>=$w?e=$w:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Xw(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=UV(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Wt.prototype.read=function(e){Tt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Tt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?xv(this):p2(this),null;if(e=Xw(e,t),e===0&&t.ended)return t.length===0&&xv(this),null;var i=t.needReadable;Tt("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,Tt("length less than watermark",i)),t.ended||t.reading?(i=!1,Tt("reading or ended",i)):i&&(Tt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Xw(r,t)));var n;return e>0?n=oS(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&xv(this)),n!==null&&this.emit("data",n),n};function FV(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,p2(e)}}function p2(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Tt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?wc.nextTick(Jw,e):Jw(e))}function Jw(e){Tt("emit readable"),e.emit("readable"),Ov(e)}function nS(e,t){t.readingMore||(t.readingMore=!0,wc.nextTick(HV,e,t))}function HV(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Tt("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}Wt.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};Wt.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,Tt("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==A.default.stdout&&e!==A.default.stderr,o=n?s:D;i.endEmitted?wc.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(L,U){Tt("onunpipe"),L===r&&U&&U.hasUnpiped===!1&&(U.hasUnpiped=!0,l())}function s(){Tt("onend"),e.end()}var u=jV(r);e.on("drain",u);var c=!1;function l(){Tt("cleanup"),e.removeListener("close",P),e.removeListener("finish",M),e.removeListener("drain",u),e.removeListener("error",E),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",D),r.removeListener("data",w),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}var m=!1;r.on("data",w);function w(L){Tt("ondata"),m=!1;var U=e.write(L);U===!1&&!m&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&aS(i.pipes,e)!==-1)&&!c&&(Tt("false write response, pause",i.awaitDrain),i.awaitDrain++,m=!0),r.pause())}function E(L){Tt("onerror",L),D(),e.removeListener("error",E),Qw(e,"error")===0&&e.emit("error",L)}DV(e,"error",E);function P(){e.removeListener("finish",M),D()}e.once("close",P);function M(){Tt("onfinish"),e.removeListener("close",P),D()}e.once("finish",M);function D(){Tt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(Tt("pipe resume"),r.resume()),e};function jV(e){return function(){var t=e._readableState;Tt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Qw(e,"data")&&(t.flowing=!0,Ov(e))}}Wt.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=aS(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Wt.prototype.on=function(e,t){var r=Ev.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&p2(this):wc.nextTick(zV,this))}return r};Wt.prototype.addListener=Wt.prototype.on;function zV(e){Tt("readable nexttick read 0"),e.read(0)}Wt.prototype.resume=function(){var e=this._readableState;return e.flowing||(Tt("resume"),e.flowing=!0,KV(this,e)),this};function KV(e,t){t.resumeScheduled||(t.resumeScheduled=!0,wc.nextTick(VV,e,t))}function VV(e,t){t.reading||(Tt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Ov(e),t.flowing&&!t.reading&&e.read(0)}Wt.prototype.pause=function(){return Tt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Tt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ov(e){var t=e._readableState;for(Tt("flow",t.flowing);t.flowing&&e.read()!==null;);}Wt.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(Tt("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(Tt("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(a){return function(){return e[a].apply(e,arguments)}})(n));for(var o=0;o<wv.length;o++)e.on(wv[o],this.emit.bind(this,wv[o]));return this._read=function(a){Tt("wrapped _read",a),i&&(i=!1,e.resume())},this};Object.defineProperty(Wt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Wt._fromList=oS;function oS(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=GV(e,t.buffer,t.decoder),r}function GV(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?ZV(e,t):WV(e,t),i}function ZV(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?n+=o:n+=o.slice(0,e),e-=a,e===0){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function WV(e,t){var r=Rh.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(a));break}++n}return t.length-=n,r}function xv(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,wc.nextTick(YV,t,e))}function YV(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function aS(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var Iv=k((Ple,cS)=>{"use strict";v();cS.exports=ha;var g2=ku(),fS=Object.create(yc());fS.inherits=Ot();fS.inherits(ha,g2);function $V(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function ha(e){if(!(this instanceof ha))return new ha(e);g2.call(this,e),this._transformState={afterTransform:$V.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",XV)}function XV(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){uS(e,t,r)}):uS(this,null,null)}ha.prototype.push=function(e,t){return this._transformState.needTransform=!1,g2.prototype.push.call(this,e,t)};ha.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};ha.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};ha.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ha.prototype._destroy=function(e,t){var r=this;g2.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function uS(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var pS=k((kle,dS)=>{"use strict";v();dS.exports=Bh;var lS=Iv(),hS=Object.create(yc());hS.inherits=Ot();hS.inherits(Bh,lS);function Bh(e){if(!(this instanceof Bh))return new Bh(e);lS.call(this,e)}Bh.prototype._transform=function(e,t,r){r(null,e)}});var vS=k((_o,gS)=>{v();_o=gS.exports=bv();_o.Stream=_o;_o.Readable=_o;_o.Writable=vv();_o.Duplex=ku();_o.Transform=Iv();_o.PassThrough=pS()});var bS=k((Mle,yS)=>{"use strict";v();var JV=nt().Buffer,QV=Tw(),mS=vS().Transform,eG=fv();function us(e){mS.call(this),this._block=JV.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}eG(us,mS);us.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(n){i=n}r(i)};us.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};us.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");for(var r=QV(e,t),i=this._block,n=0;this._blockOffset+r.length-n>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)i[o]=r[n],o+=1,n+=1;this._update(),this._blockOffset=0}for(;n<r.length;)i[this._blockOffset]=r[n],this._blockOffset+=1,n+=1;for(var a=0,s=r.length*8;s>0;++a)this._length[a]+=s,s=this._length[a]/4294967296|0,s>0&&(this._length[a]-=4294967296*s);return this};us.prototype._update=function(){throw new Error("_update is not implemented")};us.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};us.prototype._digest=function(){throw new Error("_digest is not implemented")};yS.exports=us});var m2=k((Cle,IS)=>{"use strict";v();var Av=Kt().Buffer,tG=fv(),OS=bS(),rG=new Array(16),Mh=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Nh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ch=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Dh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Lh=[0,1518500249,1859775393,2400959708,2840853838],qh=[1352829926,1548603684,1836072691,2053994217,0];function Ru(e,t){return e<<t|e>>>32-t}function _S(e,t,r,i,n,o,a,s){return Ru(e+(t^r^i)+o+a|0,s)+n|0}function wS(e,t,r,i,n,o,a,s){return Ru(e+(t&r|~t&i)+o+a|0,s)+n|0}function SS(e,t,r,i,n,o,a,s){return Ru(e+((t|~r)^i)+o+a|0,s)+n|0}function xS(e,t,r,i,n,o,a,s){return Ru(e+(t&i|r&~i)+o+a|0,s)+n|0}function ES(e,t,r,i,n,o,a,s){return Ru(e+(t^(r|~i))+o+a|0,s)+n|0}function v2(){OS.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}tG(v2,OS);v2.prototype._update=function(){for(var e=rG,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=this._a|0,u=this._b|0,c=this._c|0,l=this._d|0,m=this._e|0,w=0;w<80;w+=1){var E,P;w<16?(E=_S(r,i,n,o,a,e[Mh[w]],Lh[0],Ch[w]),P=ES(s,u,c,l,m,e[Nh[w]],qh[0],Dh[w])):w<32?(E=wS(r,i,n,o,a,e[Mh[w]],Lh[1],Ch[w]),P=xS(s,u,c,l,m,e[Nh[w]],qh[1],Dh[w])):w<48?(E=SS(r,i,n,o,a,e[Mh[w]],Lh[2],Ch[w]),P=SS(s,u,c,l,m,e[Nh[w]],qh[2],Dh[w])):w<64?(E=xS(r,i,n,o,a,e[Mh[w]],Lh[3],Ch[w]),P=wS(s,u,c,l,m,e[Nh[w]],qh[3],Dh[w])):(E=ES(r,i,n,o,a,e[Mh[w]],Lh[4],Ch[w]),P=_S(s,u,c,l,m,e[Nh[w]],qh[4],Dh[w])),r=a,a=o,o=Ru(n,10),n=i,i=E,s=m,m=l,l=Ru(c,10),c=u,u=P}var M=this._b+n+l|0;this._b=this._c+o+m|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=M};v2.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Av.alloc?Av.alloc(20):new Av(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};IS.exports=v2});var Bu=k((Lle,Pv)=>{v();typeof Object.create=="function"?Pv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Pv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var Mu=k((Ule,AS)=>{"use strict";v();var iG=nt().Buffer,nG=Oh();function y2(e,t){this._block=iG.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}y2.prototype.update=function(e,t){e=nG(e,t||"utf8");for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,a=0;a<n;){for(var s=o%i,u=Math.min(n-a,i-s),c=0;c<u;c++)r[s+c]=e[a+c];o+=u,a+=u,o%i===0&&this._update(r)}return this._len+=n,this};y2.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o};y2.prototype._update=function(){throw new Error("_update must be implemented by subclass")};AS.exports=y2});var kS=k((Hle,TS)=>{"use strict";v();var oG=Bu(),PS=Mu(),aG=nt().Buffer,sG=[1518500249,1859775393,-1894007588,-899497514],uG=new Array(80);function Uh(){this.init(),this._w=uG,PS.call(this,64,56)}oG(Uh,PS);Uh.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function fG(e){return e<<5|e>>>27}function cG(e){return e<<30|e>>>2}function lG(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Uh.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var u=0;u<80;++u){var c=~~(u/20),l=fG(r)+lG(c,i,n,o)+a+t[u]+sG[c]|0;a=o,o=n,n=cG(i),i=r,r=l}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};Uh.prototype._hash=function(){var e=aG.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};TS.exports=Uh});var MS=k((zle,BS)=>{"use strict";v();var hG=Bu(),RS=Mu(),dG=nt().Buffer,pG=[1518500249,1859775393,-1894007588,-899497514],gG=new Array(80);function Fh(){this.init(),this._w=gG,RS.call(this,64,56)}hG(Fh,RS);Fh.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vG(e){return e<<1|e>>>31}function mG(e){return e<<5|e>>>27}function yG(e){return e<<30|e>>>2}function bG(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Fh.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=vG(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var u=0;u<80;++u){var c=~~(u/20),l=mG(r)+bG(c,i,n,o)+a+t[u]+pG[c]|0;a=o,o=n,n=yG(i),i=r,r=l}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};Fh.prototype._hash=function(){var e=dG.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};BS.exports=Fh});var Tv=k((Vle,CS)=>{"use strict";v();var _G=Bu(),NS=Mu(),wG=nt().Buffer,SG=[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],xG=new Array(64);function Hh(){this.init(),this._w=xG,NS.call(this,64,56)}_G(Hh,NS);Hh.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function EG(e,t,r){return r^e&(t^r)}function OG(e,t,r){return e&t|r&(e|t)}function IG(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function AG(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function PG(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function TG(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Hh.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=this._f|0,u=this._g|0,c=this._h|0,l=0;l<16;++l)t[l]=e.readInt32BE(l*4);for(;l<64;++l)t[l]=TG(t[l-2])+t[l-7]+PG(t[l-15])+t[l-16]|0;for(var m=0;m<64;++m){var w=c+AG(a)+EG(a,s,u)+SG[m]+t[m]|0,E=IG(r)+OG(r,i,n)|0;c=u,u=s,s=a,a=o+w|0,o=n,n=i,i=r,r=w+E|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0};Hh.prototype._hash=function(){var e=wG.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};CS.exports=Hh});var LS=k((Zle,DS)=>{"use strict";v();var kG=Bu(),RG=Tv(),BG=Mu(),MG=nt().Buffer,NG=new Array(64);function b2(){this.init(),this._w=NG,BG.call(this,64,56)}kG(b2,RG);b2.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};b2.prototype._hash=function(){var e=MG.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};DS.exports=b2});var kv=k((Yle,KS)=>{"use strict";v();var CG=Bu(),zS=Mu(),DG=nt().Buffer,qS=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],LG=new Array(160);function jh(){this.init(),this._w=LG,zS.call(this,128,112)}CG(jh,zS);jh.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function US(e,t,r){return r^e&(t^r)}function FS(e,t,r){return e&t|r&(e|t)}function HS(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function jS(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function qG(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function UG(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function FG(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function HG(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function zr(e,t){return e>>>0<t>>>0?1:0}jh.prototype._update=function(e){for(var t=this._w,r=this._ah|0,i=this._bh|0,n=this._ch|0,o=this._dh|0,a=this._eh|0,s=this._fh|0,u=this._gh|0,c=this._hh|0,l=this._al|0,m=this._bl|0,w=this._cl|0,E=this._dl|0,P=this._el|0,M=this._fl|0,D=this._gl|0,L=this._hl|0,U=0;U<32;U+=2)t[U]=e.readInt32BE(U*4),t[U+1]=e.readInt32BE(U*4+4);for(;U<160;U+=2){var K=t[U-30],N=t[U-30+1],C=qG(K,N),F=UG(N,K);K=t[U-4],N=t[U-4+1];var H=FG(K,N),z=HG(N,K),G=t[U-14],B=t[U-14+1],g=t[U-32],O=t[U-32+1],y=F+B|0,f=C+G+zr(y,F)|0;y=y+z|0,f=f+H+zr(y,z)|0,y=y+O|0,f=f+g+zr(y,O)|0,t[U]=f,t[U+1]=y}for(var d=0;d<160;d+=2){f=t[d],y=t[d+1];var _=FS(r,i,n),x=FS(l,m,w),b=HS(r,l),p=HS(l,r),I=jS(a,P),T=jS(P,a),S=qS[d],R=qS[d+1],Y=US(a,s,u),X=US(P,M,D),ne=L+T|0,ce=c+I+zr(ne,L)|0;ne=ne+X|0,ce=ce+Y+zr(ne,X)|0,ne=ne+R|0,ce=ce+S+zr(ne,R)|0,ne=ne+y|0,ce=ce+f+zr(ne,y)|0;var pe=p+x|0,q=b+_+zr(pe,p)|0;c=u,L=D,u=s,D=M,s=a,M=P,P=E+ne|0,a=o+ce+zr(P,E)|0,o=n,E=w,n=i,w=m,i=r,m=l,l=ne+pe|0,r=ce+q+zr(l,ne)|0}this._al=this._al+l|0,this._bl=this._bl+m|0,this._cl=this._cl+w|0,this._dl=this._dl+E|0,this._el=this._el+P|0,this._fl=this._fl+M|0,this._gl=this._gl+D|0,this._hl=this._hl+L|0,this._ah=this._ah+r+zr(this._al,l)|0,this._bh=this._bh+i+zr(this._bl,m)|0,this._ch=this._ch+n+zr(this._cl,w)|0,this._dh=this._dh+o+zr(this._dl,E)|0,this._eh=this._eh+a+zr(this._el,P)|0,this._fh=this._fh+s+zr(this._fl,M)|0,this._gh=this._gh+u+zr(this._gl,D)|0,this._hh=this._hh+c+zr(this._hl,L)|0};jh.prototype._hash=function(){var e=DG.allocUnsafe(64);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};KS.exports=jh});var GS=k((Xle,VS)=>{"use strict";v();var jG=Bu(),zG=kv(),KG=Mu(),VG=nt().Buffer,GG=new Array(160);function _2(){this.init(),this._w=GG,KG.call(this,128,112)}jG(_2,zG);_2.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};_2.prototype._hash=function(){var e=VG.allocUnsafe(48);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};VS.exports=_2});var w2=k((Qle,da)=>{"use strict";v();da.exports=function(t){var r=t.toLowerCase(),i=da.exports[r];if(!i)throw new Error(r+" is not supported (we accept pull requests)");return new i};da.exports.sha=kS();da.exports.sha1=MS();da.exports.sha224=LS();da.exports.sha256=Tv();da.exports.sha384=GS();da.exports.sha512=kv()});var ZS=k((the,Rv)=>{v();typeof Object.create=="function"?Rv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Rv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var pa=k((ihe,YS)=>{"use strict";v();var ZG=nt().Buffer,WS=t2().Transform,WG=pc().StringDecoder,YG=ZS(),$G=Oh();function kn(e){WS.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}YG(kn,WS);kn.prototype.update=function(e,t,r){var i=$G(e,t),n=this._update(i);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)};kn.prototype.setAutoPadding=function(){};kn.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};kn.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};kn.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};kn.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(n){i=n}finally{r(i)}};kn.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};kn.prototype._finalOrDigest=function(e){var t=this.__final()||ZG.alloc(0);return e&&(t=this._toString(t,e,!0)),t};kn.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new WG(t),this._encoding=t),this._encoding!==t)throw new Error("can\u2019t switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i};YS.exports=kn});var zh=k((ohe,XS)=>{"use strict";v();var XG=Ot(),JG=n2(),QG=m2(),eZ=w2(),$S=pa();function S2(e){$S.call(this,"digest"),this._hash=e}XG(S2,$S);S2.prototype._update=function(e){this._hash.update(e)};S2.prototype._final=function(){return this._hash.digest()};XS.exports=function(t){return t=t.toLowerCase(),t==="md5"?new JG:t==="rmd160"||t==="ripemd160"?new QG:new S2(eZ(t))}});var ex=k((she,QS)=>{"use strict";v();var tZ=Ot(),Nu=nt().Buffer,JS=pa(),rZ=Nu.alloc(128),Sc=64;function x2(e,t){JS.call(this,"digest"),typeof t=="string"&&(t=Nu.from(t)),this._alg=e,this._key=t,t.length>Sc?t=e(t):t.length<Sc&&(t=Nu.concat([t,rZ],Sc));for(var r=this._ipad=Nu.allocUnsafe(Sc),i=this._opad=Nu.allocUnsafe(Sc),n=0;n<Sc;n++)r[n]=t[n]^54,i[n]=t[n]^92;this._hash=[r]}tZ(x2,JS);x2.prototype._update=function(e){this._hash.push(e)};x2.prototype._final=function(){var e=this._alg(Nu.concat(this._hash));return this._alg(Nu.concat([this._opad,e]))};QS.exports=x2});var Bv=k((fhe,tx)=>{v();var iZ=n2();tx.exports=function(e){return new iZ().update(e).digest()}});var nx=k((lhe,ix)=>{"use strict";v();var nZ=Ot(),oZ=ex(),rx=pa(),Kh=nt().Buffer,aZ=Bv(),Mv=m2(),Nv=w2(),sZ=Kh.alloc(128);function Vh(e,t){rx.call(this,"digest"),typeof t=="string"&&(t=Kh.from(t));var r=e==="sha512"||e==="sha384"?128:64;if(this._alg=e,this._key=t,t.length>r){var i=e==="rmd160"?new Mv:Nv(e);t=i.update(t).digest()}else t.length<r&&(t=Kh.concat([t,sZ],r));for(var n=this._ipad=Kh.allocUnsafe(r),o=this._opad=Kh.allocUnsafe(r),a=0;a<r;a++)n[a]=t[a]^54,o[a]=t[a]^92;this._hash=e==="rmd160"?new Mv:Nv(e),this._hash.update(n)}nZ(Vh,rx);Vh.prototype._update=function(e){this._hash.update(e)};Vh.prototype._final=function(){var e=this._hash.digest(),t=this._alg==="rmd160"?new Mv:Nv(this._alg);return t.update(this._opad).update(e).digest()};ix.exports=function(t,r){return t=t.toLowerCase(),t==="rmd160"||t==="ripemd160"?new Vh("rmd160",r):t==="md5"?new oZ(aZ,r):new Vh(t,r)}});var fs=k((dhe,ox)=>{"use strict";v();ox.exports={}});var Cv=k((ghe,ax)=>{"use strict";v();var uZ=isFinite,fZ=Math.pow(2,30)-1;ax.exports=function(e,t){if(typeof e!="number")throw new TypeError("Iterations not a number");if(e<0||!uZ(e))throw new TypeError("Bad iterations");if(typeof t!="number")throw new TypeError("Key length not a number");if(t<0||t>fZ||t!==t)throw new TypeError("Bad key length")}});var Dv=k((mhe,ux)=>{"use strict";v();var E2;globalThis.process&&globalThis.process.browser?E2="utf-8":globalThis.process&&globalThis.process.version?(sx=parseInt(A.default.version.split(".")[0].slice(1),10),E2=sx>=6?"utf-8":"binary"):E2="utf-8";var sx;ux.exports=E2});var Lv=k((bhe,lx)=>{"use strict";v();var cZ=nt().Buffer,lZ=Oh(),cx=typeof Uint8Array<"u",hZ=cx&&typeof ArrayBuffer<"u",fx=hZ&&ArrayBuffer.isView;lx.exports=function(e,t,r){if(typeof e=="string"||cZ.isBuffer(e)||cx&&e instanceof Uint8Array||fx&&fx(e))return lZ(e,t);throw new TypeError(r+" must be a string, a Buffer, a Uint8Array, or a DataView")}});var qv=k((whe,gx)=>{"use strict";v();var dZ=Bv(),pZ=m2(),gZ=w2(),Cu=nt().Buffer,vZ=Cv(),hx=Dv(),dx=Lv(),mZ=Cu.alloc(128),O2={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},yZ={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function bZ(e){return new pZ().update(e).digest()}function _Z(e){function t(r){return gZ(e).update(r).digest()}return e==="rmd160"||e==="ripemd160"?bZ:e==="md5"?dZ:t}function px(e,t,r){var i=_Z(e),n=e==="sha512"||e==="sha384"?128:64;t.length>n?t=i(t):t.length<n&&(t=Cu.concat([t,mZ],n));for(var o=Cu.allocUnsafe(n+O2[e]),a=Cu.allocUnsafe(n+O2[e]),s=0;s<n;s++)o[s]=t[s]^54,a[s]=t[s]^92;var u=Cu.allocUnsafe(n+r+4);o.copy(u,0,0,n),this.ipad1=u,this.ipad2=o,this.opad=a,this.alg=e,this.blocksize=n,this.hash=i,this.size=O2[e]}px.prototype.run=function(e,t){e.copy(t,this.blocksize);var r=this.hash(t);return r.copy(this.opad,this.blocksize),this.hash(this.opad)};function wZ(e,t,r,i,n){vZ(r,i),e=dx(e,hx,"Password"),t=dx(t,hx,"Salt");var o=(n||"sha1").toLowerCase(),a=yZ[o]||o,s=O2[a];if(typeof s!="number"||!s)throw new TypeError("Digest algorithm not supported: "+n);var u=new px(a,e,t.length),c=Cu.allocUnsafe(i),l=Cu.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);for(var m=0,w=s,E=Math.ceil(i/w),P=1;P<=E;P++){l.writeUInt32BE(P,t.length);for(var M=u.run(l,u.ipad1),D=M,L=1;L<r;L++){D=u.run(D,u.ipad2);for(var U=0;U<w;U++)M[U]^=D[U]}M.copy(c,m),m+=w}return c}gx.exports=wZ});var Sx=k((xhe,wx)=>{"use strict";v();var bx=nt().Buffer,SZ=Cv(),vx=Dv(),mx=qv(),yx=Lv(),I2,Gh=globalThis.crypto&&globalThis.crypto.subtle,xZ={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},Uv=[],Du;function Fv(){return Du||(globalThis.process&&globalThis.process.nextTick?Du=globalThis.process.nextTick:globalThis.queueMicrotask?Du=globalThis.queueMicrotask:globalThis.setImmediate?Du=globalThis.setImmediate:Du=globalThis.setTimeout,Du)}function _x(e,t,r,i,n){return Gh.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(o){return Gh.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:n}},o,i<<3)}).then(function(o){return bx.from(o)})}function EZ(e){if(globalThis.process&&!globalThis.process.browser||!Gh||!Gh.importKey||!Gh.deriveBits)return Promise.resolve(!1);if(Uv[e]!==void 0)return Uv[e];I2=I2||bx.alloc(8);var t=_x(I2,I2,10,128,e).then(function(){return!0},function(){return!1});return Uv[e]=t,t}function OZ(e,t){e.then(function(r){Fv()(function(){t(null,r)})},function(r){Fv()(function(){t(r)})})}wx.exports=function(e,t,r,i,n,o){if(typeof n=="function"&&(o=n,n=void 0),SZ(r,i),e=yx(e,vx,"Password"),t=yx(t,vx,"Salt"),typeof o!="function")throw new Error("No callback provided to pbkdf2");n=n||"sha1";var a=xZ[n.toLowerCase()];if(!a||typeof globalThis.Promise!="function"){Fv()(function(){var s;try{s=mx(e,t,r,i,n)}catch(u){o(u);return}o(null,s)});return}OZ(EZ(a).then(function(s){return s?_x(e,t,r,i,a):mx(e,t,r,i,n)}),o)}});var jv=k(Hv=>{"use strict";v();Hv.pbkdf2=Sx();Hv.pbkdf2Sync=qv()});var zv=k(an=>{"use strict";v();an.readUInt32BE=function(t,r){var i=t[0+r]<<24|t[1+r]<<16|t[2+r]<<8|t[3+r];return i>>>0};an.writeUInt32BE=function(t,r,i){t[0+i]=r>>>24,t[1+i]=r>>>16&255,t[2+i]=r>>>8&255,t[3+i]=r&255};an.ip=function(t,r,i,n){for(var o=0,a=0,s=6;s>=0;s-=2){for(var u=0;u<=24;u+=8)o<<=1,o|=r>>>u+s&1;for(var u=0;u<=24;u+=8)o<<=1,o|=t>>>u+s&1}for(var s=6;s>=0;s-=2){for(var u=1;u<=25;u+=8)a<<=1,a|=r>>>u+s&1;for(var u=1;u<=25;u+=8)a<<=1,a|=t>>>u+s&1}i[n+0]=o>>>0,i[n+1]=a>>>0};an.rip=function(t,r,i,n){for(var o=0,a=0,s=0;s<4;s++)for(var u=24;u>=0;u-=8)o<<=1,o|=r>>>u+s&1,o<<=1,o|=t>>>u+s&1;for(var s=4;s<8;s++)for(var u=24;u>=0;u-=8)a<<=1,a|=r>>>u+s&1,a<<=1,a|=t>>>u+s&1;i[n+0]=o>>>0,i[n+1]=a>>>0};an.pc1=function(t,r,i,n){for(var o=0,a=0,s=7;s>=5;s--){for(var u=0;u<=24;u+=8)o<<=1,o|=r>>u+s&1;for(var u=0;u<=24;u+=8)o<<=1,o|=t>>u+s&1}for(var u=0;u<=24;u+=8)o<<=1,o|=r>>u+s&1;for(var s=1;s<=3;s++){for(var u=0;u<=24;u+=8)a<<=1,a|=r>>u+s&1;for(var u=0;u<=24;u+=8)a<<=1,a|=t>>u+s&1}for(var u=0;u<=24;u+=8)a<<=1,a|=t>>u+s&1;i[n+0]=o>>>0,i[n+1]=a>>>0};an.r28shl=function(t,r){return t<<r&268435455|t>>>28-r};var A2=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];an.pc2=function(t,r,i,n){for(var o=0,a=0,s=A2.length>>>1,u=0;u<s;u++)o<<=1,o|=t>>>A2[u]&1;for(var u=s;u<A2.length;u++)a<<=1,a|=r>>>A2[u]&1;i[n+0]=o>>>0,i[n+1]=a>>>0};an.expand=function(t,r,i){var n=0,o=0;n=(t&1)<<5|t>>>27;for(var a=23;a>=15;a-=4)n<<=6,n|=t>>>a&63;for(var a=11;a>=3;a-=4)o|=t>>>a&63,o<<=6;o|=(t&31)<<1|t>>>31,r[i+0]=n>>>0,r[i+1]=o>>>0};var xx=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];an.substitute=function(t,r){for(var i=0,n=0;n<4;n++){var o=t>>>18-n*6&63,a=xx[n*64+o];i<<=4,i|=a}for(var n=0;n<4;n++){var o=r>>>18-n*6&63,a=xx[256+n*64+o];i<<=4,i|=a}return i>>>0};var Ex=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];an.permute=function(t){for(var r=0,i=0;i<Ex.length;i++)r<<=1,r|=t>>>Ex[i]&1;return r>>>0};an.padSplit=function(t,r,i){for(var n=t.toString(2);n.length<r;)n="0"+n;for(var o=[],a=0;a<r;a+=i)o.push(n.slice(a,a+i));return o.join(" ")}});var Rn=k((The,Ix)=>{v();Ix.exports=Ox;function Ox(e,t){if(!e)throw new Error(t||"Assertion failed")}Ox.equal=function(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)}});var P2=k((Rhe,Ax)=>{"use strict";v();var IZ=Rn();function sn(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=e.padding!==!1}Ax.exports=sn;sn.prototype._init=function(){};sn.prototype.update=function(t){return t.length===0?[]:this.type==="decrypt"?this._updateDecrypt(t):this._updateEncrypt(t)};sn.prototype._buffer=function(t,r){for(var i=Math.min(this.buffer.length-this.bufferOff,t.length-r),n=0;n<i;n++)this.buffer[this.bufferOff+n]=t[r+n];return this.bufferOff+=i,i};sn.prototype._flushBuffer=function(t,r){return this._update(this.buffer,0,t,r),this.bufferOff=0,this.blockSize};sn.prototype._updateEncrypt=function(t){var r=0,i=0,n=(this.bufferOff+t.length)/this.blockSize|0,o=new Array(n*this.blockSize);this.bufferOff!==0&&(r+=this._buffer(t,r),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(o,i)));for(var a=t.length-(t.length-r)%this.blockSize;r<a;r+=this.blockSize)this._update(t,r,o,i),i+=this.blockSize;for(;r<t.length;r++,this.bufferOff++)this.buffer[this.bufferOff]=t[r];return o};sn.prototype._updateDecrypt=function(t){for(var r=0,i=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,o=new Array(n*this.blockSize);n>0;n--)r+=this._buffer(t,r),i+=this._flushBuffer(o,i);return r+=this._buffer(t,r),o};sn.prototype.final=function(t){var r;t&&(r=this.update(t));var i;return this.type==="encrypt"?i=this._finalEncrypt():i=this._finalDecrypt(),r?r.concat(i):i};sn.prototype._pad=function(t,r){if(r===0)return!1;for(;r<t.length;)t[r++]=0;return!0};sn.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t};sn.prototype._unpad=function(t){return t};sn.prototype._finalDecrypt=function(){IZ.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}});var Kv=k((Mhe,kx)=>{"use strict";v();var Px=Rn(),AZ=Ot(),Rr=zv(),Tx=P2();function PZ(){this.tmp=new Array(2),this.keys=null}function wo(e){Tx.call(this,e);var t=new PZ;this._desState=t,this.deriveKeys(t,e.key)}AZ(wo,Tx);kx.exports=wo;wo.create=function(t){return new wo(t)};var TZ=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];wo.prototype.deriveKeys=function(t,r){t.keys=new Array(32),Px.equal(r.length,this.blockSize,"Invalid key length");var i=Rr.readUInt32BE(r,0),n=Rr.readUInt32BE(r,4);Rr.pc1(i,n,t.tmp,0),i=t.tmp[0],n=t.tmp[1];for(var o=0;o<t.keys.length;o+=2){var a=TZ[o>>>1];i=Rr.r28shl(i,a),n=Rr.r28shl(n,a),Rr.pc2(i,n,t.keys,o)}};wo.prototype._update=function(t,r,i,n){var o=this._desState,a=Rr.readUInt32BE(t,r),s=Rr.readUInt32BE(t,r+4);Rr.ip(a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],this.type==="encrypt"?this._encrypt(o,a,s,o.tmp,0):this._decrypt(o,a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],Rr.writeUInt32BE(i,a,n),Rr.writeUInt32BE(i,s,n+4)};wo.prototype._pad=function(t,r){if(this.padding===!1)return!1;for(var i=t.length-r,n=r;n<t.length;n++)t[n]=i;return!0};wo.prototype._unpad=function(t){if(this.padding===!1)return t;for(var r=t[t.length-1],i=t.length-r;i<t.length;i++)Px.equal(t[i],r);return t.slice(0,t.length-r)};wo.prototype._encrypt=function(t,r,i,n,o){for(var a=r,s=i,u=0;u<t.keys.length;u+=2){var c=t.keys[u],l=t.keys[u+1];Rr.expand(s,t.tmp,0),c^=t.tmp[0],l^=t.tmp[1];var m=Rr.substitute(c,l),w=Rr.permute(m),E=s;s=(a^w)>>>0,a=E}Rr.rip(s,a,n,o)};wo.prototype._decrypt=function(t,r,i,n,o){for(var a=i,s=r,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],l=t.keys[u+1];Rr.expand(a,t.tmp,0),c^=t.tmp[0],l^=t.tmp[1];var m=Rr.substitute(c,l),w=Rr.permute(m),E=a;a=(s^w)>>>0,s=E}Rr.rip(a,s,n,o)}});var Bx=k(Rx=>{"use strict";v();var kZ=Rn(),RZ=Ot(),T2={};function BZ(e){kZ.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}function MZ(e){function t(o){e.call(this,o),this._cbcInit()}RZ(t,e);for(var r=Object.keys(T2),i=0;i<r.length;i++){var n=r[i];t.prototype[n]=T2[n]}return t.create=function(a){return new t(a)},t}Rx.instantiate=MZ;T2._cbcInit=function(){var t=new BZ(this.options.iv);this._cbcState=t};T2._update=function(t,r,i,n){var o=this._cbcState,a=this.constructor.super_.prototype,s=o.iv;if(this.type==="encrypt"){for(var u=0;u<this.blockSize;u++)s[u]^=t[r+u];a._update.call(this,s,0,i,n);for(var u=0;u<this.blockSize;u++)s[u]=i[n+u]}else{a._update.call(this,t,r,i,n);for(var u=0;u<this.blockSize;u++)i[n+u]^=s[u];for(var u=0;u<this.blockSize;u++)s[u]=t[r+u]}}});var Cx=k((Lhe,Nx)=>{"use strict";v();var NZ=Rn(),CZ=Ot(),Mx=P2(),cs=Kv();function DZ(e,t){NZ.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);e==="encrypt"?this.ciphers=[cs.create({type:"encrypt",key:r}),cs.create({type:"decrypt",key:i}),cs.create({type:"encrypt",key:n})]:this.ciphers=[cs.create({type:"decrypt",key:n}),cs.create({type:"encrypt",key:i}),cs.create({type:"decrypt",key:r})]}function Lu(e){Mx.call(this,e);var t=new DZ(this.type,this.options.key);this._edeState=t}CZ(Lu,Mx);Nx.exports=Lu;Lu.create=function(t){return new Lu(t)};Lu.prototype._update=function(t,r,i,n){var o=this._edeState;o.ciphers[0]._update(t,r,i,n),o.ciphers[1]._update(i,n,i,n),o.ciphers[2]._update(i,n,i,n)};Lu.prototype._pad=cs.prototype._pad;Lu.prototype._unpad=cs.prototype._unpad});var Dx=k(xc=>{"use strict";v();xc.utils=zv();xc.Cipher=P2();xc.DES=Kv();xc.CBC=Bx();xc.EDE=Cx()});var Ux=k((Hhe,qx)=>{v();var Lx=pa(),ga=Dx(),LZ=Ot(),qu=nt().Buffer,Zh={"des-ede3-cbc":ga.CBC.instantiate(ga.EDE),"des-ede3":ga.EDE,"des-ede-cbc":ga.CBC.instantiate(ga.EDE),"des-ede":ga.EDE,"des-cbc":ga.CBC.instantiate(ga.DES),"des-ecb":ga.DES};Zh.des=Zh["des-cbc"];Zh.des3=Zh["des-ede3-cbc"];qx.exports=k2;LZ(k2,Lx);function k2(e){Lx.call(this);var t=e.mode.toLowerCase(),r=Zh[t],i;e.decrypt?i="decrypt":i="encrypt";var n=e.key;qu.isBuffer(n)||(n=qu.from(n)),(t==="des-ede"||t==="des-ede-cbc")&&(n=qu.concat([n,n.slice(0,8)]));var o=e.iv;qu.isBuffer(o)||(o=qu.from(o)),this._des=r.create({key:n,iv:o,type:i})}k2.prototype._update=function(e){return qu.from(this._des.update(e))};k2.prototype._final=function(){return qu.from(this._des.final())}});var Fx=k(Vv=>{v();Vv.encrypt=function(e,t){return e._cipher.encryptBlock(t)};Vv.decrypt=function(e,t){return e._cipher.decryptBlock(t)}});var Ec=k((Vhe,Hx)=>{v();Hx.exports=function(t,r){for(var i=Math.min(t.length,r.length),n=new h.Buffer(i),o=0;o<i;++o)n[o]=t[o]^r[o];return n}});var zx=k(Gv=>{v();var jx=Ec();Gv.encrypt=function(e,t){var r=jx(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev};Gv.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return jx(i,r)}});var Gx=k(Vx=>{v();var Wh=nt().Buffer,qZ=Ec();function Kx(e,t,r){var i=t.length,n=qZ(t,e._cache);return e._cache=e._cache.slice(i),e._prev=Wh.concat([e._prev,r?t:n]),n}Vx.encrypt=function(e,t,r){for(var i=Wh.allocUnsafe(0),n;t.length;)if(e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=Wh.allocUnsafe(0)),e._cache.length<=t.length)n=e._cache.length,i=Wh.concat([i,Kx(e,t.slice(0,n),r)]),t=t.slice(n);else{i=Wh.concat([i,Kx(e,t,r)]);break}return i}});var Wx=k(Zx=>{v();var Zv=nt().Buffer;function UZ(e,t,r){var i=e._cipher.encryptBlock(e._prev),n=i[0]^t;return e._prev=Zv.concat([e._prev.slice(1),Zv.from([r?t:n])]),n}Zx.encrypt=function(e,t,r){for(var i=t.length,n=Zv.allocUnsafe(i),o=-1;++o<i;)n[o]=UZ(e,t[o],r);return n}});var $x=k(Yx=>{v();var R2=nt().Buffer;function FZ(e,t,r){for(var i,n=-1,o=8,a=0,s,u;++n<o;)i=e._cipher.encryptBlock(e._prev),s=t&1<<7-n?128:0,u=i[0]^s,a+=(u&128)>>n%8,e._prev=HZ(e._prev,r?s:u);return a}function HZ(e,t){var r=e.length,i=-1,n=R2.allocUnsafe(e.length);for(e=R2.concat([e,R2.from([t])]);++i<r;)n[i]=e[i]<<1|e[i+1]>>7;return n}Yx.encrypt=function(e,t,r){for(var i=t.length,n=R2.allocUnsafe(i),o=-1;++o<i;)n[o]=FZ(e,t[o],r);return n}});var Jx=k(Xx=>{v();var jZ=Ec();function zZ(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}Xx.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=h.Buffer.concat([e._cache,zZ(e)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),jZ(t,r)}});var Wv=k((i0e,Qx)=>{v();function KZ(e){for(var t=e.length,r;t--;)if(r=e.readUInt8(t),r===255)e.writeUInt8(0,t);else{r++,e.writeUInt8(r,t);break}}Qx.exports=KZ});var $v=k(tE=>{v();var VZ=Ec(),eE=nt().Buffer,GZ=Wv();function ZZ(e){var t=e._cipher.encryptBlockRaw(e._prev);return GZ(e._prev),t}var Yv=16;tE.encrypt=function(e,t){var r=Math.ceil(t.length/Yv),i=e._cache.length;e._cache=eE.concat([e._cache,eE.allocUnsafe(r*Yv)]);for(var n=0;n<r;n++){var o=ZZ(e),a=i+n*Yv;e._cache.writeUInt32BE(o[0],a+0),e._cache.writeUInt32BE(o[1],a+4),e._cache.writeUInt32BE(o[2],a+8),e._cache.writeUInt32BE(o[3],a+12)}var s=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),VZ(t,s)}});var Xv=k((s0e,WZ)=>{WZ.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}});var M2=k((u0e,rE)=>{v();var YZ={ECB:Fx(),CBC:zx(),CFB:Gx(),CFB8:Wx(),CFB1:$x(),OFB:Jx(),CTR:$v(),GCM:$v()},B2=Xv();for(Jv in B2)B2[Jv].module=YZ[B2[Jv].mode];var Jv;rE.exports=B2});var Yh=k((c0e,nE)=>{v();var N2=nt().Buffer;function em(e){N2.isBuffer(e)||(e=N2.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(i*4);return r}function Qv(e){for(var t=0;t<e.length;e++)e[t]=0}function iE(e,t,r,i,n){for(var o=r[0],a=r[1],s=r[2],u=r[3],c=e[0]^t[0],l=e[1]^t[1],m=e[2]^t[2],w=e[3]^t[3],E,P,M,D,L=4,U=1;U<n;U++)E=o[c>>>24]^a[l>>>16&255]^s[m>>>8&255]^u[w&255]^t[L++],P=o[l>>>24]^a[m>>>16&255]^s[w>>>8&255]^u[c&255]^t[L++],M=o[m>>>24]^a[w>>>16&255]^s[c>>>8&255]^u[l&255]^t[L++],D=o[w>>>24]^a[c>>>16&255]^s[l>>>8&255]^u[m&255]^t[L++],c=E,l=P,m=M,w=D;return E=(i[c>>>24]<<24|i[l>>>16&255]<<16|i[m>>>8&255]<<8|i[w&255])^t[L++],P=(i[l>>>24]<<24|i[m>>>16&255]<<16|i[w>>>8&255]<<8|i[c&255])^t[L++],M=(i[m>>>24]<<24|i[w>>>16&255]<<16|i[c>>>8&255]<<8|i[l&255])^t[L++],D=(i[w>>>24]<<24|i[c>>>16&255]<<16|i[l>>>8&255]<<8|i[m&255])^t[L++],E=E>>>0,P=P>>>0,M=M>>>0,D=D>>>0,[E,P,M,D]}var $Z=[0,1,2,4,8,16,32,64,128,27,54],br=(function(){for(var e=new Array(256),t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^c&255^99,r[a]=c,i[c]=a;var l=e[a],m=e[l],w=e[m],E=e[c]*257^c*16843008;n[0][a]=E<<24|E>>>8,n[1][a]=E<<16|E>>>16,n[2][a]=E<<8|E>>>24,n[3][a]=E,E=w*16843009^m*65537^l*257^a*16843008,o[0][c]=E<<24|E>>>8,o[1][c]=E<<16|E>>>16,o[2][c]=E<<8|E>>>24,o[3][c]=E,a===0?a=s=1:(a=l^e[e[e[w^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}})();function un(e){this._key=em(e),this._reset()}un.blockSize=16;un.keySize=256/8;un.prototype.blockSize=un.blockSize;un.prototype.keySize=un.keySize;un.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=(r+1)*4,n=[],o=0;o<t;o++)n[o]=e[o];for(o=t;o<i;o++){var a=n[o-1];o%t===0?(a=a<<8|a>>>24,a=br.SBOX[a>>>24]<<24|br.SBOX[a>>>16&255]<<16|br.SBOX[a>>>8&255]<<8|br.SBOX[a&255],a^=$Z[o/t|0]<<24):t>6&&o%t===4&&(a=br.SBOX[a>>>24]<<24|br.SBOX[a>>>16&255]<<16|br.SBOX[a>>>8&255]<<8|br.SBOX[a&255]),n[o]=n[o-t]^a}for(var s=[],u=0;u<i;u++){var c=i-u,l=n[c-(u%4?0:4)];u<4||c<=4?s[u]=l:s[u]=br.INV_SUB_MIX[0][br.SBOX[l>>>24]]^br.INV_SUB_MIX[1][br.SBOX[l>>>16&255]]^br.INV_SUB_MIX[2][br.SBOX[l>>>8&255]]^br.INV_SUB_MIX[3][br.SBOX[l&255]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s};un.prototype.encryptBlockRaw=function(e){return e=em(e),iE(e,this._keySchedule,br.SUB_MIX,br.SBOX,this._nRounds)};un.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=N2.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r};un.prototype.decryptBlock=function(e){e=em(e);var t=e[1];e[1]=e[3],e[3]=t;var r=iE(e,this._invKeySchedule,br.INV_SUB_MIX,br.INV_SBOX,this._nRounds),i=N2.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i};un.prototype.scrub=function(){Qv(this._keySchedule),Qv(this._invKeySchedule),Qv(this._key)};nE.exports.AES=un});var sE=k((h0e,aE)=>{v();var Oc=nt().Buffer,XZ=Oc.alloc(16,0);function JZ(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}function oE(e){var t=Oc.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function $h(e){this.h=e,this.state=Oc.alloc(16,0),this.cache=Oc.allocUnsafe(0)}$h.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()};$h.prototype._multiply=function(){for(var e=JZ(this.h),t=[0,0,0,0],r,i,n,o=-1;++o<128;){for(i=(this.state[~~(o/8)]&1<<7-o%8)!==0,i&&(t[0]^=e[0],t[1]^=e[1],t[2]^=e[2],t[3]^=e[3]),n=(e[3]&1)!==0,r=3;r>0;r--)e[r]=e[r]>>>1|(e[r-1]&1)<<31;e[0]=e[0]>>>1,n&&(e[0]=e[0]^225<<24)}this.state=oE(t)};$h.prototype.update=function(e){this.cache=Oc.concat([this.cache,e]);for(var t;this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)};$h.prototype.final=function(e,t){return this.cache.length&&this.ghash(Oc.concat([this.cache,XZ],16)),this.ghash(oE([0,e,0,t])),this.state};aE.exports=$h});var tm=k((p0e,cE)=>{v();var QZ=Yh(),Pi=nt().Buffer,uE=pa(),eW=Ot(),fE=sE(),tW=Ec(),rW=Wv();function iW(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n<i;++n)r+=e[n]^t[n];return r}function nW(e,t,r){if(t.length===12)return e._finID=Pi.concat([t,Pi.from([0,0,0,1])]),Pi.concat([t,Pi.from([0,0,0,2])]);var i=new fE(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(Pi.alloc(o,0))),i.update(Pi.alloc(8,0));var a=n*8,s=Pi.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=Pi.from(e._finID);return rW(u),u}function Uu(e,t,r,i){uE.call(this);var n=Pi.alloc(4,0);this._cipher=new QZ.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new fE(o),r=nW(this,r,o),this._prev=Pi.from(r),this._cache=Pi.allocUnsafe(0),this._secCache=Pi.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}eW(Uu,uE);Uu.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=Pi.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r};Uu.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=tW(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&iW(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()};Uu.prototype.getAuthTag=function(){if(this._decrypt||!Pi.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag};Uu.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t};Uu.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length};cE.exports=Uu});var im=k((v0e,hE)=>{v();var oW=Yh(),rm=nt().Buffer,lE=pa(),aW=Ot();function C2(e,t,r,i){lE.call(this),this._cipher=new oW.AES(t),this._prev=rm.from(r),this._cache=rm.allocUnsafe(0),this._secCache=rm.allocUnsafe(0),this._decrypt=i,this._mode=e}aW(C2,lE);C2.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)};C2.prototype._final=function(){this._cipher.scrub()};hE.exports=C2});var Xh=k((y0e,dE)=>{v();var Fu=nt().Buffer,sW=n2();function uW(e,t,r,i){if(Fu.isBuffer(e)||(e=Fu.from(e,"binary")),t&&(Fu.isBuffer(t)||(t=Fu.from(t,"binary")),t.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var n=r/8,o=Fu.alloc(n),a=Fu.alloc(i||0),s=Fu.alloc(0);n>0||i>0;){var u=new sW;u.update(s),u.update(e),t&&u.update(t),s=u.digest();var c=0;if(n>0){var l=o.length-n;c=Math.min(n,s.length),s.copy(o,l,0,c),n-=c}if(c<s.length&&i>0){var m=a.length-i,w=Math.min(i,s.length-c);s.copy(a,m,c,c+w),i-=w}}return s.fill(0),{key:o,iv:a}}dE.exports=uW});var mE=k(nm=>{v();var pE=M2(),fW=tm(),va=nt().Buffer,cW=im(),gE=pa(),lW=Yh(),hW=Xh(),dW=Ot();function Jh(e,t,r){gE.call(this),this._cache=new D2,this._cipher=new lW.AES(t),this._prev=va.from(r),this._mode=e,this._autopadding=!0}dW(Jh,gE);Jh.prototype._update=function(e){this._cache.add(e);for(var t,r,i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return va.concat(i)};var pW=va.alloc(16,16);Jh.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(pW))throw this._cipher.scrub(),new Error("data not multiple of block length")};Jh.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this};function D2(){this.cache=va.allocUnsafe(0)}D2.prototype.add=function(e){this.cache=va.concat([this.cache,e])};D2.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null};D2.prototype.flush=function(){for(var e=16-this.cache.length,t=va.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return va.concat([this.cache,t])};function vE(e,t,r){var i=pE[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if(typeof t=="string"&&(t=va.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);if(typeof r=="string"&&(r=va.from(r)),i.mode!=="GCM"&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);return i.type==="stream"?new cW(i.module,t,r):i.type==="auth"?new fW(i.module,t,r):new Jh(i.module,t,r)}function gW(e,t){var r=pE[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=hW(t,!1,r.key,r.iv);return vE(e,i.key,i.iv)}nm.createCipheriv=vE;nm.createCipher=gW});var wE=k(om=>{v();var vW=tm(),Ic=nt().Buffer,yE=M2(),mW=im(),bE=pa(),yW=Yh(),bW=Xh(),_W=Ot();function Qh(e,t,r){bE.call(this),this._cache=new L2,this._last=void 0,this._cipher=new yW.AES(t),this._prev=Ic.from(r),this._mode=e,this._autopadding=!0}_W(Qh,bE);Qh.prototype._update=function(e){this._cache.add(e);for(var t,r,i=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),i.push(r);return Ic.concat(i)};Qh.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return wW(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")};Qh.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this};function L2(){this.cache=Ic.allocUnsafe(0)}L2.prototype.add=function(e){this.cache=Ic.concat([this.cache,e])};L2.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null};L2.prototype.flush=function(){if(this.cache.length)return this.cache};function wW(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(t!==16)return e.slice(0,16-t)}function _E(e,t,r){var i=yE[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if(typeof r=="string"&&(r=Ic.from(r)),i.mode!=="GCM"&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);if(typeof t=="string"&&(t=Ic.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);return i.type==="stream"?new mW(i.module,t,r,!0):i.type==="auth"?new vW(i.module,t,r,!0):new Qh(i.module,t,r)}function SW(e,t){var r=yE[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=bW(t,!1,r.key,r.iv);return _E(e,i.key,i.iv)}om.createDecipher=SW;om.createDecipheriv=_E});var q2=k(Bn=>{v();var SE=mE(),xE=wE(),xW=Xv();function EW(){return Object.keys(xW)}Bn.createCipher=Bn.Cipher=SE.createCipher;Bn.createCipheriv=Bn.Cipheriv=SE.createCipheriv;Bn.createDecipher=Bn.Decipher=xE.createDecipher;Bn.createDecipheriv=Bn.Decipheriv=xE.createDecipheriv;Bn.listCiphers=Bn.getCiphers=EW});var EE=k(ma=>{v();ma["des-ecb"]={key:8,iv:0};ma["des-cbc"]=ma.des={key:8,iv:8};ma["des-ede3-cbc"]=ma.des3={key:24,iv:8};ma["des-ede3"]={key:24,iv:0};ma["des-ede-cbc"]={key:16,iv:8};ma["des-ede"]={key:16,iv:0}});var TE=k(Mn=>{v();var OE=Ux(),am=q2(),ls=M2(),ya=EE(),IE=Xh();function OW(e,t){e=e.toLowerCase();var r,i;if(ls[e])r=ls[e].key,i=ls[e].iv;else if(ya[e])r=ya[e].key*8,i=ya[e].iv;else throw new TypeError("invalid suite type");var n=IE(t,!1,r,i);return AE(e,n.key,n.iv)}function IW(e,t){e=e.toLowerCase();var r,i;if(ls[e])r=ls[e].key,i=ls[e].iv;else if(ya[e])r=ya[e].key*8,i=ya[e].iv;else throw new TypeError("invalid suite type");var n=IE(t,!1,r,i);return PE(e,n.key,n.iv)}function AE(e,t,r){if(e=e.toLowerCase(),ls[e])return am.createCipheriv(e,t,r);if(ya[e])return new OE({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function PE(e,t,r){if(e=e.toLowerCase(),ls[e])return am.createDecipheriv(e,t,r);if(ya[e])return new OE({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function AW(){return Object.keys(ya).concat(am.getCiphers())}Mn.createCipher=Mn.Cipher=OW;Mn.createCipheriv=Mn.Cipheriv=AE;Mn.createDecipher=Mn.Decipher=IW;Mn.createDecipheriv=Mn.Decipheriv=PE;Mn.listCiphers=Mn.getCiphers=AW});var Nn=k((kE,sm)=>{v();(function(e,t){"use strict";function r(B,g){if(!B)throw new Error(g||"Assertion failed")}function i(B,g){B.super_=g;var O=function(){};O.prototype=g.prototype,B.prototype=new O,B.prototype.constructor=B}function n(B,g,O){if(n.isBN(B))return B;this.negative=0,this.words=null,this.length=0,this.red=null,B!==null&&((g==="le"||g==="be")&&(O=g,g=10),this._init(B||0,g||10,O||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Kt().Buffer}catch{}n.isBN=function(g){return g instanceof n?!0:g!==null&&typeof g=="object"&&g.constructor.wordSize===n.wordSize&&Array.isArray(g.words)},n.max=function(g,O){return g.cmp(O)>0?g:O},n.min=function(g,O){return g.cmp(O)<0?g:O},n.prototype._init=function(g,O,y){if(typeof g=="number")return this._initNumber(g,O,y);if(typeof g=="object")return this._initArray(g,O,y);O==="hex"&&(O=16),r(O===(O|0)&&O>=2&&O<=36),g=g.toString().replace(/\s+/g,"");var f=0;g[0]==="-"&&(f++,this.negative=1),f<g.length&&(O===16?this._parseHex(g,f,y):(this._parseBase(g,O,f),y==="le"&&this._initArray(this.toArray(),O,y)))},n.prototype._initNumber=function(g,O,y){g<0&&(this.negative=1,g=-g),g<67108864?(this.words=[g&67108863],this.length=1):g<4503599627370496?(this.words=[g&67108863,g/67108864&67108863],this.length=2):(r(g<9007199254740992),this.words=[g&67108863,g/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),O,y)},n.prototype._initArray=function(g,O,y){if(r(typeof g.length=="number"),g.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(g.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var d,_,x=0;if(y==="be")for(f=g.length-1,d=0;f>=0;f-=3)_=g[f]|g[f-1]<<8|g[f-2]<<16,this.words[d]|=_<<x&67108863,this.words[d+1]=_>>>26-x&67108863,x+=24,x>=26&&(x-=26,d++);else if(y==="le")for(f=0,d=0;f<g.length;f+=3)_=g[f]|g[f+1]<<8|g[f+2]<<16,this.words[d]|=_<<x&67108863,this.words[d+1]=_>>>26-x&67108863,x+=24,x>=26&&(x-=26,d++);return this.strip()};function a(B,g){var O=B.charCodeAt(g);return O>=65&&O<=70?O-55:O>=97&&O<=102?O-87:O-48&15}function s(B,g,O){var y=a(B,O);return O-1>=g&&(y|=a(B,O-1)<<4),y}n.prototype._parseHex=function(g,O,y){this.length=Math.ceil((g.length-O)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var d=0,_=0,x;if(y==="be")for(f=g.length-1;f>=O;f-=2)x=s(g,O,f)<<d,this.words[_]|=x&67108863,d>=18?(d-=18,_+=1,this.words[_]|=x>>>26):d+=8;else{var b=g.length-O;for(f=b%2===0?O+1:O;f<g.length;f+=2)x=s(g,O,f)<<d,this.words[_]|=x&67108863,d>=18?(d-=18,_+=1,this.words[_]|=x>>>26):d+=8}this.strip()};function u(B,g,O,y){for(var f=0,d=Math.min(B.length,O),_=g;_<d;_++){var x=B.charCodeAt(_)-48;f*=y,x>=49?f+=x-49+10:x>=17?f+=x-17+10:f+=x}return f}n.prototype._parseBase=function(g,O,y){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=O)f++;f--,d=d/O|0;for(var _=g.length-y,x=_%f,b=Math.min(_,_-x)+y,p=0,I=y;I<b;I+=f)p=u(g,I,I+f,O),this.imuln(d),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(x!==0){var T=1;for(p=u(g,I,g.length,O),I=0;I<x;I++)T*=O;this.imuln(T),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},n.prototype.copy=function(g){g.words=new Array(this.length);for(var O=0;O<this.length;O++)g.words[O]=this.words[O];g.length=this.length,g.negative=this.negative,g.red=this.red},n.prototype.clone=function(){var g=new n(null);return this.copy(g),g},n.prototype._expand=function(g){for(;this.length<g;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(g,O){g=g||10,O=O|0||1;var y;if(g===16||g==="hex"){y="";for(var f=0,d=0,_=0;_<this.length;_++){var x=this.words[_],b=((x<<f|d)&16777215).toString(16);d=x>>>24-f&16777215,f+=2,f>=26&&(f-=26,_--),d!==0||_!==this.length-1?y=c[6-b.length]+b+y:y=b+y}for(d!==0&&(y=d.toString(16)+y);y.length%O!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(g===(g|0)&&g>=2&&g<=36){var p=l[g],I=m[g];y="";var T=this.clone();for(T.negative=0;!T.isZero();){var S=T.modn(I).toString(g);T=T.idivn(I),T.isZero()?y=S+y:y=c[p-S.length]+S+y}for(this.isZero()&&(y="0"+y);y.length%O!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var g=this.words[0];return this.length===2?g+=this.words[1]*67108864:this.length===3&&this.words[2]===1?g+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-g:g},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(g,O){return r(typeof o<"u"),this.toArrayLike(o,g,O)},n.prototype.toArray=function(g,O){return this.toArrayLike(Array,g,O)},n.prototype.toArrayLike=function(g,O,y){var f=this.byteLength(),d=y||Math.max(1,f);r(f<=d,"byte array longer than desired length"),r(d>0,"Requested array length <= 0"),this.strip();var _=O==="le",x=new g(d),b,p,I=this.clone();if(_){for(p=0;!I.isZero();p++)b=I.andln(255),I.iushrn(8),x[p]=b;for(;p<d;p++)x[p]=0}else{for(p=0;p<d-f;p++)x[p]=0;for(p=0;!I.isZero();p++)b=I.andln(255),I.iushrn(8),x[d-p-1]=b}return x},Math.clz32?n.prototype._countBits=function(g){return 32-Math.clz32(g)}:n.prototype._countBits=function(g){var O=g,y=0;return O>=4096&&(y+=13,O>>>=13),O>=64&&(y+=7,O>>>=7),O>=8&&(y+=4,O>>>=4),O>=2&&(y+=2,O>>>=2),y+O},n.prototype._zeroBits=function(g){if(g===0)return 26;var O=g,y=0;return(O&8191)===0&&(y+=13,O>>>=13),(O&127)===0&&(y+=7,O>>>=7),(O&15)===0&&(y+=4,O>>>=4),(O&3)===0&&(y+=2,O>>>=2),(O&1)===0&&y++,y},n.prototype.bitLength=function(){var g=this.words[this.length-1],O=this._countBits(g);return(this.length-1)*26+O};function w(B){for(var g=new Array(B.bitLength()),O=0;O<g.length;O++){var y=O/26|0,f=O%26;g[O]=(B.words[y]&1<<f)>>>f}return g}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var g=0,O=0;O<this.length;O++){var y=this._zeroBits(this.words[O]);if(g+=y,y!==26)break}return g},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(g){return this.negative!==0?this.abs().inotn(g).iaddn(1):this.clone()},n.prototype.fromTwos=function(g){return this.testn(g-1)?this.notn(g).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(g){for(;this.length<g.length;)this.words[this.length++]=0;for(var O=0;O<g.length;O++)this.words[O]=this.words[O]|g.words[O];return this.strip()},n.prototype.ior=function(g){return r((this.negative|g.negative)===0),this.iuor(g)},n.prototype.or=function(g){return this.length>g.length?this.clone().ior(g):g.clone().ior(this)},n.prototype.uor=function(g){return this.length>g.length?this.clone().iuor(g):g.clone().iuor(this)},n.prototype.iuand=function(g){var O;this.length>g.length?O=g:O=this;for(var y=0;y<O.length;y++)this.words[y]=this.words[y]&g.words[y];return this.length=O.length,this.strip()},n.prototype.iand=function(g){return r((this.negative|g.negative)===0),this.iuand(g)},n.prototype.and=function(g){return this.length>g.length?this.clone().iand(g):g.clone().iand(this)},n.prototype.uand=function(g){return this.length>g.length?this.clone().iuand(g):g.clone().iuand(this)},n.prototype.iuxor=function(g){var O,y;this.length>g.length?(O=this,y=g):(O=g,y=this);for(var f=0;f<y.length;f++)this.words[f]=O.words[f]^y.words[f];if(this!==O)for(;f<O.length;f++)this.words[f]=O.words[f];return this.length=O.length,this.strip()},n.prototype.ixor=function(g){return r((this.negative|g.negative)===0),this.iuxor(g)},n.prototype.xor=function(g){return this.length>g.length?this.clone().ixor(g):g.clone().ixor(this)},n.prototype.uxor=function(g){return this.length>g.length?this.clone().iuxor(g):g.clone().iuxor(this)},n.prototype.inotn=function(g){r(typeof g=="number"&&g>=0);var O=Math.ceil(g/26)|0,y=g%26;this._expand(O),y>0&&O--;for(var f=0;f<O;f++)this.words[f]=~this.words[f]&67108863;return y>0&&(this.words[f]=~this.words[f]&67108863>>26-y),this.strip()},n.prototype.notn=function(g){return this.clone().inotn(g)},n.prototype.setn=function(g,O){r(typeof g=="number"&&g>=0);var y=g/26|0,f=g%26;return this._expand(y+1),O?this.words[y]=this.words[y]|1<<f:this.words[y]=this.words[y]&~(1<<f),this.strip()},n.prototype.iadd=function(g){var O;if(this.negative!==0&&g.negative===0)return this.negative=0,O=this.isub(g),this.negative^=1,this._normSign();if(this.negative===0&&g.negative!==0)return g.negative=0,O=this.isub(g),g.negative=1,O._normSign();var y,f;this.length>g.length?(y=this,f=g):(y=g,f=this);for(var d=0,_=0;_<f.length;_++)O=(y.words[_]|0)+(f.words[_]|0)+d,this.words[_]=O&67108863,d=O>>>26;for(;d!==0&&_<y.length;_++)O=(y.words[_]|0)+d,this.words[_]=O&67108863,d=O>>>26;if(this.length=y.length,d!==0)this.words[this.length]=d,this.length++;else if(y!==this)for(;_<y.length;_++)this.words[_]=y.words[_];return this},n.prototype.add=function(g){var O;return g.negative!==0&&this.negative===0?(g.negative=0,O=this.sub(g),g.negative^=1,O):g.negative===0&&this.negative!==0?(this.negative=0,O=g.sub(this),this.negative=1,O):this.length>g.length?this.clone().iadd(g):g.clone().iadd(this)},n.prototype.isub=function(g){if(g.negative!==0){g.negative=0;var O=this.iadd(g);return g.negative=1,O._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(g),this.negative=1,this._normSign();var y=this.cmp(g);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,d;y>0?(f=this,d=g):(f=g,d=this);for(var _=0,x=0;x<d.length;x++)O=(f.words[x]|0)-(d.words[x]|0)+_,_=O>>26,this.words[x]=O&67108863;for(;_!==0&&x<f.length;x++)O=(f.words[x]|0)+_,_=O>>26,this.words[x]=O&67108863;if(_===0&&x<f.length&&f!==this)for(;x<f.length;x++)this.words[x]=f.words[x];return this.length=Math.max(this.length,x),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(g){return this.clone().isub(g)};function E(B,g,O){O.negative=g.negative^B.negative;var y=B.length+g.length|0;O.length=y,y=y-1|0;var f=B.words[0]|0,d=g.words[0]|0,_=f*d,x=_&67108863,b=_/67108864|0;O.words[0]=x;for(var p=1;p<y;p++){for(var I=b>>>26,T=b&67108863,S=Math.min(p,g.length-1),R=Math.max(0,p-B.length+1);R<=S;R++){var Y=p-R|0;f=B.words[Y]|0,d=g.words[R]|0,_=f*d+T,I+=_/67108864|0,T=_&67108863}O.words[p]=T|0,b=I|0}return b!==0?O.words[p]=b|0:O.length--,O.strip()}var P=function(g,O,y){var f=g.words,d=O.words,_=y.words,x=0,b,p,I,T=f[0]|0,S=T&8191,R=T>>>13,Y=f[1]|0,X=Y&8191,ne=Y>>>13,ce=f[2]|0,pe=ce&8191,q=ce>>>13,W=f[3]|0,$=W&8191,ee=W>>>13,se=f[4]|0,ue=se&8191,le=se>>>13,Ae=f[5]|0,ge=Ae&8191,ve=Ae>>>13,sr=f[6]|0,xe=sr&8191,ye=sr>>>13,Re=f[7]|0,be=Re&8191,_e=Re>>>13,Qi=f[8]|0,Be=Qi&8191,ke=Qi>>>13,$s=f[9]|0,Ce=$s&8191,Le=$s>>>13,$l=d[0]|0,qe=$l&8191,Ue=$l>>>13,Xl=d[1]|0,Fe=Xl&8191,He=Xl>>>13,Jl=d[2]|0,je=Jl&8191,ze=Jl>>>13,Ql=d[3]|0,Ke=Ql&8191,Ve=Ql>>>13,eh=d[4]|0,Ge=eh&8191,Ze=eh>>>13,th=d[5]|0,We=th&8191,Ye=th>>>13,rh=d[6]|0,$e=rh&8191,Xe=rh>>>13,ih=d[7]|0,Je=ih&8191,Qe=ih>>>13,nh=d[8]|0,et=nh&8191,tt=nh>>>13,oh=d[9]|0,rt=oh&8191,it=oh>>>13;y.negative=g.negative^O.negative,y.length=19,b=Math.imul(S,qe),p=Math.imul(S,Ue),p=p+Math.imul(R,qe)|0,I=Math.imul(R,Ue);var Wf=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Wf>>>26)|0,Wf&=67108863,b=Math.imul(X,qe),p=Math.imul(X,Ue),p=p+Math.imul(ne,qe)|0,I=Math.imul(ne,Ue),b=b+Math.imul(S,Fe)|0,p=p+Math.imul(S,He)|0,p=p+Math.imul(R,Fe)|0,I=I+Math.imul(R,He)|0;var Jt=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,b=Math.imul(pe,qe),p=Math.imul(pe,Ue),p=p+Math.imul(q,qe)|0,I=Math.imul(q,Ue),b=b+Math.imul(X,Fe)|0,p=p+Math.imul(X,He)|0,p=p+Math.imul(ne,Fe)|0,I=I+Math.imul(ne,He)|0,b=b+Math.imul(S,je)|0,p=p+Math.imul(S,ze)|0,p=p+Math.imul(R,je)|0,I=I+Math.imul(R,ze)|0;var Qt=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul($,qe),p=Math.imul($,Ue),p=p+Math.imul(ee,qe)|0,I=Math.imul(ee,Ue),b=b+Math.imul(pe,Fe)|0,p=p+Math.imul(pe,He)|0,p=p+Math.imul(q,Fe)|0,I=I+Math.imul(q,He)|0,b=b+Math.imul(X,je)|0,p=p+Math.imul(X,ze)|0,p=p+Math.imul(ne,je)|0,I=I+Math.imul(ne,ze)|0,b=b+Math.imul(S,Ke)|0,p=p+Math.imul(S,Ve)|0,p=p+Math.imul(R,Ke)|0,I=I+Math.imul(R,Ve)|0;var Xs=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,b=Math.imul(ue,qe),p=Math.imul(ue,Ue),p=p+Math.imul(le,qe)|0,I=Math.imul(le,Ue),b=b+Math.imul($,Fe)|0,p=p+Math.imul($,He)|0,p=p+Math.imul(ee,Fe)|0,I=I+Math.imul(ee,He)|0,b=b+Math.imul(pe,je)|0,p=p+Math.imul(pe,ze)|0,p=p+Math.imul(q,je)|0,I=I+Math.imul(q,ze)|0,b=b+Math.imul(X,Ke)|0,p=p+Math.imul(X,Ve)|0,p=p+Math.imul(ne,Ke)|0,I=I+Math.imul(ne,Ve)|0,b=b+Math.imul(S,Ge)|0,p=p+Math.imul(S,Ze)|0,p=p+Math.imul(R,Ge)|0,I=I+Math.imul(R,Ze)|0;var Js=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Js>>>26)|0,Js&=67108863,b=Math.imul(ge,qe),p=Math.imul(ge,Ue),p=p+Math.imul(ve,qe)|0,I=Math.imul(ve,Ue),b=b+Math.imul(ue,Fe)|0,p=p+Math.imul(ue,He)|0,p=p+Math.imul(le,Fe)|0,I=I+Math.imul(le,He)|0,b=b+Math.imul($,je)|0,p=p+Math.imul($,ze)|0,p=p+Math.imul(ee,je)|0,I=I+Math.imul(ee,ze)|0,b=b+Math.imul(pe,Ke)|0,p=p+Math.imul(pe,Ve)|0,p=p+Math.imul(q,Ke)|0,I=I+Math.imul(q,Ve)|0,b=b+Math.imul(X,Ge)|0,p=p+Math.imul(X,Ze)|0,p=p+Math.imul(ne,Ge)|0,I=I+Math.imul(ne,Ze)|0,b=b+Math.imul(S,We)|0,p=p+Math.imul(S,Ye)|0,p=p+Math.imul(R,We)|0,I=I+Math.imul(R,Ye)|0;var Qs=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(Qs>>>26)|0,Qs&=67108863,b=Math.imul(xe,qe),p=Math.imul(xe,Ue),p=p+Math.imul(ye,qe)|0,I=Math.imul(ye,Ue),b=b+Math.imul(ge,Fe)|0,p=p+Math.imul(ge,He)|0,p=p+Math.imul(ve,Fe)|0,I=I+Math.imul(ve,He)|0,b=b+Math.imul(ue,je)|0,p=p+Math.imul(ue,ze)|0,p=p+Math.imul(le,je)|0,I=I+Math.imul(le,ze)|0,b=b+Math.imul($,Ke)|0,p=p+Math.imul($,Ve)|0,p=p+Math.imul(ee,Ke)|0,I=I+Math.imul(ee,Ve)|0,b=b+Math.imul(pe,Ge)|0,p=p+Math.imul(pe,Ze)|0,p=p+Math.imul(q,Ge)|0,I=I+Math.imul(q,Ze)|0,b=b+Math.imul(X,We)|0,p=p+Math.imul(X,Ye)|0,p=p+Math.imul(ne,We)|0,I=I+Math.imul(ne,Ye)|0,b=b+Math.imul(S,$e)|0,p=p+Math.imul(S,Xe)|0,p=p+Math.imul(R,$e)|0,I=I+Math.imul(R,Xe)|0;var eu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(eu>>>26)|0,eu&=67108863,b=Math.imul(be,qe),p=Math.imul(be,Ue),p=p+Math.imul(_e,qe)|0,I=Math.imul(_e,Ue),b=b+Math.imul(xe,Fe)|0,p=p+Math.imul(xe,He)|0,p=p+Math.imul(ye,Fe)|0,I=I+Math.imul(ye,He)|0,b=b+Math.imul(ge,je)|0,p=p+Math.imul(ge,ze)|0,p=p+Math.imul(ve,je)|0,I=I+Math.imul(ve,ze)|0,b=b+Math.imul(ue,Ke)|0,p=p+Math.imul(ue,Ve)|0,p=p+Math.imul(le,Ke)|0,I=I+Math.imul(le,Ve)|0,b=b+Math.imul($,Ge)|0,p=p+Math.imul($,Ze)|0,p=p+Math.imul(ee,Ge)|0,I=I+Math.imul(ee,Ze)|0,b=b+Math.imul(pe,We)|0,p=p+Math.imul(pe,Ye)|0,p=p+Math.imul(q,We)|0,I=I+Math.imul(q,Ye)|0,b=b+Math.imul(X,$e)|0,p=p+Math.imul(X,Xe)|0,p=p+Math.imul(ne,$e)|0,I=I+Math.imul(ne,Xe)|0,b=b+Math.imul(S,Je)|0,p=p+Math.imul(S,Qe)|0,p=p+Math.imul(R,Je)|0,I=I+Math.imul(R,Qe)|0;var tu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(tu>>>26)|0,tu&=67108863,b=Math.imul(Be,qe),p=Math.imul(Be,Ue),p=p+Math.imul(ke,qe)|0,I=Math.imul(ke,Ue),b=b+Math.imul(be,Fe)|0,p=p+Math.imul(be,He)|0,p=p+Math.imul(_e,Fe)|0,I=I+Math.imul(_e,He)|0,b=b+Math.imul(xe,je)|0,p=p+Math.imul(xe,ze)|0,p=p+Math.imul(ye,je)|0,I=I+Math.imul(ye,ze)|0,b=b+Math.imul(ge,Ke)|0,p=p+Math.imul(ge,Ve)|0,p=p+Math.imul(ve,Ke)|0,I=I+Math.imul(ve,Ve)|0,b=b+Math.imul(ue,Ge)|0,p=p+Math.imul(ue,Ze)|0,p=p+Math.imul(le,Ge)|0,I=I+Math.imul(le,Ze)|0,b=b+Math.imul($,We)|0,p=p+Math.imul($,Ye)|0,p=p+Math.imul(ee,We)|0,I=I+Math.imul(ee,Ye)|0,b=b+Math.imul(pe,$e)|0,p=p+Math.imul(pe,Xe)|0,p=p+Math.imul(q,$e)|0,I=I+Math.imul(q,Xe)|0,b=b+Math.imul(X,Je)|0,p=p+Math.imul(X,Qe)|0,p=p+Math.imul(ne,Je)|0,I=I+Math.imul(ne,Qe)|0,b=b+Math.imul(S,et)|0,p=p+Math.imul(S,tt)|0,p=p+Math.imul(R,et)|0,I=I+Math.imul(R,tt)|0;var ru=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(ru>>>26)|0,ru&=67108863,b=Math.imul(Ce,qe),p=Math.imul(Ce,Ue),p=p+Math.imul(Le,qe)|0,I=Math.imul(Le,Ue),b=b+Math.imul(Be,Fe)|0,p=p+Math.imul(Be,He)|0,p=p+Math.imul(ke,Fe)|0,I=I+Math.imul(ke,He)|0,b=b+Math.imul(be,je)|0,p=p+Math.imul(be,ze)|0,p=p+Math.imul(_e,je)|0,I=I+Math.imul(_e,ze)|0,b=b+Math.imul(xe,Ke)|0,p=p+Math.imul(xe,Ve)|0,p=p+Math.imul(ye,Ke)|0,I=I+Math.imul(ye,Ve)|0,b=b+Math.imul(ge,Ge)|0,p=p+Math.imul(ge,Ze)|0,p=p+Math.imul(ve,Ge)|0,I=I+Math.imul(ve,Ze)|0,b=b+Math.imul(ue,We)|0,p=p+Math.imul(ue,Ye)|0,p=p+Math.imul(le,We)|0,I=I+Math.imul(le,Ye)|0,b=b+Math.imul($,$e)|0,p=p+Math.imul($,Xe)|0,p=p+Math.imul(ee,$e)|0,I=I+Math.imul(ee,Xe)|0,b=b+Math.imul(pe,Je)|0,p=p+Math.imul(pe,Qe)|0,p=p+Math.imul(q,Je)|0,I=I+Math.imul(q,Qe)|0,b=b+Math.imul(X,et)|0,p=p+Math.imul(X,tt)|0,p=p+Math.imul(ne,et)|0,I=I+Math.imul(ne,tt)|0,b=b+Math.imul(S,rt)|0,p=p+Math.imul(S,it)|0,p=p+Math.imul(R,rt)|0,I=I+Math.imul(R,it)|0;var iu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(iu>>>26)|0,iu&=67108863,b=Math.imul(Ce,Fe),p=Math.imul(Ce,He),p=p+Math.imul(Le,Fe)|0,I=Math.imul(Le,He),b=b+Math.imul(Be,je)|0,p=p+Math.imul(Be,ze)|0,p=p+Math.imul(ke,je)|0,I=I+Math.imul(ke,ze)|0,b=b+Math.imul(be,Ke)|0,p=p+Math.imul(be,Ve)|0,p=p+Math.imul(_e,Ke)|0,I=I+Math.imul(_e,Ve)|0,b=b+Math.imul(xe,Ge)|0,p=p+Math.imul(xe,Ze)|0,p=p+Math.imul(ye,Ge)|0,I=I+Math.imul(ye,Ze)|0,b=b+Math.imul(ge,We)|0,p=p+Math.imul(ge,Ye)|0,p=p+Math.imul(ve,We)|0,I=I+Math.imul(ve,Ye)|0,b=b+Math.imul(ue,$e)|0,p=p+Math.imul(ue,Xe)|0,p=p+Math.imul(le,$e)|0,I=I+Math.imul(le,Xe)|0,b=b+Math.imul($,Je)|0,p=p+Math.imul($,Qe)|0,p=p+Math.imul(ee,Je)|0,I=I+Math.imul(ee,Qe)|0,b=b+Math.imul(pe,et)|0,p=p+Math.imul(pe,tt)|0,p=p+Math.imul(q,et)|0,I=I+Math.imul(q,tt)|0,b=b+Math.imul(X,rt)|0,p=p+Math.imul(X,it)|0,p=p+Math.imul(ne,rt)|0,I=I+Math.imul(ne,it)|0;var nu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(nu>>>26)|0,nu&=67108863,b=Math.imul(Ce,je),p=Math.imul(Ce,ze),p=p+Math.imul(Le,je)|0,I=Math.imul(Le,ze),b=b+Math.imul(Be,Ke)|0,p=p+Math.imul(Be,Ve)|0,p=p+Math.imul(ke,Ke)|0,I=I+Math.imul(ke,Ve)|0,b=b+Math.imul(be,Ge)|0,p=p+Math.imul(be,Ze)|0,p=p+Math.imul(_e,Ge)|0,I=I+Math.imul(_e,Ze)|0,b=b+Math.imul(xe,We)|0,p=p+Math.imul(xe,Ye)|0,p=p+Math.imul(ye,We)|0,I=I+Math.imul(ye,Ye)|0,b=b+Math.imul(ge,$e)|0,p=p+Math.imul(ge,Xe)|0,p=p+Math.imul(ve,$e)|0,I=I+Math.imul(ve,Xe)|0,b=b+Math.imul(ue,Je)|0,p=p+Math.imul(ue,Qe)|0,p=p+Math.imul(le,Je)|0,I=I+Math.imul(le,Qe)|0,b=b+Math.imul($,et)|0,p=p+Math.imul($,tt)|0,p=p+Math.imul(ee,et)|0,I=I+Math.imul(ee,tt)|0,b=b+Math.imul(pe,rt)|0,p=p+Math.imul(pe,it)|0,p=p+Math.imul(q,rt)|0,I=I+Math.imul(q,it)|0;var ou=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(ou>>>26)|0,ou&=67108863,b=Math.imul(Ce,Ke),p=Math.imul(Ce,Ve),p=p+Math.imul(Le,Ke)|0,I=Math.imul(Le,Ve),b=b+Math.imul(Be,Ge)|0,p=p+Math.imul(Be,Ze)|0,p=p+Math.imul(ke,Ge)|0,I=I+Math.imul(ke,Ze)|0,b=b+Math.imul(be,We)|0,p=p+Math.imul(be,Ye)|0,p=p+Math.imul(_e,We)|0,I=I+Math.imul(_e,Ye)|0,b=b+Math.imul(xe,$e)|0,p=p+Math.imul(xe,Xe)|0,p=p+Math.imul(ye,$e)|0,I=I+Math.imul(ye,Xe)|0,b=b+Math.imul(ge,Je)|0,p=p+Math.imul(ge,Qe)|0,p=p+Math.imul(ve,Je)|0,I=I+Math.imul(ve,Qe)|0,b=b+Math.imul(ue,et)|0,p=p+Math.imul(ue,tt)|0,p=p+Math.imul(le,et)|0,I=I+Math.imul(le,tt)|0,b=b+Math.imul($,rt)|0,p=p+Math.imul($,it)|0,p=p+Math.imul(ee,rt)|0,I=I+Math.imul(ee,it)|0;var au=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(au>>>26)|0,au&=67108863,b=Math.imul(Ce,Ge),p=Math.imul(Ce,Ze),p=p+Math.imul(Le,Ge)|0,I=Math.imul(Le,Ze),b=b+Math.imul(Be,We)|0,p=p+Math.imul(Be,Ye)|0,p=p+Math.imul(ke,We)|0,I=I+Math.imul(ke,Ye)|0,b=b+Math.imul(be,$e)|0,p=p+Math.imul(be,Xe)|0,p=p+Math.imul(_e,$e)|0,I=I+Math.imul(_e,Xe)|0,b=b+Math.imul(xe,Je)|0,p=p+Math.imul(xe,Qe)|0,p=p+Math.imul(ye,Je)|0,I=I+Math.imul(ye,Qe)|0,b=b+Math.imul(ge,et)|0,p=p+Math.imul(ge,tt)|0,p=p+Math.imul(ve,et)|0,I=I+Math.imul(ve,tt)|0,b=b+Math.imul(ue,rt)|0,p=p+Math.imul(ue,it)|0,p=p+Math.imul(le,rt)|0,I=I+Math.imul(le,it)|0;var su=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(su>>>26)|0,su&=67108863,b=Math.imul(Ce,We),p=Math.imul(Ce,Ye),p=p+Math.imul(Le,We)|0,I=Math.imul(Le,Ye),b=b+Math.imul(Be,$e)|0,p=p+Math.imul(Be,Xe)|0,p=p+Math.imul(ke,$e)|0,I=I+Math.imul(ke,Xe)|0,b=b+Math.imul(be,Je)|0,p=p+Math.imul(be,Qe)|0,p=p+Math.imul(_e,Je)|0,I=I+Math.imul(_e,Qe)|0,b=b+Math.imul(xe,et)|0,p=p+Math.imul(xe,tt)|0,p=p+Math.imul(ye,et)|0,I=I+Math.imul(ye,tt)|0,b=b+Math.imul(ge,rt)|0,p=p+Math.imul(ge,it)|0,p=p+Math.imul(ve,rt)|0,I=I+Math.imul(ve,it)|0;var uu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(uu>>>26)|0,uu&=67108863,b=Math.imul(Ce,$e),p=Math.imul(Ce,Xe),p=p+Math.imul(Le,$e)|0,I=Math.imul(Le,Xe),b=b+Math.imul(Be,Je)|0,p=p+Math.imul(Be,Qe)|0,p=p+Math.imul(ke,Je)|0,I=I+Math.imul(ke,Qe)|0,b=b+Math.imul(be,et)|0,p=p+Math.imul(be,tt)|0,p=p+Math.imul(_e,et)|0,I=I+Math.imul(_e,tt)|0,b=b+Math.imul(xe,rt)|0,p=p+Math.imul(xe,it)|0,p=p+Math.imul(ye,rt)|0,I=I+Math.imul(ye,it)|0;var fu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(fu>>>26)|0,fu&=67108863,b=Math.imul(Ce,Je),p=Math.imul(Ce,Qe),p=p+Math.imul(Le,Je)|0,I=Math.imul(Le,Qe),b=b+Math.imul(Be,et)|0,p=p+Math.imul(Be,tt)|0,p=p+Math.imul(ke,et)|0,I=I+Math.imul(ke,tt)|0,b=b+Math.imul(be,rt)|0,p=p+Math.imul(be,it)|0,p=p+Math.imul(_e,rt)|0,I=I+Math.imul(_e,it)|0;var cu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(cu>>>26)|0,cu&=67108863,b=Math.imul(Ce,et),p=Math.imul(Ce,tt),p=p+Math.imul(Le,et)|0,I=Math.imul(Le,tt),b=b+Math.imul(Be,rt)|0,p=p+Math.imul(Be,it)|0,p=p+Math.imul(ke,rt)|0,I=I+Math.imul(ke,it)|0;var lu=(x+b|0)+((p&8191)<<13)|0;x=(I+(p>>>13)|0)+(lu>>>26)|0,lu&=67108863,b=Math.imul(Ce,rt),p=Math.imul(Ce,it),p=p+Math.imul(Le,rt)|0,I=Math.imul(Le,it);var hu=(x+b|0)+((p&8191)<<13)|0;return x=(I+(p>>>13)|0)+(hu>>>26)|0,hu&=67108863,_[0]=Wf,_[1]=Jt,_[2]=Qt,_[3]=Xs,_[4]=Js,_[5]=Qs,_[6]=eu,_[7]=tu,_[8]=ru,_[9]=iu,_[10]=nu,_[11]=ou,_[12]=au,_[13]=su,_[14]=uu,_[15]=fu,_[16]=cu,_[17]=lu,_[18]=hu,x!==0&&(_[19]=x,y.length++),y};Math.imul||(P=E);function M(B,g,O){O.negative=g.negative^B.negative,O.length=B.length+g.length;for(var y=0,f=0,d=0;d<O.length-1;d++){var _=f;f=0;for(var x=y&67108863,b=Math.min(d,g.length-1),p=Math.max(0,d-B.length+1);p<=b;p++){var I=d-p,T=B.words[I]|0,S=g.words[p]|0,R=T*S,Y=R&67108863;_=_+(R/67108864|0)|0,Y=Y+x|0,x=Y&67108863,_=_+(Y>>>26)|0,f+=_>>>26,_&=67108863}O.words[d]=x,y=_,_=f}return y!==0?O.words[d]=y:O.length--,O.strip()}function D(B,g,O){var y=new L;return y.mulp(B,g,O)}n.prototype.mulTo=function(g,O){var y,f=this.length+g.length;return this.length===10&&g.length===10?y=P(this,g,O):f<63?y=E(this,g,O):f<1024?y=M(this,g,O):y=D(this,g,O),y};function L(B,g){this.x=B,this.y=g}L.prototype.makeRBT=function(g){for(var O=new Array(g),y=n.prototype._countBits(g)-1,f=0;f<g;f++)O[f]=this.revBin(f,y,g);return O},L.prototype.revBin=function(g,O,y){if(g===0||g===y-1)return g;for(var f=0,d=0;d<O;d++)f|=(g&1)<<O-d-1,g>>=1;return f},L.prototype.permute=function(g,O,y,f,d,_){for(var x=0;x<_;x++)f[x]=O[g[x]],d[x]=y[g[x]]},L.prototype.transform=function(g,O,y,f,d,_){this.permute(_,g,O,y,f,d);for(var x=1;x<d;x<<=1)for(var b=x<<1,p=Math.cos(2*Math.PI/b),I=Math.sin(2*Math.PI/b),T=0;T<d;T+=b)for(var S=p,R=I,Y=0;Y<x;Y++){var X=y[T+Y],ne=f[T+Y],ce=y[T+Y+x],pe=f[T+Y+x],q=S*ce-R*pe;pe=S*pe+R*ce,ce=q,y[T+Y]=X+ce,f[T+Y]=ne+pe,y[T+Y+x]=X-ce,f[T+Y+x]=ne-pe,Y!==b&&(q=p*S-I*R,R=p*R+I*S,S=q)}},L.prototype.guessLen13b=function(g,O){var y=Math.max(O,g)|1,f=y&1,d=0;for(y=y/2|0;y;y=y>>>1)d++;return 1<<d+1+f},L.prototype.conjugate=function(g,O,y){if(!(y<=1))for(var f=0;f<y/2;f++){var d=g[f];g[f]=g[y-f-1],g[y-f-1]=d,d=O[f],O[f]=-O[y-f-1],O[y-f-1]=-d}},L.prototype.normalize13b=function(g,O){for(var y=0,f=0;f<O/2;f++){var d=Math.round(g[2*f+1]/O)*8192+Math.round(g[2*f]/O)+y;g[f]=d&67108863,d<67108864?y=0:y=d/67108864|0}return g},L.prototype.convert13b=function(g,O,y,f){for(var d=0,_=0;_<O;_++)d=d+(g[_]|0),y[2*_]=d&8191,d=d>>>13,y[2*_+1]=d&8191,d=d>>>13;for(_=2*O;_<f;++_)y[_]=0;r(d===0),r((d&-8192)===0)},L.prototype.stub=function(g){for(var O=new Array(g),y=0;y<g;y++)O[y]=0;return O},L.prototype.mulp=function(g,O,y){var f=2*this.guessLen13b(g.length,O.length),d=this.makeRBT(f),_=this.stub(f),x=new Array(f),b=new Array(f),p=new Array(f),I=new Array(f),T=new Array(f),S=new Array(f),R=y.words;R.length=f,this.convert13b(g.words,g.length,x,f),this.convert13b(O.words,O.length,I,f),this.transform(x,_,b,p,f,d),this.transform(I,_,T,S,f,d);for(var Y=0;Y<f;Y++){var X=b[Y]*T[Y]-p[Y]*S[Y];p[Y]=b[Y]*S[Y]+p[Y]*T[Y],b[Y]=X}return this.conjugate(b,p,f),this.transform(b,p,R,_,f,d),this.conjugate(R,_,f),this.normalize13b(R,f),y.negative=g.negative^O.negative,y.length=g.length+O.length,y.strip()},n.prototype.mul=function(g){var O=new n(null);return O.words=new Array(this.length+g.length),this.mulTo(g,O)},n.prototype.mulf=function(g){var O=new n(null);return O.words=new Array(this.length+g.length),D(this,g,O)},n.prototype.imul=function(g){return this.clone().mulTo(g,this)},n.prototype.imuln=function(g){r(typeof g=="number"),r(g<67108864);for(var O=0,y=0;y<this.length;y++){var f=(this.words[y]|0)*g,d=(f&67108863)+(O&67108863);O>>=26,O+=f/67108864|0,O+=d>>>26,this.words[y]=d&67108863}return O!==0&&(this.words[y]=O,this.length++),this.length=g===0?1:this.length,this},n.prototype.muln=function(g){return this.clone().imuln(g)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(g){var O=w(g);if(O.length===0)return new n(1);for(var y=this,f=0;f<O.length&&O[f]===0;f++,y=y.sqr());if(++f<O.length)for(var d=y.sqr();f<O.length;f++,d=d.sqr())O[f]!==0&&(y=y.mul(d));return y},n.prototype.iushln=function(g){r(typeof g=="number"&&g>=0);var O=g%26,y=(g-O)/26,f=67108863>>>26-O<<26-O,d;if(O!==0){var _=0;for(d=0;d<this.length;d++){var x=this.words[d]&f,b=(this.words[d]|0)-x<<O;this.words[d]=b|_,_=x>>>26-O}_&&(this.words[d]=_,this.length++)}if(y!==0){for(d=this.length-1;d>=0;d--)this.words[d+y]=this.words[d];for(d=0;d<y;d++)this.words[d]=0;this.length+=y}return this.strip()},n.prototype.ishln=function(g){return r(this.negative===0),this.iushln(g)},n.prototype.iushrn=function(g,O,y){r(typeof g=="number"&&g>=0);var f;O?f=(O-O%26)/26:f=0;var d=g%26,_=Math.min((g-d)/26,this.length),x=67108863^67108863>>>d<<d,b=y;if(f-=_,f=Math.max(0,f),b){for(var p=0;p<_;p++)b.words[p]=this.words[p];b.length=_}if(_!==0)if(this.length>_)for(this.length-=_,p=0;p<this.length;p++)this.words[p]=this.words[p+_];else this.words[0]=0,this.length=1;var I=0;for(p=this.length-1;p>=0&&(I!==0||p>=f);p--){var T=this.words[p]|0;this.words[p]=I<<26-d|T>>>d,I=T&x}return b&&I!==0&&(b.words[b.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(g,O,y){return r(this.negative===0),this.iushrn(g,O,y)},n.prototype.shln=function(g){return this.clone().ishln(g)},n.prototype.ushln=function(g){return this.clone().iushln(g)},n.prototype.shrn=function(g){return this.clone().ishrn(g)},n.prototype.ushrn=function(g){return this.clone().iushrn(g)},n.prototype.testn=function(g){r(typeof g=="number"&&g>=0);var O=g%26,y=(g-O)/26,f=1<<O;if(this.length<=y)return!1;var d=this.words[y];return!!(d&f)},n.prototype.imaskn=function(g){r(typeof g=="number"&&g>=0);var O=g%26,y=(g-O)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(O!==0&&y++,this.length=Math.min(y,this.length),O!==0){var f=67108863^67108863>>>O<<O;this.words[this.length-1]&=f}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(g){return this.clone().imaskn(g)},n.prototype.iaddn=function(g){return r(typeof g=="number"),r(g<67108864),g<0?this.isubn(-g):this.negative!==0?this.length===1&&(this.words[0]|0)<g?(this.words[0]=g-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(g),this.negative=1,this):this._iaddn(g)},n.prototype._iaddn=function(g){this.words[0]+=g;for(var O=0;O<this.length&&this.words[O]>=67108864;O++)this.words[O]-=67108864,O===this.length-1?this.words[O+1]=1:this.words[O+1]++;return this.length=Math.max(this.length,O+1),this},n.prototype.isubn=function(g){if(r(typeof g=="number"),r(g<67108864),g<0)return this.iaddn(-g);if(this.negative!==0)return this.negative=0,this.iaddn(g),this.negative=1,this;if(this.words[0]-=g,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var O=0;O<this.length&&this.words[O]<0;O++)this.words[O]+=67108864,this.words[O+1]-=1;return this.strip()},n.prototype.addn=function(g){return this.clone().iaddn(g)},n.prototype.subn=function(g){return this.clone().isubn(g)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(g,O,y){var f=g.length+y,d;this._expand(f);var _,x=0;for(d=0;d<g.length;d++){_=(this.words[d+y]|0)+x;var b=(g.words[d]|0)*O;_-=b&67108863,x=(_>>26)-(b/67108864|0),this.words[d+y]=_&67108863}for(;d<this.length-y;d++)_=(this.words[d+y]|0)+x,x=_>>26,this.words[d+y]=_&67108863;if(x===0)return this.strip();for(r(x===-1),x=0,d=0;d<this.length;d++)_=-(this.words[d]|0)+x,x=_>>26,this.words[d]=_&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(g,O){var y=this.length-g.length,f=this.clone(),d=g,_=d.words[d.length-1]|0,x=this._countBits(_);y=26-x,y!==0&&(d=d.ushln(y),f.iushln(y),_=d.words[d.length-1]|0);var b=f.length-d.length,p;if(O!=="mod"){p=new n(null),p.length=b+1,p.words=new Array(p.length);for(var I=0;I<p.length;I++)p.words[I]=0}var T=f.clone()._ishlnsubmul(d,1,b);T.negative===0&&(f=T,p&&(p.words[b]=1));for(var S=b-1;S>=0;S--){var R=(f.words[d.length+S]|0)*67108864+(f.words[d.length+S-1]|0);for(R=Math.min(R/_|0,67108863),f._ishlnsubmul(d,R,S);f.negative!==0;)R--,f.negative=0,f._ishlnsubmul(d,1,S),f.isZero()||(f.negative^=1);p&&(p.words[S]=R)}return p&&p.strip(),f.strip(),O!=="div"&&y!==0&&f.iushrn(y),{div:p||null,mod:f}},n.prototype.divmod=function(g,O,y){if(r(!g.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,d,_;return this.negative!==0&&g.negative===0?(_=this.neg().divmod(g,O),O!=="mod"&&(f=_.div.neg()),O!=="div"&&(d=_.mod.neg(),y&&d.negative!==0&&d.iadd(g)),{div:f,mod:d}):this.negative===0&&g.negative!==0?(_=this.divmod(g.neg(),O),O!=="mod"&&(f=_.div.neg()),{div:f,mod:_.mod}):(this.negative&g.negative)!==0?(_=this.neg().divmod(g.neg(),O),O!=="div"&&(d=_.mod.neg(),y&&d.negative!==0&&d.isub(g)),{div:_.div,mod:d}):g.length>this.length||this.cmp(g)<0?{div:new n(0),mod:this}:g.length===1?O==="div"?{div:this.divn(g.words[0]),mod:null}:O==="mod"?{div:null,mod:new n(this.modn(g.words[0]))}:{div:this.divn(g.words[0]),mod:new n(this.modn(g.words[0]))}:this._wordDiv(g,O)},n.prototype.div=function(g){return this.divmod(g,"div",!1).div},n.prototype.mod=function(g){return this.divmod(g,"mod",!1).mod},n.prototype.umod=function(g){return this.divmod(g,"mod",!0).mod},n.prototype.divRound=function(g){var O=this.divmod(g);if(O.mod.isZero())return O.div;var y=O.div.negative!==0?O.mod.isub(g):O.mod,f=g.ushrn(1),d=g.andln(1),_=y.cmp(f);return _<0||d===1&&_===0?O.div:O.div.negative!==0?O.div.isubn(1):O.div.iaddn(1)},n.prototype.modn=function(g){r(g<=67108863);for(var O=(1<<26)%g,y=0,f=this.length-1;f>=0;f--)y=(O*y+(this.words[f]|0))%g;return y},n.prototype.idivn=function(g){r(g<=67108863);for(var O=0,y=this.length-1;y>=0;y--){var f=(this.words[y]|0)+O*67108864;this.words[y]=f/g|0,O=f%g}return this.strip()},n.prototype.divn=function(g){return this.clone().idivn(g)},n.prototype.egcd=function(g){r(g.negative===0),r(!g.isZero());var O=this,y=g.clone();O.negative!==0?O=O.umod(g):O=O.clone();for(var f=new n(1),d=new n(0),_=new n(0),x=new n(1),b=0;O.isEven()&&y.isEven();)O.iushrn(1),y.iushrn(1),++b;for(var p=y.clone(),I=O.clone();!O.isZero();){for(var T=0,S=1;(O.words[0]&S)===0&&T<26;++T,S<<=1);if(T>0)for(O.iushrn(T);T-- >0;)(f.isOdd()||d.isOdd())&&(f.iadd(p),d.isub(I)),f.iushrn(1),d.iushrn(1);for(var R=0,Y=1;(y.words[0]&Y)===0&&R<26;++R,Y<<=1);if(R>0)for(y.iushrn(R);R-- >0;)(_.isOdd()||x.isOdd())&&(_.iadd(p),x.isub(I)),_.iushrn(1),x.iushrn(1);O.cmp(y)>=0?(O.isub(y),f.isub(_),d.isub(x)):(y.isub(O),_.isub(f),x.isub(d))}return{a:_,b:x,gcd:y.iushln(b)}},n.prototype._invmp=function(g){r(g.negative===0),r(!g.isZero());var O=this,y=g.clone();O.negative!==0?O=O.umod(g):O=O.clone();for(var f=new n(1),d=new n(0),_=y.clone();O.cmpn(1)>0&&y.cmpn(1)>0;){for(var x=0,b=1;(O.words[0]&b)===0&&x<26;++x,b<<=1);if(x>0)for(O.iushrn(x);x-- >0;)f.isOdd()&&f.iadd(_),f.iushrn(1);for(var p=0,I=1;(y.words[0]&I)===0&&p<26;++p,I<<=1);if(p>0)for(y.iushrn(p);p-- >0;)d.isOdd()&&d.iadd(_),d.iushrn(1);O.cmp(y)>=0?(O.isub(y),f.isub(d)):(y.isub(O),d.isub(f))}var T;return O.cmpn(1)===0?T=f:T=d,T.cmpn(0)<0&&T.iadd(g),T},n.prototype.gcd=function(g){if(this.isZero())return g.abs();if(g.isZero())return this.abs();var O=this.clone(),y=g.clone();O.negative=0,y.negative=0;for(var f=0;O.isEven()&&y.isEven();f++)O.iushrn(1),y.iushrn(1);do{for(;O.isEven();)O.iushrn(1);for(;y.isEven();)y.iushrn(1);var d=O.cmp(y);if(d<0){var _=O;O=y,y=_}else if(d===0||y.cmpn(1)===0)break;O.isub(y)}while(!0);return y.iushln(f)},n.prototype.invm=function(g){return this.egcd(g).a.umod(g)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(g){return this.words[0]&g},n.prototype.bincn=function(g){r(typeof g=="number");var O=g%26,y=(g-O)/26,f=1<<O;if(this.length<=y)return this._expand(y+1),this.words[y]|=f,this;for(var d=f,_=y;d!==0&&_<this.length;_++){var x=this.words[_]|0;x+=d,d=x>>>26,x&=67108863,this.words[_]=x}return d!==0&&(this.words[_]=d,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(g){var O=g<0;if(this.negative!==0&&!O)return-1;if(this.negative===0&&O)return 1;this.strip();var y;if(this.length>1)y=1;else{O&&(g=-g),r(g<=67108863,"Number is too big");var f=this.words[0]|0;y=f===g?0:f<g?-1:1}return this.negative!==0?-y|0:y},n.prototype.cmp=function(g){if(this.negative!==0&&g.negative===0)return-1;if(this.negative===0&&g.negative!==0)return 1;var O=this.ucmp(g);return this.negative!==0?-O|0:O},n.prototype.ucmp=function(g){if(this.length>g.length)return 1;if(this.length<g.length)return-1;for(var O=0,y=this.length-1;y>=0;y--){var f=this.words[y]|0,d=g.words[y]|0;if(f!==d){f<d?O=-1:f>d&&(O=1);break}}return O},n.prototype.gtn=function(g){return this.cmpn(g)===1},n.prototype.gt=function(g){return this.cmp(g)===1},n.prototype.gten=function(g){return this.cmpn(g)>=0},n.prototype.gte=function(g){return this.cmp(g)>=0},n.prototype.ltn=function(g){return this.cmpn(g)===-1},n.prototype.lt=function(g){return this.cmp(g)===-1},n.prototype.lten=function(g){return this.cmpn(g)<=0},n.prototype.lte=function(g){return this.cmp(g)<=0},n.prototype.eqn=function(g){return this.cmpn(g)===0},n.prototype.eq=function(g){return this.cmp(g)===0},n.red=function(g){return new z(g)},n.prototype.toRed=function(g){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),g.convertTo(this)._forceRed(g)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(g){return this.red=g,this},n.prototype.forceRed=function(g){return r(!this.red,"Already a number in reduction context"),this._forceRed(g)},n.prototype.redAdd=function(g){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,g)},n.prototype.redIAdd=function(g){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,g)},n.prototype.redSub=function(g){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,g)},n.prototype.redISub=function(g){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,g)},n.prototype.redShl=function(g){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,g)},n.prototype.redMul=function(g){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.mul(this,g)},n.prototype.redIMul=function(g){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.imul(this,g)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(g){return r(this.red&&!g.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,g)};var U={k256:null,p224:null,p192:null,p25519:null};function K(B,g){this.name=B,this.p=new n(g,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}K.prototype._tmp=function(){var g=new n(null);return g.words=new Array(Math.ceil(this.n/13)),g},K.prototype.ireduce=function(g){var O=g,y;do this.split(O,this.tmp),O=this.imulK(O),O=O.iadd(this.tmp),y=O.bitLength();while(y>this.n);var f=y<this.n?-1:O.ucmp(this.p);return f===0?(O.words[0]=0,O.length=1):f>0?O.isub(this.p):O.strip!==void 0?O.strip():O._strip(),O},K.prototype.split=function(g,O){g.iushrn(this.n,0,O)},K.prototype.imulK=function(g){return g.imul(this.k)};function N(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(N,K),N.prototype.split=function(g,O){for(var y=4194303,f=Math.min(g.length,9),d=0;d<f;d++)O.words[d]=g.words[d];if(O.length=f,g.length<=9){g.words[0]=0,g.length=1;return}var _=g.words[9];for(O.words[O.length++]=_&y,d=10;d<g.length;d++){var x=g.words[d]|0;g.words[d-10]=(x&y)<<4|_>>>22,_=x}_>>>=22,g.words[d-10]=_,_===0&&g.length>10?g.length-=10:g.length-=9},N.prototype.imulK=function(g){g.words[g.length]=0,g.words[g.length+1]=0,g.length+=2;for(var O=0,y=0;y<g.length;y++){var f=g.words[y]|0;O+=f*977,g.words[y]=O&67108863,O=f*64+(O/67108864|0)}return g.words[g.length-1]===0&&(g.length--,g.words[g.length-1]===0&&g.length--),g};function C(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(C,K);function F(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(F,K);function H(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(H,K),H.prototype.imulK=function(g){for(var O=0,y=0;y<g.length;y++){var f=(g.words[y]|0)*19+O,d=f&67108863;f>>>=26,g.words[y]=d,O=f}return O!==0&&(g.words[g.length++]=O),g},n._prime=function(g){if(U[g])return U[g];var O;if(g==="k256")O=new N;else if(g==="p224")O=new C;else if(g==="p192")O=new F;else if(g==="p25519")O=new H;else throw new Error("Unknown prime "+g);return U[g]=O,O};function z(B){if(typeof B=="string"){var g=n._prime(B);this.m=g.p,this.prime=g}else r(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}z.prototype._verify1=function(g){r(g.negative===0,"red works only with positives"),r(g.red,"red works only with red numbers")},z.prototype._verify2=function(g,O){r((g.negative|O.negative)===0,"red works only with positives"),r(g.red&&g.red===O.red,"red works only with red numbers")},z.prototype.imod=function(g){return this.prime?this.prime.ireduce(g)._forceRed(this):g.umod(this.m)._forceRed(this)},z.prototype.neg=function(g){return g.isZero()?g.clone():this.m.sub(g)._forceRed(this)},z.prototype.add=function(g,O){this._verify2(g,O);var y=g.add(O);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},z.prototype.iadd=function(g,O){this._verify2(g,O);var y=g.iadd(O);return y.cmp(this.m)>=0&&y.isub(this.m),y},z.prototype.sub=function(g,O){this._verify2(g,O);var y=g.sub(O);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},z.prototype.isub=function(g,O){this._verify2(g,O);var y=g.isub(O);return y.cmpn(0)<0&&y.iadd(this.m),y},z.prototype.shl=function(g,O){return this._verify1(g),this.imod(g.ushln(O))},z.prototype.imul=function(g,O){return this._verify2(g,O),this.imod(g.imul(O))},z.prototype.mul=function(g,O){return this._verify2(g,O),this.imod(g.mul(O))},z.prototype.isqr=function(g){return this.imul(g,g.clone())},z.prototype.sqr=function(g){return this.mul(g,g)},z.prototype.sqrt=function(g){if(g.isZero())return g.clone();var O=this.m.andln(3);if(r(O%2===1),O===3){var y=this.m.add(new n(1)).iushrn(2);return this.pow(g,y)}for(var f=this.m.subn(1),d=0;!f.isZero()&&f.andln(1)===0;)d++,f.iushrn(1);r(!f.isZero());var _=new n(1).toRed(this),x=_.redNeg(),b=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new n(2*p*p).toRed(this);this.pow(p,b).cmp(x)!==0;)p.redIAdd(x);for(var I=this.pow(p,f),T=this.pow(g,f.addn(1).iushrn(1)),S=this.pow(g,f),R=d;S.cmp(_)!==0;){for(var Y=S,X=0;Y.cmp(_)!==0;X++)Y=Y.redSqr();r(X<R);var ne=this.pow(I,new n(1).iushln(R-X-1));T=T.redMul(ne),I=ne.redSqr(),S=S.redMul(I),R=X}return T},z.prototype.invm=function(g){var O=g._invmp(this.m);return O.negative!==0?(O.negative=0,this.imod(O).redNeg()):this.imod(O)},z.prototype.pow=function(g,O){if(O.isZero())return new n(1).toRed(this);if(O.cmpn(1)===0)return g.clone();var y=4,f=new Array(1<<y);f[0]=new n(1).toRed(this),f[1]=g;for(var d=2;d<f.length;d++)f[d]=this.mul(f[d-1],g);var _=f[0],x=0,b=0,p=O.bitLength()%26;for(p===0&&(p=26),d=O.length-1;d>=0;d--){for(var I=O.words[d],T=p-1;T>=0;T--){var S=I>>T&1;if(_!==f[0]&&(_=this.sqr(_)),S===0&&x===0){b=0;continue}x<<=1,x|=S,b++,!(b!==y&&(d!==0||T!==0))&&(_=this.mul(_,f[x]),b=0,x=0)}p=26}return _},z.prototype.convertTo=function(g){var O=g.umod(this.m);return O===g?O.clone():O},z.prototype.convertFrom=function(g){var O=g.clone();return O.red=null,O},n.mont=function(g){return new G(g)};function G(B){z.call(this,B),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(G,z),G.prototype.convertTo=function(g){return this.imod(g.ushln(this.shift))},G.prototype.convertFrom=function(g){var O=this.imod(g.mul(this.rinv));return O.red=null,O},G.prototype.imul=function(g,O){if(g.isZero()||O.isZero())return g.words[0]=0,g.length=1,g;var y=g.imul(O),f=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=y.isub(f).iushrn(this.shift),_=d;return d.cmp(this.m)>=0?_=d.isub(this.m):d.cmpn(0)<0&&(_=d.iadd(this.m)),_._forceRed(this)},G.prototype.mul=function(g,O){if(g.isZero()||O.isZero())return new n(0)._forceRed(this);var y=g.mul(O),f=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=y.isub(f).iushrn(this.shift),_=d;return d.cmp(this.m)>=0?_=d.isub(this.m):d.cmpn(0)<0&&(_=d.iadd(this.m)),_._forceRed(this)},G.prototype.invm=function(g){var O=this.imod(g._invmp(this.m).mul(this.r2));return O._forceRed(this)}})(typeof sm>"u"||sm,kE)});var RE=k((R0e,cm)=>{v();var um;cm.exports=function(t){return um||(um=new hs(null)),um.generate(t)};function hs(e){this.rand=e}cm.exports.Rand=hs;hs.prototype.generate=function(t){return this._rand(t)};hs.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?hs.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?hs.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(hs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(fm=_r(),typeof fm.randomBytes!="function")throw new Error("Not supported");hs.prototype._rand=function(t){return fm.randomBytes(t)}}catch{}var fm});var lm=k((M0e,BE)=>{v();var Hu=Nn(),PW=RE();function ju(e){this.rand=e||new PW.Rand}BE.exports=ju;ju.create=function(t){return new ju(t)};ju.prototype._randbelow=function(t){var r=t.bitLength(),i=Math.ceil(r/8);do var n=new Hu(this.rand.generate(i));while(n.cmp(t)>=0);return n};ju.prototype._randrange=function(t,r){var i=r.sub(t);return t.add(this._randbelow(i))};ju.prototype.test=function(t,r,i){var n=t.bitLength(),o=Hu.mont(t),a=new Hu(1).toRed(o);r||(r=Math.max(1,n/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var c=t.shrn(u),l=s.toRed(o),m=!0;r>0;r--){var w=this._randrange(new Hu(2),s);i&&i(w);var E=w.toRed(o).redPow(c);if(!(E.cmp(a)===0||E.cmp(l)===0)){for(var P=1;P<u;P++){if(E=E.redSqr(),E.cmp(a)===0)return!1;if(E.cmp(l)===0)break}if(P===u)return!1}}return m};ju.prototype.getDivisor=function(t,r){var i=t.bitLength(),n=Hu.mont(t),o=new Hu(1).toRed(n);r||(r=Math.max(1,i/48|0));for(var a=t.subn(1),s=0;!a.testn(s);s++);for(var u=t.shrn(s),c=a.toRed(n);r>0;r--){var l=this._randrange(new Hu(2),a),m=t.gcd(l);if(m.cmpn(1)!==0)return m;var w=l.toRed(n).redPow(u);if(!(w.cmp(o)===0||w.cmp(c)===0)){for(var E=1;E<s;E++){if(w=w.redSqr(),w.cmp(o)===0)return w.fromRed().subn(1).gcd(t);if(w.cmp(c)===0)break}if(E===s)return w=w.redSqr(),w.fromRed().subn(1).gcd(t)}}return!1}});var mm=k((U0e,CE)=>{v();var TW=mu();CE.exports=vm;vm.simpleSieve=pm;vm.fermatTest=gm;var Jr=Nn(),kW=new Jr(24),RW=lm(),ME=new RW,BW=new Jr(1),dm=new Jr(2),MW=new Jr(5),C0e=new Jr(16),D0e=new Jr(8),NW=new Jr(10),CW=new Jr(3),L0e=new Jr(7),DW=new Jr(11),NE=new Jr(4),q0e=new Jr(12),hm=null;function LW(){if(hm!==null)return hm;var e=1048576,t=[];t[0]=2;for(var r=1,i=3;i<e;i+=2){for(var n=Math.ceil(Math.sqrt(i)),o=0;o<r&&t[o]<=n&&i%t[o]!==0;o++);r!==o&&t[o]<=n||(t[r++]=i)}return hm=t,t}function pm(e){for(var t=LW(),r=0;r<t.length;r++)if(e.modn(t[r])===0)return e.cmpn(t[r])===0;return!0}function gm(e){var t=Jr.mont(e);return dm.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)===0}function vm(e,t){if(e<16)return t===2||t===5?new Jr([140,123]):new Jr([140,39]);t=new Jr(t);for(var r,i;;){for(r=new Jr(TW(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(BW),r.testn(1)||r.iadd(dm),t.cmp(dm)){if(!t.cmp(MW))for(;r.mod(NW).cmp(CW);)r.iadd(NE)}else for(;r.mod(kW).cmp(DW);)r.iadd(NE);if(i=r.shrn(1),pm(i)&&pm(r)&&gm(i)&&gm(r)&&ME.test(i)&&ME.test(r))return r}}});var DE=k((H0e,qW)=>{qW.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}});var FE=k((j0e,UE)=>{v();var fn=Nn(),UW=lm(),LE=new UW,FW=new fn(24),HW=new fn(11),jW=new fn(10),zW=new fn(3),KW=new fn(7),qE=mm(),VW=mu();UE.exports=ba;function GW(e,t){return t=t||"utf8",h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),this._pub=new fn(e),this}function ZW(e,t){return t=t||"utf8",h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),this._priv=new fn(e),this}var U2={};function WW(e,t){var r=t.toString("hex"),i=[r,e.toString(16)].join("_");if(i in U2)return U2[i];var n=0;if(e.isEven()||!qE.simpleSieve||!qE.fermatTest(e)||!LE.test(e))return n+=1,r==="02"||r==="05"?n+=8:n+=4,U2[i]=n,n;LE.test(e.shrn(1))||(n+=2);var o;switch(r){case"02":e.mod(FW).cmp(HW)&&(n+=8);break;case"05":o=e.mod(jW),o.cmp(zW)&&o.cmp(KW)&&(n+=8);break;default:n+=4}return U2[i]=n,n}function ba(e,t,r){this.setGenerator(t),this.__prime=new fn(e),this._prime=fn.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=GW,this.setPrivateKey=ZW):this._primeCode=8}Object.defineProperty(ba.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=WW(this.__prime,this.__gen)),this._primeCode}});ba.prototype.generateKeys=function(){return this._priv||(this._priv=new fn(VW(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()};ba.prototype.computeSecret=function(e){e=new fn(e),e=e.toRed(this._prime);var t=e.redPow(this._priv).fromRed(),r=new h.Buffer(t.toArray()),i=this.getPrime();if(r.length<i.length){var n=new h.Buffer(i.length-r.length);n.fill(0),r=h.Buffer.concat([n,r])}return r};ba.prototype.getPublicKey=function(t){return F2(this._pub,t)};ba.prototype.getPrivateKey=function(t){return F2(this._priv,t)};ba.prototype.getPrime=function(e){return F2(this.__prime,e)};ba.prototype.getGenerator=function(e){return F2(this._gen,e)};ba.prototype.setGenerator=function(e,t){return t=t||"utf8",h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),this.__gen=e,this._gen=new fn(e),this};function F2(e,t){var r=new h.Buffer(e.toArray());return t?r.toString(t):r}});var zE=k(Ac=>{v();var YW=mm(),HE=DE(),ym=FE();function $W(e){var t=new h.Buffer(HE[e].prime,"hex"),r=new h.Buffer(HE[e].gen,"hex");return new ym(t,r)}var XW={binary:!0,hex:!0,base64:!0};function jE(e,t,r,i){return h.Buffer.isBuffer(t)||XW[t]===void 0?jE(e,"binary",t,r):(t=t||"binary",i=i||"binary",r=r||new h.Buffer([2]),h.Buffer.isBuffer(r)||(r=new h.Buffer(r,i)),typeof e=="number"?new ym(YW(e,r),r,!0):(h.Buffer.isBuffer(e)||(e=new h.Buffer(e,t)),new ym(e,r,!0)))}Ac.DiffieHellmanGroup=Ac.createDiffieHellmanGroup=Ac.getDiffieHellman=$W;Ac.createDiffieHellman=Ac.DiffieHellman=jE});var KE=k((exports,module)=>{v();var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch{return function(t,r,i){t[r]=i}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,i=r.eval,n=r.execScript;!i&&n&&(n.call(r,"null"),i=r.eval),forEach(Object_keys(e),function(s){r[s]=e[s]}),forEach(globals,function(s){e[s]&&(r[s]=e[s])});var o=Object_keys(r),a=i.call(r,this.code);return forEach(Object_keys(r),function(s){(s in e||indexOf(o,s)===-1)&&(e[s]=r[s])}),forEach(globals,function(s){s in e||defineProp(e,s,r[s])}),document.body.removeChild(t),a};Script.prototype.runInThisContext=function(){return eval(this.code)};Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),function(i){e[i]=t[i]}),r};forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}});exports.isContext=function(e){return e instanceof Context};exports.createScript=function(e){return exports.Script(e)};exports.createContext=Script.createContext=function(e){var t=new Context;return typeof e=="object"&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}});var ZE=k(GE=>{v();var VE=Tc(),JW=Ot(),QW=GE;QW.define=function(t,r){return new Pc(t,r)};function Pc(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}Pc.prototype._createNamed=function(t){var r;try{r=KE().runInThisContext("(function "+this.name+`(entity) {
|
|
12
12
|
this._initNamed(entity);
|
|
13
13
|
})`)}catch{r=function(n){this._initNamed(n)}}return JW(r,t),r.prototype._initNamed=function(n){t.call(this,n)},new r(this)};Pc.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(VE.decoders[t])),this.decoders[t]};Pc.prototype.decode=function(t,r,i){return this._getDecoder(r).decode(t,i)};Pc.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(VE.encoders[t])),this.encoders[t]};Pc.prototype.encode=function(t,r,i){return this._getEncoder(r).encode(t,i)}});var YE=k(WE=>{v();var eY=Ot();function cn(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}WE.Reporter=cn;cn.prototype.isError=function(t){return t instanceof kc};cn.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}};cn.prototype.restore=function(t){var r=this._reporterState;r.obj=t.obj,r.path=r.path.slice(0,t.pathLen)};cn.prototype.enterKey=function(t){return this._reporterState.path.push(t)};cn.prototype.exitKey=function(t){var r=this._reporterState;r.path=r.path.slice(0,t-1)};cn.prototype.leaveKey=function(t,r,i){var n=this._reporterState;this.exitKey(t),n.obj!==null&&(n.obj[r]=i)};cn.prototype.path=function(){return this._reporterState.path.join("/")};cn.prototype.enterObject=function(){var t=this._reporterState,r=t.obj;return t.obj={},r};cn.prototype.leaveObject=function(t){var r=this._reporterState,i=r.obj;return r.obj=t,i};cn.prototype.error=function(t){var r,i=this._reporterState,n=t instanceof kc;if(n?r=t:r=new kc(i.path.map(function(o){return"["+JSON.stringify(o)+"]"}).join(""),t.message||t,t.stack),!i.options.partial)throw r;return n||i.errors.push(r),r};cn.prototype.wrapResult=function(t){var r=this._reporterState;return r.options.partial?{result:this.isError(t)?null:t,errors:r.errors}:t};function kc(e,t){this.path=e,this.rethrow(t)}eY(kc,Error);kc.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,kc),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this}});var _m=k(bm=>{v();var tY=Ot(),j2=Rc().Reporter,e0=Kt().Buffer;function So(e,t){if(j2.call(this,t),!e0.isBuffer(e)){this.error("Input not Buffer");return}this.base=e,this.offset=0,this.length=e.length}tY(So,j2);bm.DecoderBuffer=So;So.prototype.save=function(){return{offset:this.offset,reporter:j2.prototype.save.call(this)}};So.prototype.restore=function(t){var r=new So(this.base);return r.offset=t.offset,r.length=this.offset,this.offset=t.offset,j2.prototype.restore.call(this,t.reporter),r};So.prototype.isEmpty=function(){return this.offset===this.length};So.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")};So.prototype.skip=function(t,r){if(!(this.offset+t<=this.length))return this.error(r||"DecoderBuffer overrun");var i=new So(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+t,this.offset+=t,i};So.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)};function H2(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(r){return r instanceof H2||(r=new H2(r,t)),this.length+=r.length,r},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=e0.byteLength(e);else if(e0.isBuffer(e))this.value=e,this.length=e.length;else return t.error("Unsupported type: "+typeof e)}bm.EncoderBuffer=H2;H2.prototype.join=function(t,r){return t||(t=new e0(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(i){i.join(t,r),r+=i.length}):(typeof this.value=="number"?t[r]=this.value:typeof this.value=="string"?t.write(this.value,r):e0.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length)),t}});var JE=k((Q0e,XE)=>{v();var rY=Rc().Reporter,iY=Rc().EncoderBuffer,nY=Rc().DecoderBuffer,yi=Rn(),$E=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],oY=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat($E),aY=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Lt(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}XE.exports=Lt;var sY=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Lt.prototype.clone=function(){var t=this._baseState,r={};sY.forEach(function(n){r[n]=t[n]});var i=new this.constructor(r.parent);return i._baseState=r,i};Lt.prototype._wrap=function(){var t=this._baseState;oY.forEach(function(r){this[r]=function(){var n=new this.constructor(this);return t.children.push(n),n[r].apply(n,arguments)}},this)};Lt.prototype._init=function(t){var r=this._baseState;yi(r.parent===null),t.call(this),r.children=r.children.filter(function(i){return i._baseState.parent===this},this),yi.equal(r.children.length,1,"Root node can have only one child")};Lt.prototype._useArgs=function(t){var r=this._baseState,i=t.filter(function(n){return n instanceof this.constructor},this);t=t.filter(function(n){return!(n instanceof this.constructor)},this),i.length!==0&&(yi(r.children===null),r.children=i,i.forEach(function(n){n._baseState.parent=this},this)),t.length!==0&&(yi(r.args===null),r.args=t,r.reverseArgs=t.map(function(n){if(typeof n!="object"||n.constructor!==Object)return n;var o={};return Object.keys(n).forEach(function(a){a==(a|0)&&(a|=0);var s=n[a];o[s]=a}),o}))};aY.forEach(function(e){Lt.prototype[e]=function(){var r=this._baseState;throw new Error(e+" not implemented for encoding: "+r.enc)}});$E.forEach(function(e){Lt.prototype[e]=function(){var r=this._baseState,i=Array.prototype.slice.call(arguments);return yi(r.tag===null),r.tag=e,this._useArgs(i),this}});Lt.prototype.use=function(t){yi(t);var r=this._baseState;return yi(r.use===null),r.use=t,this};Lt.prototype.optional=function(){var t=this._baseState;return t.optional=!0,this};Lt.prototype.def=function(t){var r=this._baseState;return yi(r.default===null),r.default=t,r.optional=!0,this};Lt.prototype.explicit=function(t){var r=this._baseState;return yi(r.explicit===null&&r.implicit===null),r.explicit=t,this};Lt.prototype.implicit=function(t){var r=this._baseState;return yi(r.explicit===null&&r.implicit===null),r.implicit=t,this};Lt.prototype.obj=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return t.obj=!0,r.length!==0&&this._useArgs(r),this};Lt.prototype.key=function(t){var r=this._baseState;return yi(r.key===null),r.key=t,this};Lt.prototype.any=function(){var t=this._baseState;return t.any=!0,this};Lt.prototype.choice=function(t){var r=this._baseState;return yi(r.choice===null),r.choice=t,this._useArgs(Object.keys(t).map(function(i){return t[i]})),this};Lt.prototype.contains=function(t){var r=this._baseState;return yi(r.use===null),r.contains=t,this};Lt.prototype._decode=function(t,r){var i=this._baseState;if(i.parent===null)return t.wrapResult(i.children[0]._decode(t,r));var n=i.default,o=!0,a=null;if(i.key!==null&&(a=t.enterKey(i.key)),i.optional){var s=null;if(i.explicit!==null?s=i.explicit:i.implicit!==null?s=i.implicit:i.tag!==null&&(s=i.tag),s===null&&!i.any){var u=t.save();try{i.choice===null?this._decodeGeneric(i.tag,t,r):this._decodeChoice(t,r),o=!0}catch{o=!1}t.restore(u)}else if(o=this._peekTag(t,s,i.any),t.isError(o))return o}var c;if(i.obj&&o&&(c=t.enterObject()),o){if(i.explicit!==null){var l=this._decodeTag(t,i.explicit);if(t.isError(l))return l;t=l}var m=t.offset;if(i.use===null&&i.choice===null){if(i.any)var u=t.save();var w=this._decodeTag(t,i.implicit!==null?i.implicit:i.tag,i.any);if(t.isError(w))return w;i.any?n=t.raw(u):t=w}if(r&&r.track&&i.tag!==null&&r.track(t.path(),m,t.length,"tagged"),r&&r.track&&i.tag!==null&&r.track(t.path(),t.offset,t.length,"content"),i.any?n=n:i.choice===null?n=this._decodeGeneric(i.tag,t,r):n=this._decodeChoice(t,r),t.isError(n))return n;if(!i.any&&i.choice===null&&i.children!==null&&i.children.forEach(function(M){M._decode(t,r)}),i.contains&&(i.tag==="octstr"||i.tag==="bitstr")){var E=new nY(n);n=this._getUse(i.contains,t._reporterState.obj)._decode(E,r)}}return i.obj&&o&&(n=t.leaveObject(c)),i.key!==null&&(n!==null||o===!0)?t.leaveKey(a,i.key,n):a!==null&&t.exitKey(a),n};Lt.prototype._decodeGeneric=function(t,r,i){var n=this._baseState;return t==="seq"||t==="set"?null:t==="seqof"||t==="setof"?this._decodeList(r,t,n.args[0],i):/str$/.test(t)?this._decodeStr(r,t,i):t==="objid"&&n.args?this._decodeObjid(r,n.args[0],n.args[1],i):t==="objid"?this._decodeObjid(r,null,null,i):t==="gentime"||t==="utctime"?this._decodeTime(r,t,i):t==="null_"?this._decodeNull(r,i):t==="bool"?this._decodeBool(r,i):t==="objDesc"?this._decodeStr(r,t,i):t==="int"||t==="enum"?this._decodeInt(r,n.args&&n.args[0],i):n.use!==null?this._getUse(n.use,r._reporterState.obj)._decode(r,i):r.error("unknown tag: "+t)};Lt.prototype._getUse=function(t,r){var i=this._baseState;return i.useDecoder=this._use(t,r),yi(i.useDecoder._baseState.parent===null),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder};Lt.prototype._decodeChoice=function(t,r){var i=this._baseState,n=null,o=!1;return Object.keys(i.choice).some(function(a){var s=t.save(),u=i.choice[a];try{var c=u._decode(t,r);if(t.isError(c))return!1;n={type:a,value:c},o=!0}catch{return t.restore(s),!1}return!0},this),o?n:t.error("Choice not matched")};Lt.prototype._createEncoderBuffer=function(t){return new iY(t,this.reporter)};Lt.prototype._encode=function(t,r,i){var n=this._baseState;if(!(n.default!==null&&n.default===t)){var o=this._encodeValue(t,r,i);if(o!==void 0&&!this._skipDefault(o,r,i))return o}};Lt.prototype._encodeValue=function(t,r,i){var n=this._baseState;if(n.parent===null)return n.children[0]._encode(t,r||new rY);var u=null;if(this.reporter=r,n.optional&&t===void 0)if(n.default!==null)t=n.default;else return;var o=null,a=!1;if(n.any)u=this._createEncoderBuffer(t);else if(n.choice)u=this._encodeChoice(t,r);else if(n.contains)o=this._getUse(n.contains,i)._encode(t,r),a=!0;else if(n.children)o=n.children.map(function(m){if(m._baseState.tag==="null_")return m._encode(null,r,t);if(m._baseState.key===null)return r.error("Child should have a key");var w=r.enterKey(m._baseState.key);if(typeof t!="object")return r.error("Child expected, but input is not object");var E=m._encode(t[m._baseState.key],r,t);return r.leaveKey(w),E},this).filter(function(m){return m}),o=this._createEncoderBuffer(o);else if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return r.error("Too many args for : "+n.tag);if(!Array.isArray(t))return r.error("seqof/setof, but data is not Array");var s=this.clone();s._baseState.implicit=null,o=this._createEncoderBuffer(t.map(function(m){var w=this._baseState;return this._getUse(w.args[0],t)._encode(m,r)},s))}else n.use!==null?u=this._getUse(n.use,i)._encode(t,r):(o=this._encodePrimitive(n.tag,t),a=!0);var u;if(!n.any&&n.choice===null){var c=n.implicit!==null?n.implicit:n.tag,l=n.implicit===null?"universal":"context";c===null?n.use===null&&r.error("Tag could be omitted only for .use()"):n.use===null&&(u=this._encodeComposite(c,a,l,o))}return n.explicit!==null&&(u=this._encodeComposite(n.explicit,!1,"context",u)),u};Lt.prototype._encodeChoice=function(t,r){var i=this._baseState,n=i.choice[t.type];return n||yi(!1,t.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(t.value,r)};Lt.prototype._encodePrimitive=function(t,r){var i=this._baseState;if(/str$/.test(t))return this._encodeStr(r,t);if(t==="objid"&&i.args)return this._encodeObjid(r,i.reverseArgs[0],i.args[1]);if(t==="objid")return this._encodeObjid(r,null,null);if(t==="gentime"||t==="utctime")return this._encodeTime(r,t);if(t==="null_")return this._encodeNull();if(t==="int"||t==="enum")return this._encodeInt(r,i.args&&i.reverseArgs[0]);if(t==="bool")return this._encodeBool(r);if(t==="objDesc")return this._encodeStr(r,t);throw new Error("Unsupported tag: "+t)};Lt.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)};Lt.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}});var Rc=k(QE=>{v();var z2=QE;z2.Reporter=YE().Reporter;z2.DecoderBuffer=_m().DecoderBuffer;z2.EncoderBuffer=_m().EncoderBuffer;z2.Node=JE()});var tO=k(zu=>{v();var eO=wm();zu.tagClass={0:"universal",1:"application",2:"context",3:"private"};zu.tagClassByName=eO._reverse(zu.tagClass);zu.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};zu.tagByName=eO._reverse(zu.tag)});var wm=k(iO=>{v();var rO=iO;rO._reverse=function(t){var r={};return Object.keys(t).forEach(function(i){(i|0)==i&&(i=i|0);var n=t[i];r[n]=i}),r};rO.der=tO()});var Em=k((s1e,sO)=>{v();var uY=Ot(),Sm=Tc(),K2=Sm.base,fY=Sm.bignum,nO=Sm.constants.der;function oO(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new qi,this.tree._init(e.body)}sO.exports=oO;oO.prototype.decode=function(t,r){return t instanceof K2.DecoderBuffer||(t=new K2.DecoderBuffer(t,r)),this.tree._decode(t,r)};function qi(e){K2.Node.call(this,"der",e)}uY(qi,K2.Node);qi.prototype._peekTag=function(t,r,i){if(t.isEmpty())return!1;var n=t.save(),o=xm(t,'Failed to peek tag: "'+r+'"');return t.isError(o)?o:(t.restore(n),o.tag===r||o.tagStr===r||o.tagStr+"of"===r||i)};qi.prototype._decodeTag=function(t,r,i){var n=xm(t,'Failed to decode tag of "'+r+'"');if(t.isError(n))return n;var o=aO(t,n.primitive,'Failed to get length of "'+r+'"');if(t.isError(o))return o;if(!i&&n.tag!==r&&n.tagStr!==r&&n.tagStr+"of"!==r)return t.error('Failed to match tag: "'+r+'"');if(n.primitive||o!==null)return t.skip(o,'Failed to match body of: "'+r+'"');var a=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(o=t.offset-a.offset,t.restore(a),t.skip(o,'Failed to match body of: "'+r+'"'))};qi.prototype._skipUntilEnd=function(t,r){for(;;){var i=xm(t,r);if(t.isError(i))return i;var n=aO(t,i.primitive,r);if(t.isError(n))return n;var o;if(i.primitive||n!==null?o=t.skip(n):o=this._skipUntilEnd(t,r),t.isError(o))return o;if(i.tagStr==="end")break}};qi.prototype._decodeList=function(t,r,i,n){for(var o=[];!t.isEmpty();){var a=this._peekTag(t,"end");if(t.isError(a))return a;var s=i.decode(t,"der",n);if(t.isError(s)&&a)break;o.push(s)}return o};qi.prototype._decodeStr=function(t,r){if(r==="bitstr"){var i=t.readUInt8();return t.isError(i)?i:{unused:i,data:t.raw()}}else if(r==="bmpstr"){var n=t.raw();if(n.length%2===1)return t.error("Decoding of string type: bmpstr length mismatch");for(var o="",a=0;a<n.length/2;a++)o+=String.fromCharCode(n.readUInt16BE(a*2));return o}else if(r==="numstr"){var s=t.raw().toString("ascii");return this._isNumstr(s)?s:t.error("Decoding of string type: numstr unsupported characters")}else{if(r==="octstr")return t.raw();if(r==="objDesc")return t.raw();if(r==="printstr"){var u=t.raw().toString("ascii");return this._isPrintstr(u)?u:t.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(r)?t.raw().toString():t.error("Decoding of string type: "+r+" unsupported")}};qi.prototype._decodeObjid=function(t,r,i){for(var n,o=[],a=0;!t.isEmpty();){var s=t.readUInt8();a<<=7,a|=s&127,(s&128)===0&&(o.push(a),a=0)}s&128&&o.push(a);var u=o[0]/40|0,c=o[0]%40;if(i?n=o:n=[u,c].concat(o.slice(1)),r){var l=r[n.join(" ")];l===void 0&&(l=r[n.join(".")]),l!==void 0&&(n=l)}return n};qi.prototype._decodeTime=function(t,r){var i=t.raw().toString();if(r==="gentime")var n=i.slice(0,4)|0,o=i.slice(4,6)|0,a=i.slice(6,8)|0,s=i.slice(8,10)|0,u=i.slice(10,12)|0,c=i.slice(12,14)|0;else if(r==="utctime"){var n=i.slice(0,2)|0,o=i.slice(2,4)|0,a=i.slice(4,6)|0,s=i.slice(6,8)|0,u=i.slice(8,10)|0,c=i.slice(10,12)|0;n<70?n=2e3+n:n=1900+n}else return t.error("Decoding "+r+" time is not supported yet");return Date.UTC(n,o-1,a,s,u,c,0)};qi.prototype._decodeNull=function(t){return null};qi.prototype._decodeBool=function(t){var r=t.readUInt8();return t.isError(r)?r:r!==0};qi.prototype._decodeInt=function(t,r){var i=t.raw(),n=new fY(i);return r&&(n=r[n.toString(10)]||n),n};qi.prototype._use=function(t,r){return typeof t=="function"&&(t=t(r)),t._getDecoder("der").tree};function xm(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var i=nO.tagClass[r>>6],n=(r&32)===0;if((r&31)===31){var o=r;for(r=0;(o&128)===128;){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=o&127}}else r&=31;var a=nO.tag[r];return{cls:i,primitive:n,tag:r,tagStr:a}}function aO(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&i===128)return null;if((i&128)===0)return i;var n=i&127;if(n>4)return e.error("length octect is too long");i=0;for(var o=0;o<n;o++){i<<=8;var a=e.readUInt8(r);if(e.isError(a))return a;i|=a}return i}});var fO=k((f1e,uO)=>{v();var cY=Ot(),lY=Kt().Buffer,Om=Em();function Im(e){Om.call(this,e),this.enc="pem"}cY(Im,Om);uO.exports=Im;Im.prototype.decode=function(t,r){for(var i=t.toString().split(/[\r\n]+/g),n=r.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,s=-1,u=0;u<i.length;u++){var c=i[u].match(o);if(c!==null&&c[2]===n)if(a===-1){if(c[1]!=="BEGIN")break;a=u}else{if(c[1]!=="END")break;s=u;break}}if(a===-1||s===-1)throw new Error("PEM section not found for: "+n);var l=i.slice(a+1,s).join("");l.replace(/[^a-z0-9\+\/=]+/gi,"");var m=new lY(l,"base64");return Om.prototype.decode.call(this,m,r)}});var hO=k(lO=>{v();var cO=lO;cO.der=Em();cO.pem=fO()});var Pm=k((d1e,vO)=>{v();var hY=Ot(),_a=Kt().Buffer,dO=Tc(),pO=dO.base,Am=dO.constants.der;function gO(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new Cn,this.tree._init(e.body)}vO.exports=gO;gO.prototype.encode=function(t,r){return this.tree._encode(t,r).join()};function Cn(e){pO.Node.call(this,"der",e)}hY(Cn,pO.Node);Cn.prototype._encodeComposite=function(t,r,i,n){var o=dY(t,r,i,this.reporter);if(n.length<128){var u=new _a(2);return u[0]=o,u[1]=n.length,this._createEncoderBuffer([u,n])}for(var a=1,s=n.length;s>=256;s>>=8)a++;var u=new _a(2+a);u[0]=o,u[1]=128|a;for(var s=1+a,c=n.length;c>0;s--,c>>=8)u[s]=c&255;return this._createEncoderBuffer([u,n])};Cn.prototype._encodeStr=function(t,r){if(r==="bitstr")return this._createEncoderBuffer([t.unused|0,t.data]);if(r==="bmpstr"){for(var i=new _a(t.length*2),n=0;n<t.length;n++)i.writeUInt16BE(t.charCodeAt(n),n*2);return this._createEncoderBuffer(i)}else return r==="numstr"?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):r==="printstr"?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(r)?this._createEncoderBuffer(t):r==="objDesc"?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+r+" unsupported")};Cn.prototype._encodeObjid=function(t,r,i){if(typeof t=="string"){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=r[t].split(/[\s\.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(var n=0;n<t.length;n++)t[n]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!i){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,t[0]*40+t[1])}for(var o=0,n=0;n<t.length;n++){var a=t[n];for(o++;a>=128;a>>=7)o++}for(var s=new _a(o),u=s.length-1,n=t.length-1;n>=0;n--){var a=t[n];for(s[u--]=a&127;(a>>=7)>0;)s[u--]=128|a&127}return this._createEncoderBuffer(s)};function ln(e){return e<10?"0"+e:e}Cn.prototype._encodeTime=function(t,r){var i,n=new Date(t);return r==="gentime"?i=[ln(n.getFullYear()),ln(n.getUTCMonth()+1),ln(n.getUTCDate()),ln(n.getUTCHours()),ln(n.getUTCMinutes()),ln(n.getUTCSeconds()),"Z"].join(""):r==="utctime"?i=[ln(n.getFullYear()%100),ln(n.getUTCMonth()+1),ln(n.getUTCDate()),ln(n.getUTCHours()),ln(n.getUTCMinutes()),ln(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(i,"octstr")};Cn.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Cn.prototype._encodeInt=function(t,r){if(typeof t=="string"){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=r[t]}if(typeof t!="number"&&!_a.isBuffer(t)){var i=t.toArray();!t.sign&&i[0]&128&&i.unshift(0),t=new _a(i)}if(_a.isBuffer(t)){var n=t.length;t.length===0&&n++;var a=new _a(n);return t.copy(a),t.length===0&&(a[0]=0),this._createEncoderBuffer(a)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var n=1,o=t;o>=256;o>>=8)n++;for(var a=new Array(n),o=a.length-1;o>=0;o--)a[o]=t&255,t>>=8;return a[0]&128&&a.unshift(0),this._createEncoderBuffer(new _a(a))};Cn.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)};Cn.prototype._use=function(t,r){return typeof t=="function"&&(t=t(r)),t._getEncoder("der").tree};Cn.prototype._skipDefault=function(t,r,i){var n=this._baseState,o;if(n.default===null)return!1;var a=t.join();if(n.defaultBuffer===void 0&&(n.defaultBuffer=this._encodeValue(n.default,r,i).join()),a.length!==n.defaultBuffer.length)return!1;for(o=0;o<a.length;o++)if(a[o]!==n.defaultBuffer[o])return!1;return!0};function dY(e,t,r,i){var n;if(e==="seqof"?e="seq":e==="setof"&&(e="set"),Am.tagByName.hasOwnProperty(e))n=Am.tagByName[e];else if(typeof e=="number"&&(e|0)===e)n=e;else return i.error("Unknown tag: "+e);return n>=31?i.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=Am.tagClassByName[r||"universal"]<<6,n)}});var yO=k((g1e,mO)=>{v();var pY=Ot(),Tm=Pm();function km(e){Tm.call(this,e),this.enc="pem"}pY(km,Tm);mO.exports=km;km.prototype.encode=function(t,r){for(var i=Tm.prototype.encode.call(this,t),n=i.toString("base64"),o=["-----BEGIN "+r.label+"-----"],a=0;a<n.length;a+=64)o.push(n.slice(a,a+64));return o.push("-----END "+r.label+"-----"),o.join(`
|
|
14
|
-
`)}});var wO=k(_O=>{v();var bO=_O;bO.der=Pm();bO.pem=yO()});var Tc=k(SO=>{v();var Bc=SO;Bc.bignum=Nn();Bc.define=ZE().define;Bc.base=Rc();Bc.constants=wm();Bc.decoders=hO();Bc.encoders=wO()});var IO=k((w1e,OO)=>{"use strict";v();var Dn=Tc(),xO=Dn.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),gY=Dn.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),Rm=Dn.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),vY=Dn.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Rm),this.key("subjectPublicKey").bitstr())}),mY=Dn.define("RelativeDistinguishedName",function(){this.setof(gY)}),yY=Dn.define("RDNSequence",function(){this.seqof(mY)}),EO=Dn.define("Name",function(){this.choice({rdnSequence:this.use(yY)})}),bY=Dn.define("Validity",function(){this.seq().obj(this.key("notBefore").use(xO),this.key("notAfter").use(xO))}),_Y=Dn.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),wY=Dn.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(Rm),this.key("issuer").use(EO),this.key("validity").use(bY),this.key("subject").use(EO),this.key("subjectPublicKeyInfo").use(vY),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(_Y).optional())}),SY=Dn.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(wY),this.key("signatureAlgorithm").use(Rm),this.key("signatureValue").bitstr())});OO.exports=SY});var PO=k(qn=>{"use strict";v();var Ln=Tc();qn.certificate=IO();var xY=Ln.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});qn.RSAPrivateKey=xY;var EY=Ln.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});qn.RSAPublicKey=EY;var AO=Ln.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),OY=Ln.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(AO),this.key("subjectPublicKey").bitstr())});qn.PublicKey=OY;var IY=Ln.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(AO),this.key("subjectPrivateKey").octstr())});qn.PrivateKey=IY;var AY=Ln.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});qn.EncryptedPrivateKey=AY;var PY=Ln.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});qn.DSAPrivateKey=PY;qn.DSAparam=Ln.define("DSAparam",function(){this.int()});var TY=Ln.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),kY=Ln.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(TY),this.key("publicKey").optional().explicit(1).bitstr())});qn.ECPrivateKey=kY;qn.signature=Ln.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})});var TO=k((O1e,RY)=>{RY.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}});var RO=k((I1e,kO)=>{"use strict";v();var BY=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,MY=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,NY=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,CY=Xh(),DY=q2(),V2=nt().Buffer;kO.exports=function(e,t){var r=e.toString(),i=r.match(BY),n;if(i){var a="aes"+i[1],s=V2.from(i[2],"hex"),u=V2.from(i[3].replace(/[\r\n]/g,""),"base64"),c=CY(t,s.slice(0,8),parseInt(i[1],10)).key,l=[],m=DY.createDecipheriv(a,c,s);l.push(m.update(u)),l.push(m.final()),n=V2.concat(l)}else{var o=r.match(NY);n=V2.from(o[2].replace(/[\r\n]/g,""),"base64")}var w=r.match(MY)[1];return{tag:w,data:n}}});var Mm=k((P1e,MO)=>{"use strict";v();var Ti=PO(),LY=TO(),qY=RO(),UY=q2(),FY=jv().pbkdf2Sync,Bm=nt().Buffer;function HY(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=LY[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=FY(t,r,i,s,"sha1"),c=UY.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),Bm.concat(l)}function BO(e){var t;typeof e=="object"&&!Bm.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e=="string"&&(e=Bm.from(e));var r=qY(e,t),i=r.tag,n=r.data,o,a;switch(i){case"CERTIFICATE":a=Ti.certificate.decode(n,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(a||(a=Ti.PublicKey.decode(n,"der")),o=a.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Ti.RSAPublicKey.decode(a.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return a.subjectPrivateKey=a.subjectPublicKey,{type:"ec",data:a};case"1.2.840.10040.4.1":return a.algorithm.params.pub_key=Ti.DSAparam.decode(a.subjectPublicKey.data,"der"),{type:"dsa",data:a.algorithm.params};default:throw new Error("unknown key id "+o)}case"ENCRYPTED PRIVATE KEY":n=Ti.EncryptedPrivateKey.decode(n,"der"),n=HY(n,t);case"PRIVATE KEY":switch(a=Ti.PrivateKey.decode(n,"der"),o=a.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Ti.RSAPrivateKey.decode(a.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:a.algorithm.curve,privateKey:Ti.ECPrivateKey.decode(a.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return a.algorithm.params.priv_key=Ti.DSAparam.decode(a.subjectPrivateKey,"der"),{type:"dsa",params:a.algorithm.params};default:throw new Error("unknown key id "+o)}case"RSA PUBLIC KEY":return Ti.RSAPublicKey.decode(n,"der");case"RSA PRIVATE KEY":return Ti.RSAPrivateKey.decode(n,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:Ti.DSAPrivateKey.decode(n,"der")};case"EC PRIVATE KEY":return n=Ti.ECPrivateKey.decode(n,"der"),{curve:n.parameters.value,privateKey:n.privateKey};default:throw new Error("unknown key type "+i)}}BO.signature=Ti.signature;MO.exports=BO});var Cm=k((k1e,NO)=>{v();var jY=zh(),Nm=nt().Buffer;NO.exports=function(e,t){for(var r=Nm.alloc(0),i=0,n;r.length<t;)n=zY(i++),r=Nm.concat([r,jY("sha1").update(e).update(n).digest()]);return r.slice(0,t)};function zY(e){var t=Nm.allocUnsafe(4);return t.writeUInt32BE(e,0),t}});var Dm=k((B1e,CO)=>{v();CO.exports=function(t,r){for(var i=t.length,n=-1;++n<i;)t[n]^=r[n];return t}});var Lm=k((N1e,LO)=>{v();var DO=Nn(),KY=nt().Buffer;function VY(e,t){return KY.from(e.toRed(DO.mont(t.modulus)).redPow(new DO(t.publicExponent)).fromRed().toArray())}LO.exports=VY});var UO=k((qO,qm)=>{v();(function(e,t){"use strict";function r(y,f){if(!y)throw new Error(f||"Assertion failed")}function i(y,f){y.super_=f;var d=function(){};d.prototype=f.prototype,y.prototype=new d,y.prototype.constructor=y}function n(y,f,d){if(n.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((f==="le"||f==="be")&&(d=f,f=10),this._init(y||0,f||10,d||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Kt().Buffer}catch{}n.isBN=function(f){return f instanceof n?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===n.wordSize&&Array.isArray(f.words)},n.max=function(f,d){return f.cmp(d)>0?f:d},n.min=function(f,d){return f.cmp(d)<0?f:d},n.prototype._init=function(f,d,_){if(typeof f=="number")return this._initNumber(f,d,_);if(typeof f=="object")return this._initArray(f,d,_);d==="hex"&&(d=16),r(d===(d|0)&&d>=2&&d<=36),f=f.toString().replace(/\s+/g,"");var x=0;f[0]==="-"&&(x++,this.negative=1),x<f.length&&(d===16?this._parseHex(f,x,_):(this._parseBase(f,d,x),_==="le"&&this._initArray(this.toArray(),d,_)))},n.prototype._initNumber=function(f,d,_){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),d,_)},n.prototype._initArray=function(f,d,_){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var b,p,I=0;if(_==="be")for(x=f.length-1,b=0;x>=0;x-=3)p=f[x]|f[x-1]<<8|f[x-2]<<16,this.words[b]|=p<<I&67108863,this.words[b+1]=p>>>26-I&67108863,I+=24,I>=26&&(I-=26,b++);else if(_==="le")for(x=0,b=0;x<f.length;x+=3)p=f[x]|f[x+1]<<8|f[x+2]<<16,this.words[b]|=p<<I&67108863,this.words[b+1]=p>>>26-I&67108863,I+=24,I>=26&&(I-=26,b++);return this._strip()};function a(y,f){var d=y.charCodeAt(f);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;r(!1,"Invalid character in "+y)}function s(y,f,d){var _=a(y,d);return d-1>=f&&(_|=a(y,d-1)<<4),_}n.prototype._parseHex=function(f,d,_){this.length=Math.ceil((f.length-d)/6),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var b=0,p=0,I;if(_==="be")for(x=f.length-1;x>=d;x-=2)I=s(f,d,x)<<b,this.words[p]|=I&67108863,b>=18?(b-=18,p+=1,this.words[p]|=I>>>26):b+=8;else{var T=f.length-d;for(x=T%2===0?d+1:d;x<f.length;x+=2)I=s(f,d,x)<<b,this.words[p]|=I&67108863,b>=18?(b-=18,p+=1,this.words[p]|=I>>>26):b+=8}this._strip()};function u(y,f,d,_){for(var x=0,b=0,p=Math.min(y.length,d),I=f;I<p;I++){var T=y.charCodeAt(I)-48;x*=_,T>=49?b=T-49+10:T>=17?b=T-17+10:b=T,r(T>=0&&b<_,"Invalid character"),x+=b}return x}n.prototype._parseBase=function(f,d,_){this.words=[0],this.length=1;for(var x=0,b=1;b<=67108863;b*=d)x++;x--,b=b/d|0;for(var p=f.length-_,I=p%x,T=Math.min(p,p-I)+_,S=0,R=_;R<T;R+=x)S=u(f,R,R+x,d),this.imuln(b),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S);if(I!==0){var Y=1;for(S=u(f,R,f.length,d),R=0;R<I;R++)Y*=d;this.imuln(Y),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S)}this._strip()},n.prototype.copy=function(f){f.words=new Array(this.length);for(var d=0;d<this.length;d++)f.words[d]=this.words[d];f.length=this.length,f.negative=this.negative,f.red=this.red};function c(y,f){y.words=f.words,y.length=f.length,y.negative=f.negative,y.red=f.red}if(n.prototype._move=function(f){c(f,this)},n.prototype.clone=function(){var f=new n(null);return this.copy(f),f},n.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch{n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(f,d){f=f||10,d=d|0||1;var _;if(f===16||f==="hex"){_="";for(var x=0,b=0,p=0;p<this.length;p++){var I=this.words[p],T=((I<<x|b)&16777215).toString(16);b=I>>>24-x&16777215,x+=2,x>=26&&(x-=26,p--),b!==0||p!==this.length-1?_=m[6-T.length]+T+_:_=T+_}for(b!==0&&(_=b.toString(16)+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(f===(f|0)&&f>=2&&f<=36){var S=w[f],R=E[f];_="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var X=Y.modrn(R).toString(f);Y=Y.idivn(R),Y.isZero()?_=X+_:_=m[S-X.length]+X+_}for(this.isZero()&&(_="0"+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(f,d){return this.toArrayLike(o,f,d)}),n.prototype.toArray=function(f,d){return this.toArrayLike(Array,f,d)};var P=function(f,d){return f.allocUnsafe?f.allocUnsafe(d):new f(d)};n.prototype.toArrayLike=function(f,d,_){this._strip();var x=this.byteLength(),b=_||Math.max(1,x);r(x<=b,"byte array longer than desired length"),r(b>0,"Requested array length <= 0");var p=P(f,b),I=d==="le"?"LE":"BE";return this["_toArrayLike"+I](p,x),p},n.prototype._toArrayLikeLE=function(f,d){for(var _=0,x=0,b=0,p=0;b<this.length;b++){var I=this.words[b]<<p|x;f[_++]=I&255,_<f.length&&(f[_++]=I>>8&255),_<f.length&&(f[_++]=I>>16&255),p===6?(_<f.length&&(f[_++]=I>>24&255),x=0,p=0):(x=I>>>24,p+=2)}if(_<f.length)for(f[_++]=x;_<f.length;)f[_++]=0},n.prototype._toArrayLikeBE=function(f,d){for(var _=f.length-1,x=0,b=0,p=0;b<this.length;b++){var I=this.words[b]<<p|x;f[_--]=I&255,_>=0&&(f[_--]=I>>8&255),_>=0&&(f[_--]=I>>16&255),p===6?(_>=0&&(f[_--]=I>>24&255),x=0,p=0):(x=I>>>24,p+=2)}if(_>=0)for(f[_--]=x;_>=0;)f[_--]=0},Math.clz32?n.prototype._countBits=function(f){return 32-Math.clz32(f)}:n.prototype._countBits=function(f){var d=f,_=0;return d>=4096&&(_+=13,d>>>=13),d>=64&&(_+=7,d>>>=7),d>=8&&(_+=4,d>>>=4),d>=2&&(_+=2,d>>>=2),_+d},n.prototype._zeroBits=function(f){if(f===0)return 26;var d=f,_=0;return(d&8191)===0&&(_+=13,d>>>=13),(d&127)===0&&(_+=7,d>>>=7),(d&15)===0&&(_+=4,d>>>=4),(d&3)===0&&(_+=2,d>>>=2),(d&1)===0&&_++,_},n.prototype.bitLength=function(){var f=this.words[this.length-1],d=this._countBits(f);return(this.length-1)*26+d};function M(y){for(var f=new Array(y.bitLength()),d=0;d<f.length;d++){var _=d/26|0,x=d%26;f[d]=y.words[_]>>>x&1}return f}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,d=0;d<this.length;d++){var _=this._zeroBits(this.words[d]);if(f+=_,_!==26)break}return f},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},n.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var d=0;d<f.length;d++)this.words[d]=this.words[d]|f.words[d];return this._strip()},n.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},n.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},n.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},n.prototype.iuand=function(f){var d;this.length>f.length?d=f:d=this;for(var _=0;_<d.length;_++)this.words[_]=this.words[_]&f.words[_];return this.length=d.length,this._strip()},n.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},n.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},n.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},n.prototype.iuxor=function(f){var d,_;this.length>f.length?(d=this,_=f):(d=f,_=this);for(var x=0;x<_.length;x++)this.words[x]=d.words[x]^_.words[x];if(this!==d)for(;x<d.length;x++)this.words[x]=d.words[x];return this.length=d.length,this._strip()},n.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},n.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},n.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},n.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var d=Math.ceil(f/26)|0,_=f%26;this._expand(d),_>0&&d--;for(var x=0;x<d;x++)this.words[x]=~this.words[x]&67108863;return _>0&&(this.words[x]=~this.words[x]&67108863>>26-_),this._strip()},n.prototype.notn=function(f){return this.clone().inotn(f)},n.prototype.setn=function(f,d){r(typeof f=="number"&&f>=0);var _=f/26|0,x=f%26;return this._expand(_+1),d?this.words[_]=this.words[_]|1<<x:this.words[_]=this.words[_]&~(1<<x),this._strip()},n.prototype.iadd=function(f){var d;if(this.negative!==0&&f.negative===0)return this.negative=0,d=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,d=this.isub(f),f.negative=1,d._normSign();var _,x;this.length>f.length?(_=this,x=f):(_=f,x=this);for(var b=0,p=0;p<x.length;p++)d=(_.words[p]|0)+(x.words[p]|0)+b,this.words[p]=d&67108863,b=d>>>26;for(;b!==0&&p<_.length;p++)d=(_.words[p]|0)+b,this.words[p]=d&67108863,b=d>>>26;if(this.length=_.length,b!==0)this.words[this.length]=b,this.length++;else if(_!==this)for(;p<_.length;p++)this.words[p]=_.words[p];return this},n.prototype.add=function(f){var d;return f.negative!==0&&this.negative===0?(f.negative=0,d=this.sub(f),f.negative^=1,d):f.negative===0&&this.negative!==0?(this.negative=0,d=f.sub(this),this.negative=1,d):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},n.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var d=this.iadd(f);return f.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var _=this.cmp(f);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,b;_>0?(x=this,b=f):(x=f,b=this);for(var p=0,I=0;I<b.length;I++)d=(x.words[I]|0)-(b.words[I]|0)+p,p=d>>26,this.words[I]=d&67108863;for(;p!==0&&I<x.length;I++)d=(x.words[I]|0)+p,p=d>>26,this.words[I]=d&67108863;if(p===0&&I<x.length&&x!==this)for(;I<x.length;I++)this.words[I]=x.words[I];return this.length=Math.max(this.length,I),x!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(f){return this.clone().isub(f)};function D(y,f,d){d.negative=f.negative^y.negative;var _=y.length+f.length|0;d.length=_,_=_-1|0;var x=y.words[0]|0,b=f.words[0]|0,p=x*b,I=p&67108863,T=p/67108864|0;d.words[0]=I;for(var S=1;S<_;S++){for(var R=T>>>26,Y=T&67108863,X=Math.min(S,f.length-1),ie=Math.max(0,S-y.length+1);ie<=X;ie++){var ce=S-ie|0;x=y.words[ce]|0,b=f.words[ie]|0,p=x*b+Y,R+=p/67108864|0,Y=p&67108863}d.words[S]=Y|0,T=R|0}return T!==0?d.words[S]=T|0:d.length--,d._strip()}var L=function(f,d,_){var x=f.words,b=d.words,p=_.words,I=0,T,S,R,Y=x[0]|0,X=Y&8191,ie=Y>>>13,ce=x[1]|0,pe=ce&8191,q=ce>>>13,W=x[2]|0,$=W&8191,ee=W>>>13,se=x[3]|0,ue=se&8191,le=se>>>13,Ae=x[4]|0,ge=Ae&8191,ve=Ae>>>13,sr=x[5]|0,xe=sr&8191,ye=sr>>>13,Re=x[6]|0,be=Re&8191,_e=Re>>>13,Qi=x[7]|0,Be=Qi&8191,ke=Qi>>>13,$s=x[8]|0,Ce=$s&8191,Le=$s>>>13,$l=x[9]|0,qe=$l&8191,Ue=$l>>>13,Xl=b[0]|0,Fe=Xl&8191,He=Xl>>>13,Jl=b[1]|0,je=Jl&8191,ze=Jl>>>13,Ql=b[2]|0,Ke=Ql&8191,Ve=Ql>>>13,eh=b[3]|0,Ge=eh&8191,Ze=eh>>>13,th=b[4]|0,We=th&8191,Ye=th>>>13,rh=b[5]|0,$e=rh&8191,Xe=rh>>>13,ih=b[6]|0,Je=ih&8191,Qe=ih>>>13,nh=b[7]|0,et=nh&8191,tt=nh>>>13,oh=b[8]|0,rt=oh&8191,it=oh>>>13,Wf=b[9]|0,Jt=Wf&8191,Qt=Wf>>>13;_.negative=f.negative^d.negative,_.length=19,T=Math.imul(X,Fe),S=Math.imul(X,He),S=S+Math.imul(ie,Fe)|0,R=Math.imul(ie,He);var Xs=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,T=Math.imul(pe,Fe),S=Math.imul(pe,He),S=S+Math.imul(q,Fe)|0,R=Math.imul(q,He),T=T+Math.imul(X,je)|0,S=S+Math.imul(X,ze)|0,S=S+Math.imul(ie,je)|0,R=R+Math.imul(ie,ze)|0;var Js=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Js>>>26)|0,Js&=67108863,T=Math.imul($,Fe),S=Math.imul($,He),S=S+Math.imul(ee,Fe)|0,R=Math.imul(ee,He),T=T+Math.imul(pe,je)|0,S=S+Math.imul(pe,ze)|0,S=S+Math.imul(q,je)|0,R=R+Math.imul(q,ze)|0,T=T+Math.imul(X,Ke)|0,S=S+Math.imul(X,Ve)|0,S=S+Math.imul(ie,Ke)|0,R=R+Math.imul(ie,Ve)|0;var Qs=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Qs>>>26)|0,Qs&=67108863,T=Math.imul(ue,Fe),S=Math.imul(ue,He),S=S+Math.imul(le,Fe)|0,R=Math.imul(le,He),T=T+Math.imul($,je)|0,S=S+Math.imul($,ze)|0,S=S+Math.imul(ee,je)|0,R=R+Math.imul(ee,ze)|0,T=T+Math.imul(pe,Ke)|0,S=S+Math.imul(pe,Ve)|0,S=S+Math.imul(q,Ke)|0,R=R+Math.imul(q,Ve)|0,T=T+Math.imul(X,Ge)|0,S=S+Math.imul(X,Ze)|0,S=S+Math.imul(ie,Ge)|0,R=R+Math.imul(ie,Ze)|0;var eu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(eu>>>26)|0,eu&=67108863,T=Math.imul(ge,Fe),S=Math.imul(ge,He),S=S+Math.imul(ve,Fe)|0,R=Math.imul(ve,He),T=T+Math.imul(ue,je)|0,S=S+Math.imul(ue,ze)|0,S=S+Math.imul(le,je)|0,R=R+Math.imul(le,ze)|0,T=T+Math.imul($,Ke)|0,S=S+Math.imul($,Ve)|0,S=S+Math.imul(ee,Ke)|0,R=R+Math.imul(ee,Ve)|0,T=T+Math.imul(pe,Ge)|0,S=S+Math.imul(pe,Ze)|0,S=S+Math.imul(q,Ge)|0,R=R+Math.imul(q,Ze)|0,T=T+Math.imul(X,We)|0,S=S+Math.imul(X,Ye)|0,S=S+Math.imul(ie,We)|0,R=R+Math.imul(ie,Ye)|0;var tu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(tu>>>26)|0,tu&=67108863,T=Math.imul(xe,Fe),S=Math.imul(xe,He),S=S+Math.imul(ye,Fe)|0,R=Math.imul(ye,He),T=T+Math.imul(ge,je)|0,S=S+Math.imul(ge,ze)|0,S=S+Math.imul(ve,je)|0,R=R+Math.imul(ve,ze)|0,T=T+Math.imul(ue,Ke)|0,S=S+Math.imul(ue,Ve)|0,S=S+Math.imul(le,Ke)|0,R=R+Math.imul(le,Ve)|0,T=T+Math.imul($,Ge)|0,S=S+Math.imul($,Ze)|0,S=S+Math.imul(ee,Ge)|0,R=R+Math.imul(ee,Ze)|0,T=T+Math.imul(pe,We)|0,S=S+Math.imul(pe,Ye)|0,S=S+Math.imul(q,We)|0,R=R+Math.imul(q,Ye)|0,T=T+Math.imul(X,$e)|0,S=S+Math.imul(X,Xe)|0,S=S+Math.imul(ie,$e)|0,R=R+Math.imul(ie,Xe)|0;var ru=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(ru>>>26)|0,ru&=67108863,T=Math.imul(be,Fe),S=Math.imul(be,He),S=S+Math.imul(_e,Fe)|0,R=Math.imul(_e,He),T=T+Math.imul(xe,je)|0,S=S+Math.imul(xe,ze)|0,S=S+Math.imul(ye,je)|0,R=R+Math.imul(ye,ze)|0,T=T+Math.imul(ge,Ke)|0,S=S+Math.imul(ge,Ve)|0,S=S+Math.imul(ve,Ke)|0,R=R+Math.imul(ve,Ve)|0,T=T+Math.imul(ue,Ge)|0,S=S+Math.imul(ue,Ze)|0,S=S+Math.imul(le,Ge)|0,R=R+Math.imul(le,Ze)|0,T=T+Math.imul($,We)|0,S=S+Math.imul($,Ye)|0,S=S+Math.imul(ee,We)|0,R=R+Math.imul(ee,Ye)|0,T=T+Math.imul(pe,$e)|0,S=S+Math.imul(pe,Xe)|0,S=S+Math.imul(q,$e)|0,R=R+Math.imul(q,Xe)|0,T=T+Math.imul(X,Je)|0,S=S+Math.imul(X,Qe)|0,S=S+Math.imul(ie,Je)|0,R=R+Math.imul(ie,Qe)|0;var iu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(iu>>>26)|0,iu&=67108863,T=Math.imul(Be,Fe),S=Math.imul(Be,He),S=S+Math.imul(ke,Fe)|0,R=Math.imul(ke,He),T=T+Math.imul(be,je)|0,S=S+Math.imul(be,ze)|0,S=S+Math.imul(_e,je)|0,R=R+Math.imul(_e,ze)|0,T=T+Math.imul(xe,Ke)|0,S=S+Math.imul(xe,Ve)|0,S=S+Math.imul(ye,Ke)|0,R=R+Math.imul(ye,Ve)|0,T=T+Math.imul(ge,Ge)|0,S=S+Math.imul(ge,Ze)|0,S=S+Math.imul(ve,Ge)|0,R=R+Math.imul(ve,Ze)|0,T=T+Math.imul(ue,We)|0,S=S+Math.imul(ue,Ye)|0,S=S+Math.imul(le,We)|0,R=R+Math.imul(le,Ye)|0,T=T+Math.imul($,$e)|0,S=S+Math.imul($,Xe)|0,S=S+Math.imul(ee,$e)|0,R=R+Math.imul(ee,Xe)|0,T=T+Math.imul(pe,Je)|0,S=S+Math.imul(pe,Qe)|0,S=S+Math.imul(q,Je)|0,R=R+Math.imul(q,Qe)|0,T=T+Math.imul(X,et)|0,S=S+Math.imul(X,tt)|0,S=S+Math.imul(ie,et)|0,R=R+Math.imul(ie,tt)|0;var nu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(nu>>>26)|0,nu&=67108863,T=Math.imul(Ce,Fe),S=Math.imul(Ce,He),S=S+Math.imul(Le,Fe)|0,R=Math.imul(Le,He),T=T+Math.imul(Be,je)|0,S=S+Math.imul(Be,ze)|0,S=S+Math.imul(ke,je)|0,R=R+Math.imul(ke,ze)|0,T=T+Math.imul(be,Ke)|0,S=S+Math.imul(be,Ve)|0,S=S+Math.imul(_e,Ke)|0,R=R+Math.imul(_e,Ve)|0,T=T+Math.imul(xe,Ge)|0,S=S+Math.imul(xe,Ze)|0,S=S+Math.imul(ye,Ge)|0,R=R+Math.imul(ye,Ze)|0,T=T+Math.imul(ge,We)|0,S=S+Math.imul(ge,Ye)|0,S=S+Math.imul(ve,We)|0,R=R+Math.imul(ve,Ye)|0,T=T+Math.imul(ue,$e)|0,S=S+Math.imul(ue,Xe)|0,S=S+Math.imul(le,$e)|0,R=R+Math.imul(le,Xe)|0,T=T+Math.imul($,Je)|0,S=S+Math.imul($,Qe)|0,S=S+Math.imul(ee,Je)|0,R=R+Math.imul(ee,Qe)|0,T=T+Math.imul(pe,et)|0,S=S+Math.imul(pe,tt)|0,S=S+Math.imul(q,et)|0,R=R+Math.imul(q,tt)|0,T=T+Math.imul(X,rt)|0,S=S+Math.imul(X,it)|0,S=S+Math.imul(ie,rt)|0,R=R+Math.imul(ie,it)|0;var ou=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(ou>>>26)|0,ou&=67108863,T=Math.imul(qe,Fe),S=Math.imul(qe,He),S=S+Math.imul(Ue,Fe)|0,R=Math.imul(Ue,He),T=T+Math.imul(Ce,je)|0,S=S+Math.imul(Ce,ze)|0,S=S+Math.imul(Le,je)|0,R=R+Math.imul(Le,ze)|0,T=T+Math.imul(Be,Ke)|0,S=S+Math.imul(Be,Ve)|0,S=S+Math.imul(ke,Ke)|0,R=R+Math.imul(ke,Ve)|0,T=T+Math.imul(be,Ge)|0,S=S+Math.imul(be,Ze)|0,S=S+Math.imul(_e,Ge)|0,R=R+Math.imul(_e,Ze)|0,T=T+Math.imul(xe,We)|0,S=S+Math.imul(xe,Ye)|0,S=S+Math.imul(ye,We)|0,R=R+Math.imul(ye,Ye)|0,T=T+Math.imul(ge,$e)|0,S=S+Math.imul(ge,Xe)|0,S=S+Math.imul(ve,$e)|0,R=R+Math.imul(ve,Xe)|0,T=T+Math.imul(ue,Je)|0,S=S+Math.imul(ue,Qe)|0,S=S+Math.imul(le,Je)|0,R=R+Math.imul(le,Qe)|0,T=T+Math.imul($,et)|0,S=S+Math.imul($,tt)|0,S=S+Math.imul(ee,et)|0,R=R+Math.imul(ee,tt)|0,T=T+Math.imul(pe,rt)|0,S=S+Math.imul(pe,it)|0,S=S+Math.imul(q,rt)|0,R=R+Math.imul(q,it)|0,T=T+Math.imul(X,Jt)|0,S=S+Math.imul(X,Qt)|0,S=S+Math.imul(ie,Jt)|0,R=R+Math.imul(ie,Qt)|0;var au=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(au>>>26)|0,au&=67108863,T=Math.imul(qe,je),S=Math.imul(qe,ze),S=S+Math.imul(Ue,je)|0,R=Math.imul(Ue,ze),T=T+Math.imul(Ce,Ke)|0,S=S+Math.imul(Ce,Ve)|0,S=S+Math.imul(Le,Ke)|0,R=R+Math.imul(Le,Ve)|0,T=T+Math.imul(Be,Ge)|0,S=S+Math.imul(Be,Ze)|0,S=S+Math.imul(ke,Ge)|0,R=R+Math.imul(ke,Ze)|0,T=T+Math.imul(be,We)|0,S=S+Math.imul(be,Ye)|0,S=S+Math.imul(_e,We)|0,R=R+Math.imul(_e,Ye)|0,T=T+Math.imul(xe,$e)|0,S=S+Math.imul(xe,Xe)|0,S=S+Math.imul(ye,$e)|0,R=R+Math.imul(ye,Xe)|0,T=T+Math.imul(ge,Je)|0,S=S+Math.imul(ge,Qe)|0,S=S+Math.imul(ve,Je)|0,R=R+Math.imul(ve,Qe)|0,T=T+Math.imul(ue,et)|0,S=S+Math.imul(ue,tt)|0,S=S+Math.imul(le,et)|0,R=R+Math.imul(le,tt)|0,T=T+Math.imul($,rt)|0,S=S+Math.imul($,it)|0,S=S+Math.imul(ee,rt)|0,R=R+Math.imul(ee,it)|0,T=T+Math.imul(pe,Jt)|0,S=S+Math.imul(pe,Qt)|0,S=S+Math.imul(q,Jt)|0,R=R+Math.imul(q,Qt)|0;var su=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(su>>>26)|0,su&=67108863,T=Math.imul(qe,Ke),S=Math.imul(qe,Ve),S=S+Math.imul(Ue,Ke)|0,R=Math.imul(Ue,Ve),T=T+Math.imul(Ce,Ge)|0,S=S+Math.imul(Ce,Ze)|0,S=S+Math.imul(Le,Ge)|0,R=R+Math.imul(Le,Ze)|0,T=T+Math.imul(Be,We)|0,S=S+Math.imul(Be,Ye)|0,S=S+Math.imul(ke,We)|0,R=R+Math.imul(ke,Ye)|0,T=T+Math.imul(be,$e)|0,S=S+Math.imul(be,Xe)|0,S=S+Math.imul(_e,$e)|0,R=R+Math.imul(_e,Xe)|0,T=T+Math.imul(xe,Je)|0,S=S+Math.imul(xe,Qe)|0,S=S+Math.imul(ye,Je)|0,R=R+Math.imul(ye,Qe)|0,T=T+Math.imul(ge,et)|0,S=S+Math.imul(ge,tt)|0,S=S+Math.imul(ve,et)|0,R=R+Math.imul(ve,tt)|0,T=T+Math.imul(ue,rt)|0,S=S+Math.imul(ue,it)|0,S=S+Math.imul(le,rt)|0,R=R+Math.imul(le,it)|0,T=T+Math.imul($,Jt)|0,S=S+Math.imul($,Qt)|0,S=S+Math.imul(ee,Jt)|0,R=R+Math.imul(ee,Qt)|0;var uu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(uu>>>26)|0,uu&=67108863,T=Math.imul(qe,Ge),S=Math.imul(qe,Ze),S=S+Math.imul(Ue,Ge)|0,R=Math.imul(Ue,Ze),T=T+Math.imul(Ce,We)|0,S=S+Math.imul(Ce,Ye)|0,S=S+Math.imul(Le,We)|0,R=R+Math.imul(Le,Ye)|0,T=T+Math.imul(Be,$e)|0,S=S+Math.imul(Be,Xe)|0,S=S+Math.imul(ke,$e)|0,R=R+Math.imul(ke,Xe)|0,T=T+Math.imul(be,Je)|0,S=S+Math.imul(be,Qe)|0,S=S+Math.imul(_e,Je)|0,R=R+Math.imul(_e,Qe)|0,T=T+Math.imul(xe,et)|0,S=S+Math.imul(xe,tt)|0,S=S+Math.imul(ye,et)|0,R=R+Math.imul(ye,tt)|0,T=T+Math.imul(ge,rt)|0,S=S+Math.imul(ge,it)|0,S=S+Math.imul(ve,rt)|0,R=R+Math.imul(ve,it)|0,T=T+Math.imul(ue,Jt)|0,S=S+Math.imul(ue,Qt)|0,S=S+Math.imul(le,Jt)|0,R=R+Math.imul(le,Qt)|0;var fu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(fu>>>26)|0,fu&=67108863,T=Math.imul(qe,We),S=Math.imul(qe,Ye),S=S+Math.imul(Ue,We)|0,R=Math.imul(Ue,Ye),T=T+Math.imul(Ce,$e)|0,S=S+Math.imul(Ce,Xe)|0,S=S+Math.imul(Le,$e)|0,R=R+Math.imul(Le,Xe)|0,T=T+Math.imul(Be,Je)|0,S=S+Math.imul(Be,Qe)|0,S=S+Math.imul(ke,Je)|0,R=R+Math.imul(ke,Qe)|0,T=T+Math.imul(be,et)|0,S=S+Math.imul(be,tt)|0,S=S+Math.imul(_e,et)|0,R=R+Math.imul(_e,tt)|0,T=T+Math.imul(xe,rt)|0,S=S+Math.imul(xe,it)|0,S=S+Math.imul(ye,rt)|0,R=R+Math.imul(ye,it)|0,T=T+Math.imul(ge,Jt)|0,S=S+Math.imul(ge,Qt)|0,S=S+Math.imul(ve,Jt)|0,R=R+Math.imul(ve,Qt)|0;var cu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(cu>>>26)|0,cu&=67108863,T=Math.imul(qe,$e),S=Math.imul(qe,Xe),S=S+Math.imul(Ue,$e)|0,R=Math.imul(Ue,Xe),T=T+Math.imul(Ce,Je)|0,S=S+Math.imul(Ce,Qe)|0,S=S+Math.imul(Le,Je)|0,R=R+Math.imul(Le,Qe)|0,T=T+Math.imul(Be,et)|0,S=S+Math.imul(Be,tt)|0,S=S+Math.imul(ke,et)|0,R=R+Math.imul(ke,tt)|0,T=T+Math.imul(be,rt)|0,S=S+Math.imul(be,it)|0,S=S+Math.imul(_e,rt)|0,R=R+Math.imul(_e,it)|0,T=T+Math.imul(xe,Jt)|0,S=S+Math.imul(xe,Qt)|0,S=S+Math.imul(ye,Jt)|0,R=R+Math.imul(ye,Qt)|0;var lu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(lu>>>26)|0,lu&=67108863,T=Math.imul(qe,Je),S=Math.imul(qe,Qe),S=S+Math.imul(Ue,Je)|0,R=Math.imul(Ue,Qe),T=T+Math.imul(Ce,et)|0,S=S+Math.imul(Ce,tt)|0,S=S+Math.imul(Le,et)|0,R=R+Math.imul(Le,tt)|0,T=T+Math.imul(Be,rt)|0,S=S+Math.imul(Be,it)|0,S=S+Math.imul(ke,rt)|0,R=R+Math.imul(ke,it)|0,T=T+Math.imul(be,Jt)|0,S=S+Math.imul(be,Qt)|0,S=S+Math.imul(_e,Jt)|0,R=R+Math.imul(_e,Qt)|0;var hu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(hu>>>26)|0,hu&=67108863,T=Math.imul(qe,et),S=Math.imul(qe,tt),S=S+Math.imul(Ue,et)|0,R=Math.imul(Ue,tt),T=T+Math.imul(Ce,rt)|0,S=S+Math.imul(Ce,it)|0,S=S+Math.imul(Le,rt)|0,R=R+Math.imul(Le,it)|0,T=T+Math.imul(Be,Jt)|0,S=S+Math.imul(Be,Qt)|0,S=S+Math.imul(ke,Jt)|0,R=R+Math.imul(ke,Qt)|0;var M5=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(M5>>>26)|0,M5&=67108863,T=Math.imul(qe,rt),S=Math.imul(qe,it),S=S+Math.imul(Ue,rt)|0,R=Math.imul(Ue,it),T=T+Math.imul(Ce,Jt)|0,S=S+Math.imul(Ce,Qt)|0,S=S+Math.imul(Le,Jt)|0,R=R+Math.imul(Le,Qt)|0;var N5=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(N5>>>26)|0,N5&=67108863,T=Math.imul(qe,Jt),S=Math.imul(qe,Qt),S=S+Math.imul(Ue,Jt)|0,R=Math.imul(Ue,Qt);var C5=(I+T|0)+((S&8191)<<13)|0;return I=(R+(S>>>13)|0)+(C5>>>26)|0,C5&=67108863,p[0]=Xs,p[1]=Js,p[2]=Qs,p[3]=eu,p[4]=tu,p[5]=ru,p[6]=iu,p[7]=nu,p[8]=ou,p[9]=au,p[10]=su,p[11]=uu,p[12]=fu,p[13]=cu,p[14]=lu,p[15]=hu,p[16]=M5,p[17]=N5,p[18]=C5,I!==0&&(p[19]=I,_.length++),_};Math.imul||(L=D);function U(y,f,d){d.negative=f.negative^y.negative,d.length=y.length+f.length;for(var _=0,x=0,b=0;b<d.length-1;b++){var p=x;x=0;for(var I=_&67108863,T=Math.min(b,f.length-1),S=Math.max(0,b-y.length+1);S<=T;S++){var R=b-S,Y=y.words[R]|0,X=f.words[S]|0,ie=Y*X,ce=ie&67108863;p=p+(ie/67108864|0)|0,ce=ce+I|0,I=ce&67108863,p=p+(ce>>>26)|0,x+=p>>>26,p&=67108863}d.words[b]=I,_=p,p=x}return _!==0?d.words[b]=_:d.length--,d._strip()}function K(y,f,d){return U(y,f,d)}n.prototype.mulTo=function(f,d){var _,x=this.length+f.length;return this.length===10&&f.length===10?_=L(this,f,d):x<63?_=D(this,f,d):x<1024?_=U(this,f,d):_=K(this,f,d),_};function N(y,f){this.x=y,this.y=f}N.prototype.makeRBT=function(f){for(var d=new Array(f),_=n.prototype._countBits(f)-1,x=0;x<f;x++)d[x]=this.revBin(x,_,f);return d},N.prototype.revBin=function(f,d,_){if(f===0||f===_-1)return f;for(var x=0,b=0;b<d;b++)x|=(f&1)<<d-b-1,f>>=1;return x},N.prototype.permute=function(f,d,_,x,b,p){for(var I=0;I<p;I++)x[I]=d[f[I]],b[I]=_[f[I]]},N.prototype.transform=function(f,d,_,x,b,p){this.permute(p,f,d,_,x,b);for(var I=1;I<b;I<<=1)for(var T=I<<1,S=Math.cos(2*Math.PI/T),R=Math.sin(2*Math.PI/T),Y=0;Y<b;Y+=T)for(var X=S,ie=R,ce=0;ce<I;ce++){var pe=_[Y+ce],q=x[Y+ce],W=_[Y+ce+I],$=x[Y+ce+I],ee=X*W-ie*$;$=X*$+ie*W,W=ee,_[Y+ce]=pe+W,x[Y+ce]=q+$,_[Y+ce+I]=pe-W,x[Y+ce+I]=q-$,ce!==T&&(ee=S*X-R*ie,ie=S*ie+R*X,X=ee)}},N.prototype.guessLen13b=function(f,d){var _=Math.max(d,f)|1,x=_&1,b=0;for(_=_/2|0;_;_=_>>>1)b++;return 1<<b+1+x},N.prototype.conjugate=function(f,d,_){if(!(_<=1))for(var x=0;x<_/2;x++){var b=f[x];f[x]=f[_-x-1],f[_-x-1]=b,b=d[x],d[x]=-d[_-x-1],d[_-x-1]=-b}},N.prototype.normalize13b=function(f,d){for(var _=0,x=0;x<d/2;x++){var b=Math.round(f[2*x+1]/d)*8192+Math.round(f[2*x]/d)+_;f[x]=b&67108863,b<67108864?_=0:_=b/67108864|0}return f},N.prototype.convert13b=function(f,d,_,x){for(var b=0,p=0;p<d;p++)b=b+(f[p]|0),_[2*p]=b&8191,b=b>>>13,_[2*p+1]=b&8191,b=b>>>13;for(p=2*d;p<x;++p)_[p]=0;r(b===0),r((b&-8192)===0)},N.prototype.stub=function(f){for(var d=new Array(f),_=0;_<f;_++)d[_]=0;return d},N.prototype.mulp=function(f,d,_){var x=2*this.guessLen13b(f.length,d.length),b=this.makeRBT(x),p=this.stub(x),I=new Array(x),T=new Array(x),S=new Array(x),R=new Array(x),Y=new Array(x),X=new Array(x),ie=_.words;ie.length=x,this.convert13b(f.words,f.length,I,x),this.convert13b(d.words,d.length,R,x),this.transform(I,p,T,S,x,b),this.transform(R,p,Y,X,x,b);for(var ce=0;ce<x;ce++){var pe=T[ce]*Y[ce]-S[ce]*X[ce];S[ce]=T[ce]*X[ce]+S[ce]*Y[ce],T[ce]=pe}return this.conjugate(T,S,x),this.transform(T,S,ie,p,x,b),this.conjugate(ie,p,x),this.normalize13b(ie,x),_.negative=f.negative^d.negative,_.length=f.length+d.length,_._strip()},n.prototype.mul=function(f){var d=new n(null);return d.words=new Array(this.length+f.length),this.mulTo(f,d)},n.prototype.mulf=function(f){var d=new n(null);return d.words=new Array(this.length+f.length),K(this,f,d)},n.prototype.imul=function(f){return this.clone().mulTo(f,this)},n.prototype.imuln=function(f){var d=f<0;d&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var _=0,x=0;x<this.length;x++){var b=(this.words[x]|0)*f,p=(b&67108863)+(_&67108863);_>>=26,_+=b/67108864|0,_+=p>>>26,this.words[x]=p&67108863}return _!==0&&(this.words[x]=_,this.length++),this.length=f===0?1:this.length,d?this.ineg():this},n.prototype.muln=function(f){return this.clone().imuln(f)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(f){var d=M(f);if(d.length===0)return new n(1);for(var _=this,x=0;x<d.length&&d[x]===0;x++,_=_.sqr());if(++x<d.length)for(var b=_.sqr();x<d.length;x++,b=b.sqr())d[x]!==0&&(_=_.mul(b));return _},n.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26,x=67108863>>>26-d<<26-d,b;if(d!==0){var p=0;for(b=0;b<this.length;b++){var I=this.words[b]&x,T=(this.words[b]|0)-I<<d;this.words[b]=T|p,p=I>>>26-d}p&&(this.words[b]=p,this.length++)}if(_!==0){for(b=this.length-1;b>=0;b--)this.words[b+_]=this.words[b];for(b=0;b<_;b++)this.words[b]=0;this.length+=_}return this._strip()},n.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},n.prototype.iushrn=function(f,d,_){r(typeof f=="number"&&f>=0);var x;d?x=(d-d%26)/26:x=0;var b=f%26,p=Math.min((f-b)/26,this.length),I=67108863^67108863>>>b<<b,T=_;if(x-=p,x=Math.max(0,x),T){for(var S=0;S<p;S++)T.words[S]=this.words[S];T.length=p}if(p!==0)if(this.length>p)for(this.length-=p,S=0;S<this.length;S++)this.words[S]=this.words[S+p];else this.words[0]=0,this.length=1;var R=0;for(S=this.length-1;S>=0&&(R!==0||S>=x);S--){var Y=this.words[S]|0;this.words[S]=R<<26-b|Y>>>b,R=Y&I}return T&&R!==0&&(T.words[T.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(f,d,_){return r(this.negative===0),this.iushrn(f,d,_)},n.prototype.shln=function(f){return this.clone().ishln(f)},n.prototype.ushln=function(f){return this.clone().iushln(f)},n.prototype.shrn=function(f){return this.clone().ishrn(f)},n.prototype.ushrn=function(f){return this.clone().iushrn(f)},n.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26,x=1<<d;if(this.length<=_)return!1;var b=this.words[_];return!!(b&x)},n.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(d!==0&&_++,this.length=Math.min(_,this.length),d!==0){var x=67108863^67108863>>>d<<d;this.words[this.length-1]&=x}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.maskn=function(f){return this.clone().imaskn(f)},n.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},n.prototype._iaddn=function(f){this.words[0]+=f;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},n.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},n.prototype.addn=function(f){return this.clone().iaddn(f)},n.prototype.subn=function(f){return this.clone().isubn(f)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(f,d,_){var x=f.length+_,b;this._expand(x);var p,I=0;for(b=0;b<f.length;b++){p=(this.words[b+_]|0)+I;var T=(f.words[b]|0)*d;p-=T&67108863,I=(p>>26)-(T/67108864|0),this.words[b+_]=p&67108863}for(;b<this.length-_;b++)p=(this.words[b+_]|0)+I,I=p>>26,this.words[b+_]=p&67108863;if(I===0)return this._strip();for(r(I===-1),I=0,b=0;b<this.length;b++)p=-(this.words[b]|0)+I,I=p>>26,this.words[b]=p&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(f,d){var _=this.length-f.length,x=this.clone(),b=f,p=b.words[b.length-1]|0,I=this._countBits(p);_=26-I,_!==0&&(b=b.ushln(_),x.iushln(_),p=b.words[b.length-1]|0);var T=x.length-b.length,S;if(d!=="mod"){S=new n(null),S.length=T+1,S.words=new Array(S.length);for(var R=0;R<S.length;R++)S.words[R]=0}var Y=x.clone()._ishlnsubmul(b,1,T);Y.negative===0&&(x=Y,S&&(S.words[T]=1));for(var X=T-1;X>=0;X--){var ie=(x.words[b.length+X]|0)*67108864+(x.words[b.length+X-1]|0);for(ie=Math.min(ie/p|0,67108863),x._ishlnsubmul(b,ie,X);x.negative!==0;)ie--,x.negative=0,x._ishlnsubmul(b,1,X),x.isZero()||(x.negative^=1);S&&(S.words[X]=ie)}return S&&S._strip(),x._strip(),d!=="div"&&_!==0&&x.iushrn(_),{div:S||null,mod:x}},n.prototype.divmod=function(f,d,_){if(r(!f.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var x,b,p;return this.negative!==0&&f.negative===0?(p=this.neg().divmod(f,d),d!=="mod"&&(x=p.div.neg()),d!=="div"&&(b=p.mod.neg(),_&&b.negative!==0&&b.iadd(f)),{div:x,mod:b}):this.negative===0&&f.negative!==0?(p=this.divmod(f.neg(),d),d!=="mod"&&(x=p.div.neg()),{div:x,mod:p.mod}):(this.negative&f.negative)!==0?(p=this.neg().divmod(f.neg(),d),d!=="div"&&(b=p.mod.neg(),_&&b.negative!==0&&b.isub(f)),{div:p.div,mod:b}):f.length>this.length||this.cmp(f)<0?{div:new n(0),mod:this}:f.length===1?d==="div"?{div:this.divn(f.words[0]),mod:null}:d==="mod"?{div:null,mod:new n(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new n(this.modrn(f.words[0]))}:this._wordDiv(f,d)},n.prototype.div=function(f){return this.divmod(f,"div",!1).div},n.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},n.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},n.prototype.divRound=function(f){var d=this.divmod(f);if(d.mod.isZero())return d.div;var _=d.div.negative!==0?d.mod.isub(f):d.mod,x=f.ushrn(1),b=f.andln(1),p=_.cmp(x);return p<0||b===1&&p===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},n.prototype.modrn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var _=(1<<26)%f,x=0,b=this.length-1;b>=0;b--)x=(_*x+(this.words[b]|0))%f;return d?-x:x},n.prototype.modn=function(f){return this.modrn(f)},n.prototype.idivn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var _=0,x=this.length-1;x>=0;x--){var b=(this.words[x]|0)+_*67108864;this.words[x]=b/f|0,_=b%f}return this._strip(),d?this.ineg():this},n.prototype.divn=function(f){return this.clone().idivn(f)},n.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var d=this,_=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var x=new n(1),b=new n(0),p=new n(0),I=new n(1),T=0;d.isEven()&&_.isEven();)d.iushrn(1),_.iushrn(1),++T;for(var S=_.clone(),R=d.clone();!d.isZero();){for(var Y=0,X=1;(d.words[0]&X)===0&&Y<26;++Y,X<<=1);if(Y>0)for(d.iushrn(Y);Y-- >0;)(x.isOdd()||b.isOdd())&&(x.iadd(S),b.isub(R)),x.iushrn(1),b.iushrn(1);for(var ie=0,ce=1;(_.words[0]&ce)===0&&ie<26;++ie,ce<<=1);if(ie>0)for(_.iushrn(ie);ie-- >0;)(p.isOdd()||I.isOdd())&&(p.iadd(S),I.isub(R)),p.iushrn(1),I.iushrn(1);d.cmp(_)>=0?(d.isub(_),x.isub(p),b.isub(I)):(_.isub(d),p.isub(x),I.isub(b))}return{a:p,b:I,gcd:_.iushln(T)}},n.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var d=this,_=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var x=new n(1),b=new n(0),p=_.clone();d.cmpn(1)>0&&_.cmpn(1)>0;){for(var I=0,T=1;(d.words[0]&T)===0&&I<26;++I,T<<=1);if(I>0)for(d.iushrn(I);I-- >0;)x.isOdd()&&x.iadd(p),x.iushrn(1);for(var S=0,R=1;(_.words[0]&R)===0&&S<26;++S,R<<=1);if(S>0)for(_.iushrn(S);S-- >0;)b.isOdd()&&b.iadd(p),b.iushrn(1);d.cmp(_)>=0?(d.isub(_),x.isub(b)):(_.isub(d),b.isub(x))}var Y;return d.cmpn(1)===0?Y=x:Y=b,Y.cmpn(0)<0&&Y.iadd(f),Y},n.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var d=this.clone(),_=f.clone();d.negative=0,_.negative=0;for(var x=0;d.isEven()&&_.isEven();x++)d.iushrn(1),_.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;_.isEven();)_.iushrn(1);var b=d.cmp(_);if(b<0){var p=d;d=_,_=p}else if(b===0||_.cmpn(1)===0)break;d.isub(_)}while(!0);return _.iushln(x)},n.prototype.invm=function(f){return this.egcd(f).a.umod(f)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(f){return this.words[0]&f},n.prototype.bincn=function(f){r(typeof f=="number");var d=f%26,_=(f-d)/26,x=1<<d;if(this.length<=_)return this._expand(_+1),this.words[_]|=x,this;for(var b=x,p=_;b!==0&&p<this.length;p++){var I=this.words[p]|0;I+=b,b=I>>>26,I&=67108863,this.words[p]=I}return b!==0&&(this.words[p]=b,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(f){var d=f<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var _;if(this.length>1)_=1;else{d&&(f=-f),r(f<=67108863,"Number is too big");var x=this.words[0]|0;_=x===f?0:x<f?-1:1}return this.negative!==0?-_|0:_},n.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var d=this.ucmp(f);return this.negative!==0?-d|0:d},n.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var d=0,_=this.length-1;_>=0;_--){var x=this.words[_]|0,b=f.words[_]|0;if(x!==b){x<b?d=-1:x>b&&(d=1);break}}return d},n.prototype.gtn=function(f){return this.cmpn(f)===1},n.prototype.gt=function(f){return this.cmp(f)===1},n.prototype.gten=function(f){return this.cmpn(f)>=0},n.prototype.gte=function(f){return this.cmp(f)>=0},n.prototype.ltn=function(f){return this.cmpn(f)===-1},n.prototype.lt=function(f){return this.cmp(f)===-1},n.prototype.lten=function(f){return this.cmpn(f)<=0},n.prototype.lte=function(f){return this.cmp(f)<=0},n.prototype.eqn=function(f){return this.cmpn(f)===0},n.prototype.eq=function(f){return this.cmp(f)===0},n.red=function(f){return new g(f)},n.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(f){return this.red=f,this},n.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},n.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},n.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},n.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},n.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},n.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},n.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},n.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var C={k256:null,p224:null,p192:null,p25519:null};function F(y,f){this.name=y,this.p=new n(f,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var f=new n(null);return f.words=new Array(Math.ceil(this.n/13)),f},F.prototype.ireduce=function(f){var d=f,_;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),_=d.bitLength();while(_>this.n);var x=_<this.n?-1:d.ucmp(this.p);return x===0?(d.words[0]=0,d.length=1):x>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},F.prototype.split=function(f,d){f.iushrn(this.n,0,d)},F.prototype.imulK=function(f){return f.imul(this.k)};function H(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(H,F),H.prototype.split=function(f,d){for(var _=4194303,x=Math.min(f.length,9),b=0;b<x;b++)d.words[b]=f.words[b];if(d.length=x,f.length<=9){f.words[0]=0,f.length=1;return}var p=f.words[9];for(d.words[d.length++]=p&_,b=10;b<f.length;b++){var I=f.words[b]|0;f.words[b-10]=(I&_)<<4|p>>>22,p=I}p>>>=22,f.words[b-10]=p,p===0&&f.length>10?f.length-=10:f.length-=9},H.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var d=0,_=0;_<f.length;_++){var x=f.words[_]|0;d+=x*977,f.words[_]=d&67108863,d=x*64+(d/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function z(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(z,F);function G(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(G,F);function B(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(B,F),B.prototype.imulK=function(f){for(var d=0,_=0;_<f.length;_++){var x=(f.words[_]|0)*19+d,b=x&67108863;x>>>=26,f.words[_]=b,d=x}return d!==0&&(f.words[f.length++]=d),f},n._prime=function(f){if(C[f])return C[f];var d;if(f==="k256")d=new H;else if(f==="p224")d=new z;else if(f==="p192")d=new G;else if(f==="p25519")d=new B;else throw new Error("Unknown prime "+f);return C[f]=d,d};function g(y){if(typeof y=="string"){var f=n._prime(y);this.m=f.p,this.prime=f}else r(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}g.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},g.prototype._verify2=function(f,d){r((f.negative|d.negative)===0,"red works only with positives"),r(f.red&&f.red===d.red,"red works only with red numbers")},g.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},g.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},g.prototype.add=function(f,d){this._verify2(f,d);var _=f.add(d);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},g.prototype.iadd=function(f,d){this._verify2(f,d);var _=f.iadd(d);return _.cmp(this.m)>=0&&_.isub(this.m),_},g.prototype.sub=function(f,d){this._verify2(f,d);var _=f.sub(d);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},g.prototype.isub=function(f,d){this._verify2(f,d);var _=f.isub(d);return _.cmpn(0)<0&&_.iadd(this.m),_},g.prototype.shl=function(f,d){return this._verify1(f),this.imod(f.ushln(d))},g.prototype.imul=function(f,d){return this._verify2(f,d),this.imod(f.imul(d))},g.prototype.mul=function(f,d){return this._verify2(f,d),this.imod(f.mul(d))},g.prototype.isqr=function(f){return this.imul(f,f.clone())},g.prototype.sqr=function(f){return this.mul(f,f)},g.prototype.sqrt=function(f){if(f.isZero())return f.clone();var d=this.m.andln(3);if(r(d%2===1),d===3){var _=this.m.add(new n(1)).iushrn(2);return this.pow(f,_)}for(var x=this.m.subn(1),b=0;!x.isZero()&&x.andln(1)===0;)b++,x.iushrn(1);r(!x.isZero());var p=new n(1).toRed(this),I=p.redNeg(),T=this.m.subn(1).iushrn(1),S=this.m.bitLength();for(S=new n(2*S*S).toRed(this);this.pow(S,T).cmp(I)!==0;)S.redIAdd(I);for(var R=this.pow(S,x),Y=this.pow(f,x.addn(1).iushrn(1)),X=this.pow(f,x),ie=b;X.cmp(p)!==0;){for(var ce=X,pe=0;ce.cmp(p)!==0;pe++)ce=ce.redSqr();r(pe<ie);var q=this.pow(R,new n(1).iushln(ie-pe-1));Y=Y.redMul(q),R=q.redSqr(),X=X.redMul(R),ie=pe}return Y},g.prototype.invm=function(f){var d=f._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},g.prototype.pow=function(f,d){if(d.isZero())return new n(1).toRed(this);if(d.cmpn(1)===0)return f.clone();var _=4,x=new Array(1<<_);x[0]=new n(1).toRed(this),x[1]=f;for(var b=2;b<x.length;b++)x[b]=this.mul(x[b-1],f);var p=x[0],I=0,T=0,S=d.bitLength()%26;for(S===0&&(S=26),b=d.length-1;b>=0;b--){for(var R=d.words[b],Y=S-1;Y>=0;Y--){var X=R>>Y&1;if(p!==x[0]&&(p=this.sqr(p)),X===0&&I===0){T=0;continue}I<<=1,I|=X,T++,!(T!==_&&(b!==0||Y!==0))&&(p=this.mul(p,x[I]),T=0,I=0)}S=26}return p},g.prototype.convertTo=function(f){var d=f.umod(this.m);return d===f?d.clone():d},g.prototype.convertFrom=function(f){var d=f.clone();return d.red=null,d},n.mont=function(f){return new O(f)};function O(y){g.call(this,y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(O,g),O.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},O.prototype.convertFrom=function(f){var d=this.imod(f.mul(this.rinv));return d.red=null,d},O.prototype.imul=function(f,d){if(f.isZero()||d.isZero())return f.words[0]=0,f.length=1,f;var _=f.imul(d),x=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=_.isub(x).iushrn(this.shift),p=b;return b.cmp(this.m)>=0?p=b.isub(this.m):b.cmpn(0)<0&&(p=b.iadd(this.m)),p._forceRed(this)},O.prototype.mul=function(f,d){if(f.isZero()||d.isZero())return new n(0)._forceRed(this);var _=f.mul(d),x=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=_.isub(x).iushrn(this.shift),p=b;return b.cmp(this.m)>=0?p=b.isub(this.m):b.cmpn(0)<0&&(p=b.iadd(this.m)),p._forceRed(this)},O.prototype.invm=function(f){var d=this.imod(f._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof qm>"u"||qm,qO)});var Um=k((L1e,jO)=>{"use strict";v();var Mc=UO(),GY=mu(),ZY=nt().Buffer;function FO(e){var t=e.modulus.byteLength(),r;do r=new Mc(GY(t));while(r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2));return r}function WY(e){var t=FO(e),r=t.toRed(Mc.mont(e.modulus)).redPow(new Mc(e.publicExponent)).fromRed();return{blinder:r,unblinder:t.invm(e.modulus)}}function HO(e,t){var r=WY(t),i=t.modulus.byteLength(),n=new Mc(e).mul(r.blinder).umod(t.modulus),o=n.toRed(Mc.mont(t.prime1)),a=n.toRed(Mc.mont(t.prime2)),s=t.coefficient,u=t.prime1,c=t.prime2,l=o.redPow(t.exponent1).fromRed(),m=a.redPow(t.exponent2).fromRed(),w=l.isub(m).imul(s).umod(u).imul(c);return m.iadd(w).imul(r.unblinder).umod(t.modulus).toArrayLike(ZY,"be",i)}HO.getr=FO;jO.exports=HO});var GO=k((U1e,VO)=>{v();var YY=Mm(),Fm=mu(),$Y=zh(),zO=Cm(),KO=Dm(),Hm=Nn(),XY=Lm(),JY=Um(),Un=nt().Buffer;VO.exports=function(t,r,i){var n;t.padding?n=t.padding:i?n=1:n=4;var o=YY(t),a;if(n===4)a=QY(o,r);else if(n===1)a=e$(o,r,i);else if(n===3){if(a=new Hm(r),a.cmp(o.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return i?JY(a,o):XY(a,o)};function QY(e,t){var r=e.modulus.byteLength(),i=t.length,n=$Y("sha1").update(Un.alloc(0)).digest(),o=n.length,a=2*o;if(i>r-a-2)throw new Error("message too long");var s=Un.alloc(r-i-a-2),u=r-o-1,c=Fm(o),l=KO(Un.concat([n,s,Un.alloc(1,1),t],u),zO(c,u)),m=KO(c,zO(l,o));return new Hm(Un.concat([Un.alloc(1),m,l],r))}function e$(e,t,r){var i=t.length,n=e.modulus.byteLength();if(i>n-11)throw new Error("message too long");var o;return r?o=Un.alloc(n-i-3,255):o=t$(n-i-3),new Hm(Un.concat([Un.from([0,r?1:2]),o,Un.alloc(1),t],n))}function t$(e){for(var t=Un.allocUnsafe(e),r=0,i=Fm(e*2),n=0,o;r<e;)n===i.length&&(i=Fm(e*2),n=0),o=i[n++],o&&(t[r++]=o);return t}});var XO=k((H1e,$O)=>{v();var r$=Mm(),ZO=Cm(),WO=Dm(),YO=Nn(),i$=Um(),n$=zh(),o$=Lm(),t0=nt().Buffer;$O.exports=function(t,r,i){var n;t.padding?n=t.padding:i?n=1:n=4;var o=r$(t),a=o.modulus.byteLength();if(r.length>a||new YO(r).cmp(o.modulus)>=0)throw new Error("decryption error");var s;i?s=o$(new YO(r),o):s=i$(r,o);var u=t0.alloc(a-s.length);if(s=t0.concat([u,s],a),n===4)return a$(o,s);if(n===1)return s$(o,s,i);if(n===3)return s;throw new Error("unknown padding")};function a$(e,t){var r=e.modulus.byteLength(),i=n$("sha1").update(t0.alloc(0)).digest(),n=i.length;if(t[0]!==0)throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=WO(o,ZO(a,n)),u=WO(a,ZO(s,r-n-1));if(u$(i,u.slice(0,n)))throw new Error("decryption error");for(var c=n;u[c]===0;)c++;if(u[c++]!==1)throw new Error("decryption error");return u.slice(c)}function s$(e,t,r){for(var i=t.slice(0,2),n=2,o=0;t[n++]!==0;)if(n>=t.length){o++;break}var a=t.slice(2,n-1);if((i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return t.slice(n)}function u$(e,t){e=t0.from(e),t=t0.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));for(var n=-1;++n<i;)r+=e[n]^t[n];return r}});var JO=k(Ku=>{v();Ku.publicEncrypt=GO();Ku.privateDecrypt=XO();Ku.privateEncrypt=function(t,r){return Ku.publicEncrypt(t,r,!0)};Ku.publicDecrypt=function(t,r){return Ku.privateDecrypt(t,r,!0)}});var uI=k(r0=>{"use strict";v();function QO(){throw new Error(`secure random number generation not supported by this browser
|
|
14
|
+
`)}});var wO=k(_O=>{v();var bO=_O;bO.der=Pm();bO.pem=yO()});var Tc=k(SO=>{v();var Bc=SO;Bc.bignum=Nn();Bc.define=ZE().define;Bc.base=Rc();Bc.constants=wm();Bc.decoders=hO();Bc.encoders=wO()});var IO=k((w1e,OO)=>{"use strict";v();var Dn=Tc(),xO=Dn.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),gY=Dn.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),Rm=Dn.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),vY=Dn.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Rm),this.key("subjectPublicKey").bitstr())}),mY=Dn.define("RelativeDistinguishedName",function(){this.setof(gY)}),yY=Dn.define("RDNSequence",function(){this.seqof(mY)}),EO=Dn.define("Name",function(){this.choice({rdnSequence:this.use(yY)})}),bY=Dn.define("Validity",function(){this.seq().obj(this.key("notBefore").use(xO),this.key("notAfter").use(xO))}),_Y=Dn.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),wY=Dn.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(Rm),this.key("issuer").use(EO),this.key("validity").use(bY),this.key("subject").use(EO),this.key("subjectPublicKeyInfo").use(vY),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(_Y).optional())}),SY=Dn.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(wY),this.key("signatureAlgorithm").use(Rm),this.key("signatureValue").bitstr())});OO.exports=SY});var PO=k(qn=>{"use strict";v();var Ln=Tc();qn.certificate=IO();var xY=Ln.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});qn.RSAPrivateKey=xY;var EY=Ln.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});qn.RSAPublicKey=EY;var AO=Ln.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),OY=Ln.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(AO),this.key("subjectPublicKey").bitstr())});qn.PublicKey=OY;var IY=Ln.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(AO),this.key("subjectPrivateKey").octstr())});qn.PrivateKey=IY;var AY=Ln.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});qn.EncryptedPrivateKey=AY;var PY=Ln.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});qn.DSAPrivateKey=PY;qn.DSAparam=Ln.define("DSAparam",function(){this.int()});var TY=Ln.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),kY=Ln.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(TY),this.key("publicKey").optional().explicit(1).bitstr())});qn.ECPrivateKey=kY;qn.signature=Ln.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})});var TO=k((O1e,RY)=>{RY.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}});var RO=k((I1e,kO)=>{"use strict";v();var BY=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,MY=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,NY=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,CY=Xh(),DY=q2(),V2=nt().Buffer;kO.exports=function(e,t){var r=e.toString(),i=r.match(BY),n;if(i){var a="aes"+i[1],s=V2.from(i[2],"hex"),u=V2.from(i[3].replace(/[\r\n]/g,""),"base64"),c=CY(t,s.slice(0,8),parseInt(i[1],10)).key,l=[],m=DY.createDecipheriv(a,c,s);l.push(m.update(u)),l.push(m.final()),n=V2.concat(l)}else{var o=r.match(NY);n=V2.from(o[2].replace(/[\r\n]/g,""),"base64")}var w=r.match(MY)[1];return{tag:w,data:n}}});var Mm=k((P1e,MO)=>{"use strict";v();var Ti=PO(),LY=TO(),qY=RO(),UY=q2(),FY=jv().pbkdf2Sync,Bm=nt().Buffer;function HY(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=LY[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=FY(t,r,i,s,"sha1"),c=UY.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),Bm.concat(l)}function BO(e){var t;typeof e=="object"&&!Bm.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e=="string"&&(e=Bm.from(e));var r=qY(e,t),i=r.tag,n=r.data,o,a;switch(i){case"CERTIFICATE":a=Ti.certificate.decode(n,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(a||(a=Ti.PublicKey.decode(n,"der")),o=a.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Ti.RSAPublicKey.decode(a.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return a.subjectPrivateKey=a.subjectPublicKey,{type:"ec",data:a};case"1.2.840.10040.4.1":return a.algorithm.params.pub_key=Ti.DSAparam.decode(a.subjectPublicKey.data,"der"),{type:"dsa",data:a.algorithm.params};default:throw new Error("unknown key id "+o)}case"ENCRYPTED PRIVATE KEY":n=Ti.EncryptedPrivateKey.decode(n,"der"),n=HY(n,t);case"PRIVATE KEY":switch(a=Ti.PrivateKey.decode(n,"der"),o=a.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Ti.RSAPrivateKey.decode(a.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:a.algorithm.curve,privateKey:Ti.ECPrivateKey.decode(a.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return a.algorithm.params.priv_key=Ti.DSAparam.decode(a.subjectPrivateKey,"der"),{type:"dsa",params:a.algorithm.params};default:throw new Error("unknown key id "+o)}case"RSA PUBLIC KEY":return Ti.RSAPublicKey.decode(n,"der");case"RSA PRIVATE KEY":return Ti.RSAPrivateKey.decode(n,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:Ti.DSAPrivateKey.decode(n,"der")};case"EC PRIVATE KEY":return n=Ti.ECPrivateKey.decode(n,"der"),{curve:n.parameters.value,privateKey:n.privateKey};default:throw new Error("unknown key type "+i)}}BO.signature=Ti.signature;MO.exports=BO});var Cm=k((k1e,NO)=>{v();var jY=zh(),Nm=nt().Buffer;NO.exports=function(e,t){for(var r=Nm.alloc(0),i=0,n;r.length<t;)n=zY(i++),r=Nm.concat([r,jY("sha1").update(e).update(n).digest()]);return r.slice(0,t)};function zY(e){var t=Nm.allocUnsafe(4);return t.writeUInt32BE(e,0),t}});var Dm=k((B1e,CO)=>{v();CO.exports=function(t,r){for(var i=t.length,n=-1;++n<i;)t[n]^=r[n];return t}});var Lm=k((N1e,LO)=>{v();var DO=Nn(),KY=nt().Buffer;function VY(e,t){return KY.from(e.toRed(DO.mont(t.modulus)).redPow(new DO(t.publicExponent)).fromRed().toArray())}LO.exports=VY});var UO=k((qO,qm)=>{v();(function(e,t){"use strict";function r(y,f){if(!y)throw new Error(f||"Assertion failed")}function i(y,f){y.super_=f;var d=function(){};d.prototype=f.prototype,y.prototype=new d,y.prototype.constructor=y}function n(y,f,d){if(n.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((f==="le"||f==="be")&&(d=f,f=10),this._init(y||0,f||10,d||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Kt().Buffer}catch{}n.isBN=function(f){return f instanceof n?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===n.wordSize&&Array.isArray(f.words)},n.max=function(f,d){return f.cmp(d)>0?f:d},n.min=function(f,d){return f.cmp(d)<0?f:d},n.prototype._init=function(f,d,_){if(typeof f=="number")return this._initNumber(f,d,_);if(typeof f=="object")return this._initArray(f,d,_);d==="hex"&&(d=16),r(d===(d|0)&&d>=2&&d<=36),f=f.toString().replace(/\s+/g,"");var x=0;f[0]==="-"&&(x++,this.negative=1),x<f.length&&(d===16?this._parseHex(f,x,_):(this._parseBase(f,d,x),_==="le"&&this._initArray(this.toArray(),d,_)))},n.prototype._initNumber=function(f,d,_){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),d,_)},n.prototype._initArray=function(f,d,_){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var b,p,I=0;if(_==="be")for(x=f.length-1,b=0;x>=0;x-=3)p=f[x]|f[x-1]<<8|f[x-2]<<16,this.words[b]|=p<<I&67108863,this.words[b+1]=p>>>26-I&67108863,I+=24,I>=26&&(I-=26,b++);else if(_==="le")for(x=0,b=0;x<f.length;x+=3)p=f[x]|f[x+1]<<8|f[x+2]<<16,this.words[b]|=p<<I&67108863,this.words[b+1]=p>>>26-I&67108863,I+=24,I>=26&&(I-=26,b++);return this._strip()};function a(y,f){var d=y.charCodeAt(f);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;r(!1,"Invalid character in "+y)}function s(y,f,d){var _=a(y,d);return d-1>=f&&(_|=a(y,d-1)<<4),_}n.prototype._parseHex=function(f,d,_){this.length=Math.ceil((f.length-d)/6),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var b=0,p=0,I;if(_==="be")for(x=f.length-1;x>=d;x-=2)I=s(f,d,x)<<b,this.words[p]|=I&67108863,b>=18?(b-=18,p+=1,this.words[p]|=I>>>26):b+=8;else{var T=f.length-d;for(x=T%2===0?d+1:d;x<f.length;x+=2)I=s(f,d,x)<<b,this.words[p]|=I&67108863,b>=18?(b-=18,p+=1,this.words[p]|=I>>>26):b+=8}this._strip()};function u(y,f,d,_){for(var x=0,b=0,p=Math.min(y.length,d),I=f;I<p;I++){var T=y.charCodeAt(I)-48;x*=_,T>=49?b=T-49+10:T>=17?b=T-17+10:b=T,r(T>=0&&b<_,"Invalid character"),x+=b}return x}n.prototype._parseBase=function(f,d,_){this.words=[0],this.length=1;for(var x=0,b=1;b<=67108863;b*=d)x++;x--,b=b/d|0;for(var p=f.length-_,I=p%x,T=Math.min(p,p-I)+_,S=0,R=_;R<T;R+=x)S=u(f,R,R+x,d),this.imuln(b),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S);if(I!==0){var Y=1;for(S=u(f,R,f.length,d),R=0;R<I;R++)Y*=d;this.imuln(Y),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S)}this._strip()},n.prototype.copy=function(f){f.words=new Array(this.length);for(var d=0;d<this.length;d++)f.words[d]=this.words[d];f.length=this.length,f.negative=this.negative,f.red=this.red};function c(y,f){y.words=f.words,y.length=f.length,y.negative=f.negative,y.red=f.red}if(n.prototype._move=function(f){c(f,this)},n.prototype.clone=function(){var f=new n(null);return this.copy(f),f},n.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch{n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(f,d){f=f||10,d=d|0||1;var _;if(f===16||f==="hex"){_="";for(var x=0,b=0,p=0;p<this.length;p++){var I=this.words[p],T=((I<<x|b)&16777215).toString(16);b=I>>>24-x&16777215,x+=2,x>=26&&(x-=26,p--),b!==0||p!==this.length-1?_=m[6-T.length]+T+_:_=T+_}for(b!==0&&(_=b.toString(16)+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(f===(f|0)&&f>=2&&f<=36){var S=w[f],R=E[f];_="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var X=Y.modrn(R).toString(f);Y=Y.idivn(R),Y.isZero()?_=X+_:_=m[S-X.length]+X+_}for(this.isZero()&&(_="0"+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(f,d){return this.toArrayLike(o,f,d)}),n.prototype.toArray=function(f,d){return this.toArrayLike(Array,f,d)};var P=function(f,d){return f.allocUnsafe?f.allocUnsafe(d):new f(d)};n.prototype.toArrayLike=function(f,d,_){this._strip();var x=this.byteLength(),b=_||Math.max(1,x);r(x<=b,"byte array longer than desired length"),r(b>0,"Requested array length <= 0");var p=P(f,b),I=d==="le"?"LE":"BE";return this["_toArrayLike"+I](p,x),p},n.prototype._toArrayLikeLE=function(f,d){for(var _=0,x=0,b=0,p=0;b<this.length;b++){var I=this.words[b]<<p|x;f[_++]=I&255,_<f.length&&(f[_++]=I>>8&255),_<f.length&&(f[_++]=I>>16&255),p===6?(_<f.length&&(f[_++]=I>>24&255),x=0,p=0):(x=I>>>24,p+=2)}if(_<f.length)for(f[_++]=x;_<f.length;)f[_++]=0},n.prototype._toArrayLikeBE=function(f,d){for(var _=f.length-1,x=0,b=0,p=0;b<this.length;b++){var I=this.words[b]<<p|x;f[_--]=I&255,_>=0&&(f[_--]=I>>8&255),_>=0&&(f[_--]=I>>16&255),p===6?(_>=0&&(f[_--]=I>>24&255),x=0,p=0):(x=I>>>24,p+=2)}if(_>=0)for(f[_--]=x;_>=0;)f[_--]=0},Math.clz32?n.prototype._countBits=function(f){return 32-Math.clz32(f)}:n.prototype._countBits=function(f){var d=f,_=0;return d>=4096&&(_+=13,d>>>=13),d>=64&&(_+=7,d>>>=7),d>=8&&(_+=4,d>>>=4),d>=2&&(_+=2,d>>>=2),_+d},n.prototype._zeroBits=function(f){if(f===0)return 26;var d=f,_=0;return(d&8191)===0&&(_+=13,d>>>=13),(d&127)===0&&(_+=7,d>>>=7),(d&15)===0&&(_+=4,d>>>=4),(d&3)===0&&(_+=2,d>>>=2),(d&1)===0&&_++,_},n.prototype.bitLength=function(){var f=this.words[this.length-1],d=this._countBits(f);return(this.length-1)*26+d};function M(y){for(var f=new Array(y.bitLength()),d=0;d<f.length;d++){var _=d/26|0,x=d%26;f[d]=y.words[_]>>>x&1}return f}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,d=0;d<this.length;d++){var _=this._zeroBits(this.words[d]);if(f+=_,_!==26)break}return f},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},n.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var d=0;d<f.length;d++)this.words[d]=this.words[d]|f.words[d];return this._strip()},n.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},n.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},n.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},n.prototype.iuand=function(f){var d;this.length>f.length?d=f:d=this;for(var _=0;_<d.length;_++)this.words[_]=this.words[_]&f.words[_];return this.length=d.length,this._strip()},n.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},n.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},n.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},n.prototype.iuxor=function(f){var d,_;this.length>f.length?(d=this,_=f):(d=f,_=this);for(var x=0;x<_.length;x++)this.words[x]=d.words[x]^_.words[x];if(this!==d)for(;x<d.length;x++)this.words[x]=d.words[x];return this.length=d.length,this._strip()},n.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},n.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},n.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},n.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var d=Math.ceil(f/26)|0,_=f%26;this._expand(d),_>0&&d--;for(var x=0;x<d;x++)this.words[x]=~this.words[x]&67108863;return _>0&&(this.words[x]=~this.words[x]&67108863>>26-_),this._strip()},n.prototype.notn=function(f){return this.clone().inotn(f)},n.prototype.setn=function(f,d){r(typeof f=="number"&&f>=0);var _=f/26|0,x=f%26;return this._expand(_+1),d?this.words[_]=this.words[_]|1<<x:this.words[_]=this.words[_]&~(1<<x),this._strip()},n.prototype.iadd=function(f){var d;if(this.negative!==0&&f.negative===0)return this.negative=0,d=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,d=this.isub(f),f.negative=1,d._normSign();var _,x;this.length>f.length?(_=this,x=f):(_=f,x=this);for(var b=0,p=0;p<x.length;p++)d=(_.words[p]|0)+(x.words[p]|0)+b,this.words[p]=d&67108863,b=d>>>26;for(;b!==0&&p<_.length;p++)d=(_.words[p]|0)+b,this.words[p]=d&67108863,b=d>>>26;if(this.length=_.length,b!==0)this.words[this.length]=b,this.length++;else if(_!==this)for(;p<_.length;p++)this.words[p]=_.words[p];return this},n.prototype.add=function(f){var d;return f.negative!==0&&this.negative===0?(f.negative=0,d=this.sub(f),f.negative^=1,d):f.negative===0&&this.negative!==0?(this.negative=0,d=f.sub(this),this.negative=1,d):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},n.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var d=this.iadd(f);return f.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var _=this.cmp(f);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,b;_>0?(x=this,b=f):(x=f,b=this);for(var p=0,I=0;I<b.length;I++)d=(x.words[I]|0)-(b.words[I]|0)+p,p=d>>26,this.words[I]=d&67108863;for(;p!==0&&I<x.length;I++)d=(x.words[I]|0)+p,p=d>>26,this.words[I]=d&67108863;if(p===0&&I<x.length&&x!==this)for(;I<x.length;I++)this.words[I]=x.words[I];return this.length=Math.max(this.length,I),x!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(f){return this.clone().isub(f)};function D(y,f,d){d.negative=f.negative^y.negative;var _=y.length+f.length|0;d.length=_,_=_-1|0;var x=y.words[0]|0,b=f.words[0]|0,p=x*b,I=p&67108863,T=p/67108864|0;d.words[0]=I;for(var S=1;S<_;S++){for(var R=T>>>26,Y=T&67108863,X=Math.min(S,f.length-1),ne=Math.max(0,S-y.length+1);ne<=X;ne++){var ce=S-ne|0;x=y.words[ce]|0,b=f.words[ne]|0,p=x*b+Y,R+=p/67108864|0,Y=p&67108863}d.words[S]=Y|0,T=R|0}return T!==0?d.words[S]=T|0:d.length--,d._strip()}var L=function(f,d,_){var x=f.words,b=d.words,p=_.words,I=0,T,S,R,Y=x[0]|0,X=Y&8191,ne=Y>>>13,ce=x[1]|0,pe=ce&8191,q=ce>>>13,W=x[2]|0,$=W&8191,ee=W>>>13,se=x[3]|0,ue=se&8191,le=se>>>13,Ae=x[4]|0,ge=Ae&8191,ve=Ae>>>13,sr=x[5]|0,xe=sr&8191,ye=sr>>>13,Re=x[6]|0,be=Re&8191,_e=Re>>>13,Qi=x[7]|0,Be=Qi&8191,ke=Qi>>>13,$s=x[8]|0,Ce=$s&8191,Le=$s>>>13,$l=x[9]|0,qe=$l&8191,Ue=$l>>>13,Xl=b[0]|0,Fe=Xl&8191,He=Xl>>>13,Jl=b[1]|0,je=Jl&8191,ze=Jl>>>13,Ql=b[2]|0,Ke=Ql&8191,Ve=Ql>>>13,eh=b[3]|0,Ge=eh&8191,Ze=eh>>>13,th=b[4]|0,We=th&8191,Ye=th>>>13,rh=b[5]|0,$e=rh&8191,Xe=rh>>>13,ih=b[6]|0,Je=ih&8191,Qe=ih>>>13,nh=b[7]|0,et=nh&8191,tt=nh>>>13,oh=b[8]|0,rt=oh&8191,it=oh>>>13,Wf=b[9]|0,Jt=Wf&8191,Qt=Wf>>>13;_.negative=f.negative^d.negative,_.length=19,T=Math.imul(X,Fe),S=Math.imul(X,He),S=S+Math.imul(ne,Fe)|0,R=Math.imul(ne,He);var Xs=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,T=Math.imul(pe,Fe),S=Math.imul(pe,He),S=S+Math.imul(q,Fe)|0,R=Math.imul(q,He),T=T+Math.imul(X,je)|0,S=S+Math.imul(X,ze)|0,S=S+Math.imul(ne,je)|0,R=R+Math.imul(ne,ze)|0;var Js=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Js>>>26)|0,Js&=67108863,T=Math.imul($,Fe),S=Math.imul($,He),S=S+Math.imul(ee,Fe)|0,R=Math.imul(ee,He),T=T+Math.imul(pe,je)|0,S=S+Math.imul(pe,ze)|0,S=S+Math.imul(q,je)|0,R=R+Math.imul(q,ze)|0,T=T+Math.imul(X,Ke)|0,S=S+Math.imul(X,Ve)|0,S=S+Math.imul(ne,Ke)|0,R=R+Math.imul(ne,Ve)|0;var Qs=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Qs>>>26)|0,Qs&=67108863,T=Math.imul(ue,Fe),S=Math.imul(ue,He),S=S+Math.imul(le,Fe)|0,R=Math.imul(le,He),T=T+Math.imul($,je)|0,S=S+Math.imul($,ze)|0,S=S+Math.imul(ee,je)|0,R=R+Math.imul(ee,ze)|0,T=T+Math.imul(pe,Ke)|0,S=S+Math.imul(pe,Ve)|0,S=S+Math.imul(q,Ke)|0,R=R+Math.imul(q,Ve)|0,T=T+Math.imul(X,Ge)|0,S=S+Math.imul(X,Ze)|0,S=S+Math.imul(ne,Ge)|0,R=R+Math.imul(ne,Ze)|0;var eu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(eu>>>26)|0,eu&=67108863,T=Math.imul(ge,Fe),S=Math.imul(ge,He),S=S+Math.imul(ve,Fe)|0,R=Math.imul(ve,He),T=T+Math.imul(ue,je)|0,S=S+Math.imul(ue,ze)|0,S=S+Math.imul(le,je)|0,R=R+Math.imul(le,ze)|0,T=T+Math.imul($,Ke)|0,S=S+Math.imul($,Ve)|0,S=S+Math.imul(ee,Ke)|0,R=R+Math.imul(ee,Ve)|0,T=T+Math.imul(pe,Ge)|0,S=S+Math.imul(pe,Ze)|0,S=S+Math.imul(q,Ge)|0,R=R+Math.imul(q,Ze)|0,T=T+Math.imul(X,We)|0,S=S+Math.imul(X,Ye)|0,S=S+Math.imul(ne,We)|0,R=R+Math.imul(ne,Ye)|0;var tu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(tu>>>26)|0,tu&=67108863,T=Math.imul(xe,Fe),S=Math.imul(xe,He),S=S+Math.imul(ye,Fe)|0,R=Math.imul(ye,He),T=T+Math.imul(ge,je)|0,S=S+Math.imul(ge,ze)|0,S=S+Math.imul(ve,je)|0,R=R+Math.imul(ve,ze)|0,T=T+Math.imul(ue,Ke)|0,S=S+Math.imul(ue,Ve)|0,S=S+Math.imul(le,Ke)|0,R=R+Math.imul(le,Ve)|0,T=T+Math.imul($,Ge)|0,S=S+Math.imul($,Ze)|0,S=S+Math.imul(ee,Ge)|0,R=R+Math.imul(ee,Ze)|0,T=T+Math.imul(pe,We)|0,S=S+Math.imul(pe,Ye)|0,S=S+Math.imul(q,We)|0,R=R+Math.imul(q,Ye)|0,T=T+Math.imul(X,$e)|0,S=S+Math.imul(X,Xe)|0,S=S+Math.imul(ne,$e)|0,R=R+Math.imul(ne,Xe)|0;var ru=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(ru>>>26)|0,ru&=67108863,T=Math.imul(be,Fe),S=Math.imul(be,He),S=S+Math.imul(_e,Fe)|0,R=Math.imul(_e,He),T=T+Math.imul(xe,je)|0,S=S+Math.imul(xe,ze)|0,S=S+Math.imul(ye,je)|0,R=R+Math.imul(ye,ze)|0,T=T+Math.imul(ge,Ke)|0,S=S+Math.imul(ge,Ve)|0,S=S+Math.imul(ve,Ke)|0,R=R+Math.imul(ve,Ve)|0,T=T+Math.imul(ue,Ge)|0,S=S+Math.imul(ue,Ze)|0,S=S+Math.imul(le,Ge)|0,R=R+Math.imul(le,Ze)|0,T=T+Math.imul($,We)|0,S=S+Math.imul($,Ye)|0,S=S+Math.imul(ee,We)|0,R=R+Math.imul(ee,Ye)|0,T=T+Math.imul(pe,$e)|0,S=S+Math.imul(pe,Xe)|0,S=S+Math.imul(q,$e)|0,R=R+Math.imul(q,Xe)|0,T=T+Math.imul(X,Je)|0,S=S+Math.imul(X,Qe)|0,S=S+Math.imul(ne,Je)|0,R=R+Math.imul(ne,Qe)|0;var iu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(iu>>>26)|0,iu&=67108863,T=Math.imul(Be,Fe),S=Math.imul(Be,He),S=S+Math.imul(ke,Fe)|0,R=Math.imul(ke,He),T=T+Math.imul(be,je)|0,S=S+Math.imul(be,ze)|0,S=S+Math.imul(_e,je)|0,R=R+Math.imul(_e,ze)|0,T=T+Math.imul(xe,Ke)|0,S=S+Math.imul(xe,Ve)|0,S=S+Math.imul(ye,Ke)|0,R=R+Math.imul(ye,Ve)|0,T=T+Math.imul(ge,Ge)|0,S=S+Math.imul(ge,Ze)|0,S=S+Math.imul(ve,Ge)|0,R=R+Math.imul(ve,Ze)|0,T=T+Math.imul(ue,We)|0,S=S+Math.imul(ue,Ye)|0,S=S+Math.imul(le,We)|0,R=R+Math.imul(le,Ye)|0,T=T+Math.imul($,$e)|0,S=S+Math.imul($,Xe)|0,S=S+Math.imul(ee,$e)|0,R=R+Math.imul(ee,Xe)|0,T=T+Math.imul(pe,Je)|0,S=S+Math.imul(pe,Qe)|0,S=S+Math.imul(q,Je)|0,R=R+Math.imul(q,Qe)|0,T=T+Math.imul(X,et)|0,S=S+Math.imul(X,tt)|0,S=S+Math.imul(ne,et)|0,R=R+Math.imul(ne,tt)|0;var nu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(nu>>>26)|0,nu&=67108863,T=Math.imul(Ce,Fe),S=Math.imul(Ce,He),S=S+Math.imul(Le,Fe)|0,R=Math.imul(Le,He),T=T+Math.imul(Be,je)|0,S=S+Math.imul(Be,ze)|0,S=S+Math.imul(ke,je)|0,R=R+Math.imul(ke,ze)|0,T=T+Math.imul(be,Ke)|0,S=S+Math.imul(be,Ve)|0,S=S+Math.imul(_e,Ke)|0,R=R+Math.imul(_e,Ve)|0,T=T+Math.imul(xe,Ge)|0,S=S+Math.imul(xe,Ze)|0,S=S+Math.imul(ye,Ge)|0,R=R+Math.imul(ye,Ze)|0,T=T+Math.imul(ge,We)|0,S=S+Math.imul(ge,Ye)|0,S=S+Math.imul(ve,We)|0,R=R+Math.imul(ve,Ye)|0,T=T+Math.imul(ue,$e)|0,S=S+Math.imul(ue,Xe)|0,S=S+Math.imul(le,$e)|0,R=R+Math.imul(le,Xe)|0,T=T+Math.imul($,Je)|0,S=S+Math.imul($,Qe)|0,S=S+Math.imul(ee,Je)|0,R=R+Math.imul(ee,Qe)|0,T=T+Math.imul(pe,et)|0,S=S+Math.imul(pe,tt)|0,S=S+Math.imul(q,et)|0,R=R+Math.imul(q,tt)|0,T=T+Math.imul(X,rt)|0,S=S+Math.imul(X,it)|0,S=S+Math.imul(ne,rt)|0,R=R+Math.imul(ne,it)|0;var ou=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(ou>>>26)|0,ou&=67108863,T=Math.imul(qe,Fe),S=Math.imul(qe,He),S=S+Math.imul(Ue,Fe)|0,R=Math.imul(Ue,He),T=T+Math.imul(Ce,je)|0,S=S+Math.imul(Ce,ze)|0,S=S+Math.imul(Le,je)|0,R=R+Math.imul(Le,ze)|0,T=T+Math.imul(Be,Ke)|0,S=S+Math.imul(Be,Ve)|0,S=S+Math.imul(ke,Ke)|0,R=R+Math.imul(ke,Ve)|0,T=T+Math.imul(be,Ge)|0,S=S+Math.imul(be,Ze)|0,S=S+Math.imul(_e,Ge)|0,R=R+Math.imul(_e,Ze)|0,T=T+Math.imul(xe,We)|0,S=S+Math.imul(xe,Ye)|0,S=S+Math.imul(ye,We)|0,R=R+Math.imul(ye,Ye)|0,T=T+Math.imul(ge,$e)|0,S=S+Math.imul(ge,Xe)|0,S=S+Math.imul(ve,$e)|0,R=R+Math.imul(ve,Xe)|0,T=T+Math.imul(ue,Je)|0,S=S+Math.imul(ue,Qe)|0,S=S+Math.imul(le,Je)|0,R=R+Math.imul(le,Qe)|0,T=T+Math.imul($,et)|0,S=S+Math.imul($,tt)|0,S=S+Math.imul(ee,et)|0,R=R+Math.imul(ee,tt)|0,T=T+Math.imul(pe,rt)|0,S=S+Math.imul(pe,it)|0,S=S+Math.imul(q,rt)|0,R=R+Math.imul(q,it)|0,T=T+Math.imul(X,Jt)|0,S=S+Math.imul(X,Qt)|0,S=S+Math.imul(ne,Jt)|0,R=R+Math.imul(ne,Qt)|0;var au=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(au>>>26)|0,au&=67108863,T=Math.imul(qe,je),S=Math.imul(qe,ze),S=S+Math.imul(Ue,je)|0,R=Math.imul(Ue,ze),T=T+Math.imul(Ce,Ke)|0,S=S+Math.imul(Ce,Ve)|0,S=S+Math.imul(Le,Ke)|0,R=R+Math.imul(Le,Ve)|0,T=T+Math.imul(Be,Ge)|0,S=S+Math.imul(Be,Ze)|0,S=S+Math.imul(ke,Ge)|0,R=R+Math.imul(ke,Ze)|0,T=T+Math.imul(be,We)|0,S=S+Math.imul(be,Ye)|0,S=S+Math.imul(_e,We)|0,R=R+Math.imul(_e,Ye)|0,T=T+Math.imul(xe,$e)|0,S=S+Math.imul(xe,Xe)|0,S=S+Math.imul(ye,$e)|0,R=R+Math.imul(ye,Xe)|0,T=T+Math.imul(ge,Je)|0,S=S+Math.imul(ge,Qe)|0,S=S+Math.imul(ve,Je)|0,R=R+Math.imul(ve,Qe)|0,T=T+Math.imul(ue,et)|0,S=S+Math.imul(ue,tt)|0,S=S+Math.imul(le,et)|0,R=R+Math.imul(le,tt)|0,T=T+Math.imul($,rt)|0,S=S+Math.imul($,it)|0,S=S+Math.imul(ee,rt)|0,R=R+Math.imul(ee,it)|0,T=T+Math.imul(pe,Jt)|0,S=S+Math.imul(pe,Qt)|0,S=S+Math.imul(q,Jt)|0,R=R+Math.imul(q,Qt)|0;var su=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(su>>>26)|0,su&=67108863,T=Math.imul(qe,Ke),S=Math.imul(qe,Ve),S=S+Math.imul(Ue,Ke)|0,R=Math.imul(Ue,Ve),T=T+Math.imul(Ce,Ge)|0,S=S+Math.imul(Ce,Ze)|0,S=S+Math.imul(Le,Ge)|0,R=R+Math.imul(Le,Ze)|0,T=T+Math.imul(Be,We)|0,S=S+Math.imul(Be,Ye)|0,S=S+Math.imul(ke,We)|0,R=R+Math.imul(ke,Ye)|0,T=T+Math.imul(be,$e)|0,S=S+Math.imul(be,Xe)|0,S=S+Math.imul(_e,$e)|0,R=R+Math.imul(_e,Xe)|0,T=T+Math.imul(xe,Je)|0,S=S+Math.imul(xe,Qe)|0,S=S+Math.imul(ye,Je)|0,R=R+Math.imul(ye,Qe)|0,T=T+Math.imul(ge,et)|0,S=S+Math.imul(ge,tt)|0,S=S+Math.imul(ve,et)|0,R=R+Math.imul(ve,tt)|0,T=T+Math.imul(ue,rt)|0,S=S+Math.imul(ue,it)|0,S=S+Math.imul(le,rt)|0,R=R+Math.imul(le,it)|0,T=T+Math.imul($,Jt)|0,S=S+Math.imul($,Qt)|0,S=S+Math.imul(ee,Jt)|0,R=R+Math.imul(ee,Qt)|0;var uu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(uu>>>26)|0,uu&=67108863,T=Math.imul(qe,Ge),S=Math.imul(qe,Ze),S=S+Math.imul(Ue,Ge)|0,R=Math.imul(Ue,Ze),T=T+Math.imul(Ce,We)|0,S=S+Math.imul(Ce,Ye)|0,S=S+Math.imul(Le,We)|0,R=R+Math.imul(Le,Ye)|0,T=T+Math.imul(Be,$e)|0,S=S+Math.imul(Be,Xe)|0,S=S+Math.imul(ke,$e)|0,R=R+Math.imul(ke,Xe)|0,T=T+Math.imul(be,Je)|0,S=S+Math.imul(be,Qe)|0,S=S+Math.imul(_e,Je)|0,R=R+Math.imul(_e,Qe)|0,T=T+Math.imul(xe,et)|0,S=S+Math.imul(xe,tt)|0,S=S+Math.imul(ye,et)|0,R=R+Math.imul(ye,tt)|0,T=T+Math.imul(ge,rt)|0,S=S+Math.imul(ge,it)|0,S=S+Math.imul(ve,rt)|0,R=R+Math.imul(ve,it)|0,T=T+Math.imul(ue,Jt)|0,S=S+Math.imul(ue,Qt)|0,S=S+Math.imul(le,Jt)|0,R=R+Math.imul(le,Qt)|0;var fu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(fu>>>26)|0,fu&=67108863,T=Math.imul(qe,We),S=Math.imul(qe,Ye),S=S+Math.imul(Ue,We)|0,R=Math.imul(Ue,Ye),T=T+Math.imul(Ce,$e)|0,S=S+Math.imul(Ce,Xe)|0,S=S+Math.imul(Le,$e)|0,R=R+Math.imul(Le,Xe)|0,T=T+Math.imul(Be,Je)|0,S=S+Math.imul(Be,Qe)|0,S=S+Math.imul(ke,Je)|0,R=R+Math.imul(ke,Qe)|0,T=T+Math.imul(be,et)|0,S=S+Math.imul(be,tt)|0,S=S+Math.imul(_e,et)|0,R=R+Math.imul(_e,tt)|0,T=T+Math.imul(xe,rt)|0,S=S+Math.imul(xe,it)|0,S=S+Math.imul(ye,rt)|0,R=R+Math.imul(ye,it)|0,T=T+Math.imul(ge,Jt)|0,S=S+Math.imul(ge,Qt)|0,S=S+Math.imul(ve,Jt)|0,R=R+Math.imul(ve,Qt)|0;var cu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(cu>>>26)|0,cu&=67108863,T=Math.imul(qe,$e),S=Math.imul(qe,Xe),S=S+Math.imul(Ue,$e)|0,R=Math.imul(Ue,Xe),T=T+Math.imul(Ce,Je)|0,S=S+Math.imul(Ce,Qe)|0,S=S+Math.imul(Le,Je)|0,R=R+Math.imul(Le,Qe)|0,T=T+Math.imul(Be,et)|0,S=S+Math.imul(Be,tt)|0,S=S+Math.imul(ke,et)|0,R=R+Math.imul(ke,tt)|0,T=T+Math.imul(be,rt)|0,S=S+Math.imul(be,it)|0,S=S+Math.imul(_e,rt)|0,R=R+Math.imul(_e,it)|0,T=T+Math.imul(xe,Jt)|0,S=S+Math.imul(xe,Qt)|0,S=S+Math.imul(ye,Jt)|0,R=R+Math.imul(ye,Qt)|0;var lu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(lu>>>26)|0,lu&=67108863,T=Math.imul(qe,Je),S=Math.imul(qe,Qe),S=S+Math.imul(Ue,Je)|0,R=Math.imul(Ue,Qe),T=T+Math.imul(Ce,et)|0,S=S+Math.imul(Ce,tt)|0,S=S+Math.imul(Le,et)|0,R=R+Math.imul(Le,tt)|0,T=T+Math.imul(Be,rt)|0,S=S+Math.imul(Be,it)|0,S=S+Math.imul(ke,rt)|0,R=R+Math.imul(ke,it)|0,T=T+Math.imul(be,Jt)|0,S=S+Math.imul(be,Qt)|0,S=S+Math.imul(_e,Jt)|0,R=R+Math.imul(_e,Qt)|0;var hu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(hu>>>26)|0,hu&=67108863,T=Math.imul(qe,et),S=Math.imul(qe,tt),S=S+Math.imul(Ue,et)|0,R=Math.imul(Ue,tt),T=T+Math.imul(Ce,rt)|0,S=S+Math.imul(Ce,it)|0,S=S+Math.imul(Le,rt)|0,R=R+Math.imul(Le,it)|0,T=T+Math.imul(Be,Jt)|0,S=S+Math.imul(Be,Qt)|0,S=S+Math.imul(ke,Jt)|0,R=R+Math.imul(ke,Qt)|0;var M5=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(M5>>>26)|0,M5&=67108863,T=Math.imul(qe,rt),S=Math.imul(qe,it),S=S+Math.imul(Ue,rt)|0,R=Math.imul(Ue,it),T=T+Math.imul(Ce,Jt)|0,S=S+Math.imul(Ce,Qt)|0,S=S+Math.imul(Le,Jt)|0,R=R+Math.imul(Le,Qt)|0;var N5=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(N5>>>26)|0,N5&=67108863,T=Math.imul(qe,Jt),S=Math.imul(qe,Qt),S=S+Math.imul(Ue,Jt)|0,R=Math.imul(Ue,Qt);var C5=(I+T|0)+((S&8191)<<13)|0;return I=(R+(S>>>13)|0)+(C5>>>26)|0,C5&=67108863,p[0]=Xs,p[1]=Js,p[2]=Qs,p[3]=eu,p[4]=tu,p[5]=ru,p[6]=iu,p[7]=nu,p[8]=ou,p[9]=au,p[10]=su,p[11]=uu,p[12]=fu,p[13]=cu,p[14]=lu,p[15]=hu,p[16]=M5,p[17]=N5,p[18]=C5,I!==0&&(p[19]=I,_.length++),_};Math.imul||(L=D);function U(y,f,d){d.negative=f.negative^y.negative,d.length=y.length+f.length;for(var _=0,x=0,b=0;b<d.length-1;b++){var p=x;x=0;for(var I=_&67108863,T=Math.min(b,f.length-1),S=Math.max(0,b-y.length+1);S<=T;S++){var R=b-S,Y=y.words[R]|0,X=f.words[S]|0,ne=Y*X,ce=ne&67108863;p=p+(ne/67108864|0)|0,ce=ce+I|0,I=ce&67108863,p=p+(ce>>>26)|0,x+=p>>>26,p&=67108863}d.words[b]=I,_=p,p=x}return _!==0?d.words[b]=_:d.length--,d._strip()}function K(y,f,d){return U(y,f,d)}n.prototype.mulTo=function(f,d){var _,x=this.length+f.length;return this.length===10&&f.length===10?_=L(this,f,d):x<63?_=D(this,f,d):x<1024?_=U(this,f,d):_=K(this,f,d),_};function N(y,f){this.x=y,this.y=f}N.prototype.makeRBT=function(f){for(var d=new Array(f),_=n.prototype._countBits(f)-1,x=0;x<f;x++)d[x]=this.revBin(x,_,f);return d},N.prototype.revBin=function(f,d,_){if(f===0||f===_-1)return f;for(var x=0,b=0;b<d;b++)x|=(f&1)<<d-b-1,f>>=1;return x},N.prototype.permute=function(f,d,_,x,b,p){for(var I=0;I<p;I++)x[I]=d[f[I]],b[I]=_[f[I]]},N.prototype.transform=function(f,d,_,x,b,p){this.permute(p,f,d,_,x,b);for(var I=1;I<b;I<<=1)for(var T=I<<1,S=Math.cos(2*Math.PI/T),R=Math.sin(2*Math.PI/T),Y=0;Y<b;Y+=T)for(var X=S,ne=R,ce=0;ce<I;ce++){var pe=_[Y+ce],q=x[Y+ce],W=_[Y+ce+I],$=x[Y+ce+I],ee=X*W-ne*$;$=X*$+ne*W,W=ee,_[Y+ce]=pe+W,x[Y+ce]=q+$,_[Y+ce+I]=pe-W,x[Y+ce+I]=q-$,ce!==T&&(ee=S*X-R*ne,ne=S*ne+R*X,X=ee)}},N.prototype.guessLen13b=function(f,d){var _=Math.max(d,f)|1,x=_&1,b=0;for(_=_/2|0;_;_=_>>>1)b++;return 1<<b+1+x},N.prototype.conjugate=function(f,d,_){if(!(_<=1))for(var x=0;x<_/2;x++){var b=f[x];f[x]=f[_-x-1],f[_-x-1]=b,b=d[x],d[x]=-d[_-x-1],d[_-x-1]=-b}},N.prototype.normalize13b=function(f,d){for(var _=0,x=0;x<d/2;x++){var b=Math.round(f[2*x+1]/d)*8192+Math.round(f[2*x]/d)+_;f[x]=b&67108863,b<67108864?_=0:_=b/67108864|0}return f},N.prototype.convert13b=function(f,d,_,x){for(var b=0,p=0;p<d;p++)b=b+(f[p]|0),_[2*p]=b&8191,b=b>>>13,_[2*p+1]=b&8191,b=b>>>13;for(p=2*d;p<x;++p)_[p]=0;r(b===0),r((b&-8192)===0)},N.prototype.stub=function(f){for(var d=new Array(f),_=0;_<f;_++)d[_]=0;return d},N.prototype.mulp=function(f,d,_){var x=2*this.guessLen13b(f.length,d.length),b=this.makeRBT(x),p=this.stub(x),I=new Array(x),T=new Array(x),S=new Array(x),R=new Array(x),Y=new Array(x),X=new Array(x),ne=_.words;ne.length=x,this.convert13b(f.words,f.length,I,x),this.convert13b(d.words,d.length,R,x),this.transform(I,p,T,S,x,b),this.transform(R,p,Y,X,x,b);for(var ce=0;ce<x;ce++){var pe=T[ce]*Y[ce]-S[ce]*X[ce];S[ce]=T[ce]*X[ce]+S[ce]*Y[ce],T[ce]=pe}return this.conjugate(T,S,x),this.transform(T,S,ne,p,x,b),this.conjugate(ne,p,x),this.normalize13b(ne,x),_.negative=f.negative^d.negative,_.length=f.length+d.length,_._strip()},n.prototype.mul=function(f){var d=new n(null);return d.words=new Array(this.length+f.length),this.mulTo(f,d)},n.prototype.mulf=function(f){var d=new n(null);return d.words=new Array(this.length+f.length),K(this,f,d)},n.prototype.imul=function(f){return this.clone().mulTo(f,this)},n.prototype.imuln=function(f){var d=f<0;d&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var _=0,x=0;x<this.length;x++){var b=(this.words[x]|0)*f,p=(b&67108863)+(_&67108863);_>>=26,_+=b/67108864|0,_+=p>>>26,this.words[x]=p&67108863}return _!==0&&(this.words[x]=_,this.length++),this.length=f===0?1:this.length,d?this.ineg():this},n.prototype.muln=function(f){return this.clone().imuln(f)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(f){var d=M(f);if(d.length===0)return new n(1);for(var _=this,x=0;x<d.length&&d[x]===0;x++,_=_.sqr());if(++x<d.length)for(var b=_.sqr();x<d.length;x++,b=b.sqr())d[x]!==0&&(_=_.mul(b));return _},n.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26,x=67108863>>>26-d<<26-d,b;if(d!==0){var p=0;for(b=0;b<this.length;b++){var I=this.words[b]&x,T=(this.words[b]|0)-I<<d;this.words[b]=T|p,p=I>>>26-d}p&&(this.words[b]=p,this.length++)}if(_!==0){for(b=this.length-1;b>=0;b--)this.words[b+_]=this.words[b];for(b=0;b<_;b++)this.words[b]=0;this.length+=_}return this._strip()},n.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},n.prototype.iushrn=function(f,d,_){r(typeof f=="number"&&f>=0);var x;d?x=(d-d%26)/26:x=0;var b=f%26,p=Math.min((f-b)/26,this.length),I=67108863^67108863>>>b<<b,T=_;if(x-=p,x=Math.max(0,x),T){for(var S=0;S<p;S++)T.words[S]=this.words[S];T.length=p}if(p!==0)if(this.length>p)for(this.length-=p,S=0;S<this.length;S++)this.words[S]=this.words[S+p];else this.words[0]=0,this.length=1;var R=0;for(S=this.length-1;S>=0&&(R!==0||S>=x);S--){var Y=this.words[S]|0;this.words[S]=R<<26-b|Y>>>b,R=Y&I}return T&&R!==0&&(T.words[T.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(f,d,_){return r(this.negative===0),this.iushrn(f,d,_)},n.prototype.shln=function(f){return this.clone().ishln(f)},n.prototype.ushln=function(f){return this.clone().iushln(f)},n.prototype.shrn=function(f){return this.clone().ishrn(f)},n.prototype.ushrn=function(f){return this.clone().iushrn(f)},n.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26,x=1<<d;if(this.length<=_)return!1;var b=this.words[_];return!!(b&x)},n.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(d!==0&&_++,this.length=Math.min(_,this.length),d!==0){var x=67108863^67108863>>>d<<d;this.words[this.length-1]&=x}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.maskn=function(f){return this.clone().imaskn(f)},n.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},n.prototype._iaddn=function(f){this.words[0]+=f;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},n.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},n.prototype.addn=function(f){return this.clone().iaddn(f)},n.prototype.subn=function(f){return this.clone().isubn(f)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(f,d,_){var x=f.length+_,b;this._expand(x);var p,I=0;for(b=0;b<f.length;b++){p=(this.words[b+_]|0)+I;var T=(f.words[b]|0)*d;p-=T&67108863,I=(p>>26)-(T/67108864|0),this.words[b+_]=p&67108863}for(;b<this.length-_;b++)p=(this.words[b+_]|0)+I,I=p>>26,this.words[b+_]=p&67108863;if(I===0)return this._strip();for(r(I===-1),I=0,b=0;b<this.length;b++)p=-(this.words[b]|0)+I,I=p>>26,this.words[b]=p&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(f,d){var _=this.length-f.length,x=this.clone(),b=f,p=b.words[b.length-1]|0,I=this._countBits(p);_=26-I,_!==0&&(b=b.ushln(_),x.iushln(_),p=b.words[b.length-1]|0);var T=x.length-b.length,S;if(d!=="mod"){S=new n(null),S.length=T+1,S.words=new Array(S.length);for(var R=0;R<S.length;R++)S.words[R]=0}var Y=x.clone()._ishlnsubmul(b,1,T);Y.negative===0&&(x=Y,S&&(S.words[T]=1));for(var X=T-1;X>=0;X--){var ne=(x.words[b.length+X]|0)*67108864+(x.words[b.length+X-1]|0);for(ne=Math.min(ne/p|0,67108863),x._ishlnsubmul(b,ne,X);x.negative!==0;)ne--,x.negative=0,x._ishlnsubmul(b,1,X),x.isZero()||(x.negative^=1);S&&(S.words[X]=ne)}return S&&S._strip(),x._strip(),d!=="div"&&_!==0&&x.iushrn(_),{div:S||null,mod:x}},n.prototype.divmod=function(f,d,_){if(r(!f.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var x,b,p;return this.negative!==0&&f.negative===0?(p=this.neg().divmod(f,d),d!=="mod"&&(x=p.div.neg()),d!=="div"&&(b=p.mod.neg(),_&&b.negative!==0&&b.iadd(f)),{div:x,mod:b}):this.negative===0&&f.negative!==0?(p=this.divmod(f.neg(),d),d!=="mod"&&(x=p.div.neg()),{div:x,mod:p.mod}):(this.negative&f.negative)!==0?(p=this.neg().divmod(f.neg(),d),d!=="div"&&(b=p.mod.neg(),_&&b.negative!==0&&b.isub(f)),{div:p.div,mod:b}):f.length>this.length||this.cmp(f)<0?{div:new n(0),mod:this}:f.length===1?d==="div"?{div:this.divn(f.words[0]),mod:null}:d==="mod"?{div:null,mod:new n(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new n(this.modrn(f.words[0]))}:this._wordDiv(f,d)},n.prototype.div=function(f){return this.divmod(f,"div",!1).div},n.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},n.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},n.prototype.divRound=function(f){var d=this.divmod(f);if(d.mod.isZero())return d.div;var _=d.div.negative!==0?d.mod.isub(f):d.mod,x=f.ushrn(1),b=f.andln(1),p=_.cmp(x);return p<0||b===1&&p===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},n.prototype.modrn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var _=(1<<26)%f,x=0,b=this.length-1;b>=0;b--)x=(_*x+(this.words[b]|0))%f;return d?-x:x},n.prototype.modn=function(f){return this.modrn(f)},n.prototype.idivn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var _=0,x=this.length-1;x>=0;x--){var b=(this.words[x]|0)+_*67108864;this.words[x]=b/f|0,_=b%f}return this._strip(),d?this.ineg():this},n.prototype.divn=function(f){return this.clone().idivn(f)},n.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var d=this,_=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var x=new n(1),b=new n(0),p=new n(0),I=new n(1),T=0;d.isEven()&&_.isEven();)d.iushrn(1),_.iushrn(1),++T;for(var S=_.clone(),R=d.clone();!d.isZero();){for(var Y=0,X=1;(d.words[0]&X)===0&&Y<26;++Y,X<<=1);if(Y>0)for(d.iushrn(Y);Y-- >0;)(x.isOdd()||b.isOdd())&&(x.iadd(S),b.isub(R)),x.iushrn(1),b.iushrn(1);for(var ne=0,ce=1;(_.words[0]&ce)===0&&ne<26;++ne,ce<<=1);if(ne>0)for(_.iushrn(ne);ne-- >0;)(p.isOdd()||I.isOdd())&&(p.iadd(S),I.isub(R)),p.iushrn(1),I.iushrn(1);d.cmp(_)>=0?(d.isub(_),x.isub(p),b.isub(I)):(_.isub(d),p.isub(x),I.isub(b))}return{a:p,b:I,gcd:_.iushln(T)}},n.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var d=this,_=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var x=new n(1),b=new n(0),p=_.clone();d.cmpn(1)>0&&_.cmpn(1)>0;){for(var I=0,T=1;(d.words[0]&T)===0&&I<26;++I,T<<=1);if(I>0)for(d.iushrn(I);I-- >0;)x.isOdd()&&x.iadd(p),x.iushrn(1);for(var S=0,R=1;(_.words[0]&R)===0&&S<26;++S,R<<=1);if(S>0)for(_.iushrn(S);S-- >0;)b.isOdd()&&b.iadd(p),b.iushrn(1);d.cmp(_)>=0?(d.isub(_),x.isub(b)):(_.isub(d),b.isub(x))}var Y;return d.cmpn(1)===0?Y=x:Y=b,Y.cmpn(0)<0&&Y.iadd(f),Y},n.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var d=this.clone(),_=f.clone();d.negative=0,_.negative=0;for(var x=0;d.isEven()&&_.isEven();x++)d.iushrn(1),_.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;_.isEven();)_.iushrn(1);var b=d.cmp(_);if(b<0){var p=d;d=_,_=p}else if(b===0||_.cmpn(1)===0)break;d.isub(_)}while(!0);return _.iushln(x)},n.prototype.invm=function(f){return this.egcd(f).a.umod(f)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(f){return this.words[0]&f},n.prototype.bincn=function(f){r(typeof f=="number");var d=f%26,_=(f-d)/26,x=1<<d;if(this.length<=_)return this._expand(_+1),this.words[_]|=x,this;for(var b=x,p=_;b!==0&&p<this.length;p++){var I=this.words[p]|0;I+=b,b=I>>>26,I&=67108863,this.words[p]=I}return b!==0&&(this.words[p]=b,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(f){var d=f<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var _;if(this.length>1)_=1;else{d&&(f=-f),r(f<=67108863,"Number is too big");var x=this.words[0]|0;_=x===f?0:x<f?-1:1}return this.negative!==0?-_|0:_},n.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var d=this.ucmp(f);return this.negative!==0?-d|0:d},n.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var d=0,_=this.length-1;_>=0;_--){var x=this.words[_]|0,b=f.words[_]|0;if(x!==b){x<b?d=-1:x>b&&(d=1);break}}return d},n.prototype.gtn=function(f){return this.cmpn(f)===1},n.prototype.gt=function(f){return this.cmp(f)===1},n.prototype.gten=function(f){return this.cmpn(f)>=0},n.prototype.gte=function(f){return this.cmp(f)>=0},n.prototype.ltn=function(f){return this.cmpn(f)===-1},n.prototype.lt=function(f){return this.cmp(f)===-1},n.prototype.lten=function(f){return this.cmpn(f)<=0},n.prototype.lte=function(f){return this.cmp(f)<=0},n.prototype.eqn=function(f){return this.cmpn(f)===0},n.prototype.eq=function(f){return this.cmp(f)===0},n.red=function(f){return new g(f)},n.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(f){return this.red=f,this},n.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},n.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},n.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},n.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},n.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},n.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},n.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},n.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var C={k256:null,p224:null,p192:null,p25519:null};function F(y,f){this.name=y,this.p=new n(f,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var f=new n(null);return f.words=new Array(Math.ceil(this.n/13)),f},F.prototype.ireduce=function(f){var d=f,_;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),_=d.bitLength();while(_>this.n);var x=_<this.n?-1:d.ucmp(this.p);return x===0?(d.words[0]=0,d.length=1):x>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},F.prototype.split=function(f,d){f.iushrn(this.n,0,d)},F.prototype.imulK=function(f){return f.imul(this.k)};function H(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(H,F),H.prototype.split=function(f,d){for(var _=4194303,x=Math.min(f.length,9),b=0;b<x;b++)d.words[b]=f.words[b];if(d.length=x,f.length<=9){f.words[0]=0,f.length=1;return}var p=f.words[9];for(d.words[d.length++]=p&_,b=10;b<f.length;b++){var I=f.words[b]|0;f.words[b-10]=(I&_)<<4|p>>>22,p=I}p>>>=22,f.words[b-10]=p,p===0&&f.length>10?f.length-=10:f.length-=9},H.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var d=0,_=0;_<f.length;_++){var x=f.words[_]|0;d+=x*977,f.words[_]=d&67108863,d=x*64+(d/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function z(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(z,F);function G(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(G,F);function B(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(B,F),B.prototype.imulK=function(f){for(var d=0,_=0;_<f.length;_++){var x=(f.words[_]|0)*19+d,b=x&67108863;x>>>=26,f.words[_]=b,d=x}return d!==0&&(f.words[f.length++]=d),f},n._prime=function(f){if(C[f])return C[f];var d;if(f==="k256")d=new H;else if(f==="p224")d=new z;else if(f==="p192")d=new G;else if(f==="p25519")d=new B;else throw new Error("Unknown prime "+f);return C[f]=d,d};function g(y){if(typeof y=="string"){var f=n._prime(y);this.m=f.p,this.prime=f}else r(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}g.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},g.prototype._verify2=function(f,d){r((f.negative|d.negative)===0,"red works only with positives"),r(f.red&&f.red===d.red,"red works only with red numbers")},g.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},g.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},g.prototype.add=function(f,d){this._verify2(f,d);var _=f.add(d);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},g.prototype.iadd=function(f,d){this._verify2(f,d);var _=f.iadd(d);return _.cmp(this.m)>=0&&_.isub(this.m),_},g.prototype.sub=function(f,d){this._verify2(f,d);var _=f.sub(d);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},g.prototype.isub=function(f,d){this._verify2(f,d);var _=f.isub(d);return _.cmpn(0)<0&&_.iadd(this.m),_},g.prototype.shl=function(f,d){return this._verify1(f),this.imod(f.ushln(d))},g.prototype.imul=function(f,d){return this._verify2(f,d),this.imod(f.imul(d))},g.prototype.mul=function(f,d){return this._verify2(f,d),this.imod(f.mul(d))},g.prototype.isqr=function(f){return this.imul(f,f.clone())},g.prototype.sqr=function(f){return this.mul(f,f)},g.prototype.sqrt=function(f){if(f.isZero())return f.clone();var d=this.m.andln(3);if(r(d%2===1),d===3){var _=this.m.add(new n(1)).iushrn(2);return this.pow(f,_)}for(var x=this.m.subn(1),b=0;!x.isZero()&&x.andln(1)===0;)b++,x.iushrn(1);r(!x.isZero());var p=new n(1).toRed(this),I=p.redNeg(),T=this.m.subn(1).iushrn(1),S=this.m.bitLength();for(S=new n(2*S*S).toRed(this);this.pow(S,T).cmp(I)!==0;)S.redIAdd(I);for(var R=this.pow(S,x),Y=this.pow(f,x.addn(1).iushrn(1)),X=this.pow(f,x),ne=b;X.cmp(p)!==0;){for(var ce=X,pe=0;ce.cmp(p)!==0;pe++)ce=ce.redSqr();r(pe<ne);var q=this.pow(R,new n(1).iushln(ne-pe-1));Y=Y.redMul(q),R=q.redSqr(),X=X.redMul(R),ne=pe}return Y},g.prototype.invm=function(f){var d=f._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},g.prototype.pow=function(f,d){if(d.isZero())return new n(1).toRed(this);if(d.cmpn(1)===0)return f.clone();var _=4,x=new Array(1<<_);x[0]=new n(1).toRed(this),x[1]=f;for(var b=2;b<x.length;b++)x[b]=this.mul(x[b-1],f);var p=x[0],I=0,T=0,S=d.bitLength()%26;for(S===0&&(S=26),b=d.length-1;b>=0;b--){for(var R=d.words[b],Y=S-1;Y>=0;Y--){var X=R>>Y&1;if(p!==x[0]&&(p=this.sqr(p)),X===0&&I===0){T=0;continue}I<<=1,I|=X,T++,!(T!==_&&(b!==0||Y!==0))&&(p=this.mul(p,x[I]),T=0,I=0)}S=26}return p},g.prototype.convertTo=function(f){var d=f.umod(this.m);return d===f?d.clone():d},g.prototype.convertFrom=function(f){var d=f.clone();return d.red=null,d},n.mont=function(f){return new O(f)};function O(y){g.call(this,y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(O,g),O.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},O.prototype.convertFrom=function(f){var d=this.imod(f.mul(this.rinv));return d.red=null,d},O.prototype.imul=function(f,d){if(f.isZero()||d.isZero())return f.words[0]=0,f.length=1,f;var _=f.imul(d),x=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=_.isub(x).iushrn(this.shift),p=b;return b.cmp(this.m)>=0?p=b.isub(this.m):b.cmpn(0)<0&&(p=b.iadd(this.m)),p._forceRed(this)},O.prototype.mul=function(f,d){if(f.isZero()||d.isZero())return new n(0)._forceRed(this);var _=f.mul(d),x=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=_.isub(x).iushrn(this.shift),p=b;return b.cmp(this.m)>=0?p=b.isub(this.m):b.cmpn(0)<0&&(p=b.iadd(this.m)),p._forceRed(this)},O.prototype.invm=function(f){var d=this.imod(f._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof qm>"u"||qm,qO)});var Um=k((L1e,jO)=>{"use strict";v();var Mc=UO(),GY=mu(),ZY=nt().Buffer;function FO(e){var t=e.modulus.byteLength(),r;do r=new Mc(GY(t));while(r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2));return r}function WY(e){var t=FO(e),r=t.toRed(Mc.mont(e.modulus)).redPow(new Mc(e.publicExponent)).fromRed();return{blinder:r,unblinder:t.invm(e.modulus)}}function HO(e,t){var r=WY(t),i=t.modulus.byteLength(),n=new Mc(e).mul(r.blinder).umod(t.modulus),o=n.toRed(Mc.mont(t.prime1)),a=n.toRed(Mc.mont(t.prime2)),s=t.coefficient,u=t.prime1,c=t.prime2,l=o.redPow(t.exponent1).fromRed(),m=a.redPow(t.exponent2).fromRed(),w=l.isub(m).imul(s).umod(u).imul(c);return m.iadd(w).imul(r.unblinder).umod(t.modulus).toArrayLike(ZY,"be",i)}HO.getr=FO;jO.exports=HO});var GO=k((U1e,VO)=>{v();var YY=Mm(),Fm=mu(),$Y=zh(),zO=Cm(),KO=Dm(),Hm=Nn(),XY=Lm(),JY=Um(),Un=nt().Buffer;VO.exports=function(t,r,i){var n;t.padding?n=t.padding:i?n=1:n=4;var o=YY(t),a;if(n===4)a=QY(o,r);else if(n===1)a=e$(o,r,i);else if(n===3){if(a=new Hm(r),a.cmp(o.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return i?JY(a,o):XY(a,o)};function QY(e,t){var r=e.modulus.byteLength(),i=t.length,n=$Y("sha1").update(Un.alloc(0)).digest(),o=n.length,a=2*o;if(i>r-a-2)throw new Error("message too long");var s=Un.alloc(r-i-a-2),u=r-o-1,c=Fm(o),l=KO(Un.concat([n,s,Un.alloc(1,1),t],u),zO(c,u)),m=KO(c,zO(l,o));return new Hm(Un.concat([Un.alloc(1),m,l],r))}function e$(e,t,r){var i=t.length,n=e.modulus.byteLength();if(i>n-11)throw new Error("message too long");var o;return r?o=Un.alloc(n-i-3,255):o=t$(n-i-3),new Hm(Un.concat([Un.from([0,r?1:2]),o,Un.alloc(1),t],n))}function t$(e){for(var t=Un.allocUnsafe(e),r=0,i=Fm(e*2),n=0,o;r<e;)n===i.length&&(i=Fm(e*2),n=0),o=i[n++],o&&(t[r++]=o);return t}});var XO=k((H1e,$O)=>{v();var r$=Mm(),ZO=Cm(),WO=Dm(),YO=Nn(),i$=Um(),n$=zh(),o$=Lm(),t0=nt().Buffer;$O.exports=function(t,r,i){var n;t.padding?n=t.padding:i?n=1:n=4;var o=r$(t),a=o.modulus.byteLength();if(r.length>a||new YO(r).cmp(o.modulus)>=0)throw new Error("decryption error");var s;i?s=o$(new YO(r),o):s=i$(r,o);var u=t0.alloc(a-s.length);if(s=t0.concat([u,s],a),n===4)return a$(o,s);if(n===1)return s$(o,s,i);if(n===3)return s;throw new Error("unknown padding")};function a$(e,t){var r=e.modulus.byteLength(),i=n$("sha1").update(t0.alloc(0)).digest(),n=i.length;if(t[0]!==0)throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=WO(o,ZO(a,n)),u=WO(a,ZO(s,r-n-1));if(u$(i,u.slice(0,n)))throw new Error("decryption error");for(var c=n;u[c]===0;)c++;if(u[c++]!==1)throw new Error("decryption error");return u.slice(c)}function s$(e,t,r){for(var i=t.slice(0,2),n=2,o=0;t[n++]!==0;)if(n>=t.length){o++;break}var a=t.slice(2,n-1);if((i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return t.slice(n)}function u$(e,t){e=t0.from(e),t=t0.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));for(var n=-1;++n<i;)r+=e[n]^t[n];return r}});var JO=k(Ku=>{v();Ku.publicEncrypt=GO();Ku.privateDecrypt=XO();Ku.privateEncrypt=function(t,r){return Ku.publicEncrypt(t,r,!0)};Ku.publicDecrypt=function(t,r){return Ku.privateDecrypt(t,r,!0)}});var uI=k(r0=>{"use strict";v();function QO(){throw new Error(`secure random number generation not supported by this browser
|
|
15
15
|
use chrome, FireFox or Internet Explorer 11`)}var tI=nt(),eI=mu(),rI=tI.Buffer,iI=tI.kMaxLength,jm=globalThis.crypto||globalThis.msCrypto,nI=Math.pow(2,32)-1;function oI(e,t){if(typeof e!="number"||e!==e)throw new TypeError("offset must be a number");if(e>nI||e<0)throw new TypeError("offset must be a uint32");if(e>iI||e>t)throw new RangeError("offset out of range")}function aI(e,t,r){if(typeof e!="number"||e!==e)throw new TypeError("size must be a number");if(e>nI||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>iI)throw new RangeError("buffer too small")}jm&&jm.getRandomValues||!A.default.browser?(r0.randomFill=f$,r0.randomFillSync=c$):(r0.randomFill=QO,r0.randomFillSync=QO);function f$(e,t,r,i){if(!rI.isBuffer(e)&&!(e instanceof globalThis.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof t=="function")i=t,t=0,r=e.length;else if(typeof r=="function")i=r,r=e.length-t;else if(typeof i!="function")throw new TypeError('"cb" argument must be a function');return oI(t,e.length),aI(r,t,e.length),sI(e,t,r,i)}function sI(e,t,r,i){if(A.default.browser){var n=e.buffer,o=new Uint8Array(n,t,r);if(jm.getRandomValues(o),i){A.default.nextTick(function(){i(null,e)});return}return e}if(i){eI(r,function(s,u){if(s)return i(s);u.copy(e,t),i(null,e)});return}var a=eI(r);return a.copy(e,t),e}function c$(e,t,r){if(typeof t>"u"&&(t=0),!rI.isBuffer(e)&&!(e instanceof globalThis.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return oI(t,e.length),r===void 0&&(r=e.length-t),aI(r,t,e.length),sI(e,t,r)}});var _r=k(ot=>{"use strict";v();ot.randomBytes=ot.rng=ot.pseudoRandomBytes=ot.prng=mu();ot.createHash=ot.Hash=zh();ot.createHmac=ot.Hmac=nx();var l$=fs(),h$=Object.keys(l$),d$=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(h$);ot.getHashes=function(){return d$};var fI=jv();ot.pbkdf2=fI.pbkdf2;ot.pbkdf2Sync=fI.pbkdf2Sync;var xo=TE();ot.Cipher=xo.Cipher;ot.createCipher=xo.createCipher;ot.Cipheriv=xo.Cipheriv;ot.createCipheriv=xo.createCipheriv;ot.Decipher=xo.Decipher;ot.createDecipher=xo.createDecipher;ot.Decipheriv=xo.Decipheriv;ot.createDecipheriv=xo.createDecipheriv;ot.getCiphers=xo.getCiphers;ot.listCiphers=xo.listCiphers;var i0=zE();ot.DiffieHellmanGroup=i0.DiffieHellmanGroup;ot.createDiffieHellmanGroup=i0.createDiffieHellmanGroup;ot.getDiffieHellman=i0.getDiffieHellman;ot.createDiffieHellman=i0.createDiffieHellman;ot.DiffieHellman=i0.DiffieHellman;var G2=fs();ot.createSign=G2.createSign;ot.Sign=G2.Sign;ot.createVerify=G2.createVerify;ot.Verify=G2.Verify;ot.createECDH=fs();var Z2=JO();ot.publicEncrypt=Z2.publicEncrypt;ot.privateEncrypt=Z2.privateEncrypt;ot.publicDecrypt=Z2.publicDecrypt;ot.privateDecrypt=Z2.privateDecrypt;var cI=uI();ot.randomFill=cI.randomFill;ot.randomFillSync=cI.randomFillSync;ot.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
|
|
16
16
|
we accept pull requests
|
|
17
|
-
https://github.com/browserify/crypto-browserify`)};ot.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}});var ds=k((Y1e,lI)=>{"use strict";v();function Nc(){}Nc.getRandomBuffer=function(e){return A.default.browser?Nc.getRandomBufferBrowser(e):Nc.getRandomBufferNode(e)};Nc.getRandomBufferNode=function(e){var t=_r();return t.randomBytes(e)};Nc.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");var t;if(window.crypto&&window.crypto.getRandomValues)t=window.crypto;else if(window.msCrypto&&window.msCrypto.getRandomValues)t=window.msCrypto;else throw new Error("window.crypto.getRandomValues not available");var r=new Uint8Array(e);t.getRandomValues(r);var i=h.Buffer.from(r);return i};lI.exports=Nc});var xt=k((X1e,hI)=>{"use strict";v();var p$=ds(),Vt={};Vt.isArray=e=>Array.isArray(e);Vt.isNumber=e=>typeof e=="number";Vt.isObject=e=>e&&typeof e=="object";Vt.isString=e=>typeof e=="string";Vt.isUndefined=e=>typeof e>"u";Vt.isFunction=e=>typeof e=="function";Vt.isNull=e=>e===null;Vt.isDate=e=>e instanceof Date;Vt.extend=(e,t)=>Object.assign(e,t);Vt.noop=()=>{};Vt.every=(e,t)=>e.every(t||(r=>r));Vt.map=(e,t)=>Array.from(e).map(t||(r=>r));Vt.includes=(e,t)=>e.includes(t);Vt.each=(e,t)=>e.forEach(t);Vt.clone=e=>Object.assign({},e);Vt.pick=(e,t)=>{let r={};return t.forEach(i=>{typeof e[i]<"u"&&(r[i]=e[i])}),r};Vt.values=e=>Object.values(e);Vt.filter=(e,t)=>e.filter(t);Vt.reduce=(e,t,r)=>e.reduce(t,r);Vt.without=(e,t)=>e.filter(r=>r!==t);Vt.shuffle=e=>{let t=e.slice(0);for(let r=t.length-1;r>0;r--){let n=p$.getRandomBuffer(4).readUInt32BE(0)/4294967296,o=Math.floor(n*(r+1));[t[r],t[o]]=[t[o],t[r]]}return t};Vt.difference=(e,t)=>e.filter(r=>!t.includes(r));Vt.findIndex=(e,t)=>e.findIndex(t);Vt.some=(e,t)=>e.some(t);Vt.range=e=>[...Array(e).keys()];hI.exports=Vt});var pI=k((Q1e,dI)=>{"use strict";v();var W2=nt().Buffer;function g$(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var n=e.charAt(i),o=n.charCodeAt(0);if(t[o]!==255)throw new TypeError(n+" is ambiguous");t[o]=i}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function l(E){if((Array.isArray(E)||E instanceof Uint8Array)&&(E=W2.from(E)),!W2.isBuffer(E))throw new TypeError("Expected Buffer");if(E.length===0)return"";for(var P=0,M=0,D=0,L=E.length;D!==L&&E[D]===0;)D++,P++;for(var U=(L-D)*c+1>>>0,K=new Uint8Array(U);D!==L;){for(var N=E[D],C=0,F=U-1;(N!==0||C<M)&&F!==-1;F--,C++)N+=256*K[F]>>>0,K[F]=N%a>>>0,N=N/a>>>0;if(N!==0)throw new Error("Non-zero carry");M=C,D++}for(var H=U-M;H!==U&&K[H]===0;)H++;for(var z=s.repeat(P);H<U;++H)z+=e.charAt(K[H]);return z}function m(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return W2.alloc(0);for(var P=0,M=0,D=0;E[P]===s;)M++,P++;for(var L=(E.length-P)*u+1>>>0,U=new Uint8Array(L);P<E.length;){var K=E.charCodeAt(P);if(K>255)return;var N=t[K];if(N===255)return;for(var C=0,F=L-1;(N!==0||C<D)&&F!==-1;F--,C++)N+=a*U[F]>>>0,U[F]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");D=C,P++}for(var H=L-D;H!==L&&U[H]===0;)H++;var z=W2.allocUnsafe(M+(L-H));z.fill(0,0,M);for(var G=M;H!==L;)z[G++]=U[H++];return z}function w(E){var P=m(E);if(P)return P;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:m,decode:w}}dI.exports=g$});var Y2=k((tde,gI)=>{v();var v$=pI(),m$="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";gI.exports=v$(m$)});var zm=k((ide,vI)=>{"use strict";v();vI.exports="7.
|
|
17
|
+
https://github.com/browserify/crypto-browserify`)};ot.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}});var ds=k((Y1e,lI)=>{"use strict";v();function Nc(){}Nc.getRandomBuffer=function(e){return A.default.browser?Nc.getRandomBufferBrowser(e):Nc.getRandomBufferNode(e)};Nc.getRandomBufferNode=function(e){var t=_r();return t.randomBytes(e)};Nc.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");var t;if(window.crypto&&window.crypto.getRandomValues)t=window.crypto;else if(window.msCrypto&&window.msCrypto.getRandomValues)t=window.msCrypto;else throw new Error("window.crypto.getRandomValues not available");var r=new Uint8Array(e);t.getRandomValues(r);var i=h.Buffer.from(r);return i};lI.exports=Nc});var xt=k((X1e,hI)=>{"use strict";v();var p$=ds(),Vt={};Vt.isArray=e=>Array.isArray(e);Vt.isNumber=e=>typeof e=="number";Vt.isObject=e=>e&&typeof e=="object";Vt.isString=e=>typeof e=="string";Vt.isUndefined=e=>typeof e>"u";Vt.isFunction=e=>typeof e=="function";Vt.isNull=e=>e===null;Vt.isDate=e=>e instanceof Date;Vt.extend=(e,t)=>Object.assign(e,t);Vt.noop=()=>{};Vt.every=(e,t)=>e.every(t||(r=>r));Vt.map=(e,t)=>Array.from(e).map(t||(r=>r));Vt.includes=(e,t)=>e.includes(t);Vt.each=(e,t)=>e.forEach(t);Vt.clone=e=>Object.assign({},e);Vt.pick=(e,t)=>{let r={};return t.forEach(i=>{typeof e[i]<"u"&&(r[i]=e[i])}),r};Vt.values=e=>Object.values(e);Vt.filter=(e,t)=>e.filter(t);Vt.reduce=(e,t,r)=>e.reduce(t,r);Vt.without=(e,t)=>e.filter(r=>r!==t);Vt.shuffle=e=>{let t=e.slice(0);for(let r=t.length-1;r>0;r--){let n=p$.getRandomBuffer(4).readUInt32BE(0)/4294967296,o=Math.floor(n*(r+1));[t[r],t[o]]=[t[o],t[r]]}return t};Vt.difference=(e,t)=>e.filter(r=>!t.includes(r));Vt.findIndex=(e,t)=>e.findIndex(t);Vt.some=(e,t)=>e.some(t);Vt.range=e=>[...Array(e).keys()];hI.exports=Vt});var pI=k((Q1e,dI)=>{"use strict";v();var W2=nt().Buffer;function g$(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var n=e.charAt(i),o=n.charCodeAt(0);if(t[o]!==255)throw new TypeError(n+" is ambiguous");t[o]=i}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function l(E){if((Array.isArray(E)||E instanceof Uint8Array)&&(E=W2.from(E)),!W2.isBuffer(E))throw new TypeError("Expected Buffer");if(E.length===0)return"";for(var P=0,M=0,D=0,L=E.length;D!==L&&E[D]===0;)D++,P++;for(var U=(L-D)*c+1>>>0,K=new Uint8Array(U);D!==L;){for(var N=E[D],C=0,F=U-1;(N!==0||C<M)&&F!==-1;F--,C++)N+=256*K[F]>>>0,K[F]=N%a>>>0,N=N/a>>>0;if(N!==0)throw new Error("Non-zero carry");M=C,D++}for(var H=U-M;H!==U&&K[H]===0;)H++;for(var z=s.repeat(P);H<U;++H)z+=e.charAt(K[H]);return z}function m(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return W2.alloc(0);for(var P=0,M=0,D=0;E[P]===s;)M++,P++;for(var L=(E.length-P)*u+1>>>0,U=new Uint8Array(L);P<E.length;){var K=E.charCodeAt(P);if(K>255)return;var N=t[K];if(N===255)return;for(var C=0,F=L-1;(N!==0||C<D)&&F!==-1;F--,C++)N+=a*U[F]>>>0,U[F]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");D=C,P++}for(var H=L-D;H!==L&&U[H]===0;)H++;var z=W2.allocUnsafe(M+(L-H));z.fill(0,0,M);for(var G=M;H!==L;)z[G++]=U[H++];return z}function w(E){var P=m(E);if(P)return P;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:m,decode:w}}dI.exports=g$});var Y2=k((tde,gI)=>{v();var v$=pI(),m$="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";gI.exports=v$(m$)});var zm=k((ide,vI)=>{"use strict";v();vI.exports="7.5.0"});var yI=k((ode,mI)=>{"use strict";v();var y$="https://docs.moneybutton.com/";mI.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+y$+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]});var hn=k((sde,Vm)=>{"use strict";v();var Km=xt();function b$(e,t){return e.replace("{0}",t[0]).replace("{1}",t[1]).replace("{2}",t[2])}var bI=function(e,t){var r=function(){if(Km.isString(t.message))this.message=b$(t.message,arguments);else if(Km.isFunction(t.message))this.message=t.message.apply(null,arguments);else throw new Error("Invalid error definition for "+t.name);this.stack=this.message+`
|
|
18
18
|
`+new Error().stack};return r.prototype=Object.create(e.prototype),r.prototype.name=e.prototype.name+t.name,e[t.name]=r,t.errors&&_I(r,t.errors),r},_I=function(e,t){Km.each(t,function(r){bI(e,r)})},_$=function(e,t){return _I(e,t),e},Cc={};Cc.Error=function(){this.message="Internal error",this.stack=this.message+`
|
|
19
|
-
`+new Error().stack};Cc.Error.prototype=Object.create(Error.prototype);Cc.Error.prototype.name="bsv.Error";var w$=yI();_$(Cc.Error,w$);Vm.exports=Cc.Error;Vm.exports.extend=function(e){return bI(Cc.Error,e)}});var Bt=k((fde,wI)=>{"use strict";v();var n0=hn(),S$=xt();wI.exports={checkState:function(e,t){if(!e)throw new n0.InvalidState(t)},checkArgument:function(e,t,r,i){if(!e)throw new n0.InvalidArgument(t,r,i)},checkArgumentType:function(e,t,r){if(r=r||"(unknown name)",S$.isString(t)){if(t==="Buffer"){var i=Kt();if(!i.Buffer.isBuffer(e))throw new n0.InvalidArgumentType(e,t,r)}else if(typeof e!==t)throw new n0.InvalidArgumentType(e,t,r)}else if(!(e instanceof t))throw new n0.InvalidArgumentType(e,t.name,r)}}});var fr=k((lde,xI)=>{"use strict";v();var It=Nn(),Gm=Bt(),SI=xt(),$2=function(e){for(var t=h.Buffer.alloc(e.length),r=0;r<e.length;r++)t[r]=e[e.length-1-r];return t};It.Zero=new It(0);It.One=new It(1);It.Minus1=new It(-1);It.fromNumber=function(e){return Gm.checkArgument(SI.isNumber(e)),new It(e)};It.fromString=function(e,t){return Gm.checkArgument(SI.isString(e)),new It(e,t)};It.fromBuffer=function(e,t){typeof t<"u"&&t.endian==="little"&&(e=$2(e));var r=e.toString("hex"),i=new It(r,16);return i};It.fromSM=function(e,t){var r;if(e.length===0)return It.fromBuffer(h.Buffer.from([0]));var i="big";return t&&(i=t.endian),i==="little"&&(e=$2(e)),e[0]&128?(e[0]=e[0]&127,r=It.fromBuffer(e),r.neg().copy(r)):r=It.fromBuffer(e),r};It.prototype.toNumber=function(){return parseInt(this.toString(10),10)};It.prototype.toBuffer=function(e){var t,r;if(e&&e.size){r=this.toString(16,2);var i=r.length/2;t=h.Buffer.from(r,"hex"),i===e.size||(i>e.size?t=It.trim(t,i):i<e.size&&(t=It.pad(t,i,e.size)))}else r=this.toString(16,2),t=h.Buffer.from(r,"hex");return typeof e<"u"&&e.endian==="little"&&(t=$2(t)),t};It.prototype.toSMBigEndian=function(){var e;return this.cmp(It.Zero)===-1?(e=this.neg().toBuffer(),e[0]&128?e=h.Buffer.concat([h.Buffer.from([128]),e]):e[0]=e[0]|128):(e=this.toBuffer(),e[0]&128&&(e=h.Buffer.concat([h.Buffer.from([0]),e]))),e.length===1&e[0]===0&&(e=h.Buffer.from([])),e};It.prototype.toSM=function(e){var t=e?e.endian:"big",r=this.toSMBigEndian();return t==="little"&&(r=$2(r)),r};It.fromScriptNumBuffer=function(e,t,r){var i=r||4;if(Gm.checkArgument(e.length<=i,new Error("script number overflow")),t&&e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))throw new Error("non-minimally encoded script number");return It.fromSM(e,{endian:"little"})};It.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})};It.trim=function(e,t){return e.slice(t-e.length,e.length)};It.pad=function(e,t,r){for(var i=h.Buffer.alloc(r),n=0;n<e.length;n++)i[i.length-1-n]=e[e.length-1-n];for(n=0;n<r-t;n++)i[n]=0;return i};It.prototype.toHex=function(...e){return this.toBuffer(...e).toString("hex")};It.fromHex=function(e,...t){return It.fromBuffer(h.Buffer.from(e,"hex"),...t)};xI.exports=It});function Zm(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ps(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(`${r}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){let r=t&&`"${t}" `;throw new RangeError(`${r}expected integer >= 0, got ${e}`)}}function Eo(e,t,r=""){let i=Zm(e),n=e?.length,o=t!==void 0;if(!i||o&&n!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=i?`length=${n}`:`type=${typeof e}`,c=a+"expected Uint8Array"+s+", got "+u;throw i?new RangeError(c):new TypeError(c)}return e}function X2(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ps(e.outputLen),ps(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function Dc(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 J2(e,t){Eo(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function Sa(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Q2(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Fn(e,t){return e<<32-t|e>>>t}function ep(e){if(Eo(e),OI)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=x$[e[r]];return t}function EI(e){if(e>=wa._0&&e<=wa._9)return e-wa._0;if(e>=wa.A&&e<=wa.F)return e-(wa.A-10);if(e>=wa.a&&e<=wa.f)return e-(wa.a-10)}function Wm(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(OI)try{return Uint8Array.fromHex(e)}catch(n){throw n instanceof SyntaxError?new RangeError(n.message):n}let t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);let i=new Uint8Array(r);for(let n=0,o=0;n<r;n++,o+=2){let a=EI(e.charCodeAt(o)),s=EI(e.charCodeAt(o+1));if(a===void 0||s===void 0){let u=e[o]+e[o+1];throw new RangeError('hex string expected, got non-hex character "'+u+'" at index '+o)}i[n]=a*16+s}return i}function xa(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function II(...e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];Eo(n),t+=n.length}let r=new Uint8Array(t);for(let i=0,n=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return r}function Vu(e,t={}){let r=(n,o)=>e(o).update(n).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=n=>e(n),Object.assign(r,t),Object.freeze(r)}function o0(e=32){ps(e,"bytesLength");let t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}var OI,x$,wa,Gu,gs=Xr(()=>{v();OI=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",x$=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));wa={_0:48,_9:57,A:65,F:70,a:97,f:102};Gu=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})});function AI(e,t,r){return e&t^~e&r}function PI(e,t,r){return e&t^e&r^t&r}var a0,Ea,Oa,Qr,ei,TI=Xr(()=>{v();gs();a0=class{constructor(t,r,i,n){Z(this,"blockLen");Z(this,"outputLen");Z(this,"canXOF",!1);Z(this,"padOffset");Z(this,"isLE");Z(this,"buffer");Z(this,"view");Z(this,"finished",!1);Z(this,"length",0);Z(this,"pos",0);Z(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=Q2(this.buffer)}update(t){Dc(this),Eo(t);let{view:r,buffer:i,blockLen:n}=this,o=t.length;for(let a=0;a<o;){let s=Math.min(n-this.pos,o-a);if(s===n){let u=Q2(t);for(;n<=o-a;a+=n)this.process(u,a);continue}i.set(t.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Dc(this),J2(t,this),this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:a}=this;r[a++]=128,Sa(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(i,0),a=0);for(let m=a;m<n;m++)r[m]=0;i.setBigUint64(n-8,BigInt(this.length*8),o),this.process(i,0);let s=Q2(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<c;m++)s.setUint32(4*m,l[m],o)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:i,length:n,finished:o,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=o,t.length=n,t.pos=s,n%r&&t.buffer.set(i),t}clone(){return this._cloneInto()}},Ea=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Oa=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Qr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ei=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});function E$(e,t=!1){return t?{h:Number(e&tp),l:Number(e>>kI&tp)}:{h:Number(e>>kI&tp)|0,l:Number(e&tp)|0}}function RI(e,t=!1){let r=e.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:a,l:s}=E$(e[o],t);[i[o],n[o]]=[a,s]}return[i,n]}function Oo(e,t,r,i){let n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:n|0}}var tp,kI,Ym,$m,Zu,Wu,s0,u0,BI,MI,NI,CI,DI,LI,qI=Xr(()=>{v();tp=BigInt(4294967295),kI=BigInt(32);Ym=(e,t,r)=>e>>>r,$m=(e,t,r)=>e<<32-r|t>>>r,Zu=(e,t,r)=>e>>>r|t<<32-r,Wu=(e,t,r)=>e<<32-r|t>>>r,s0=(e,t,r)=>e<<64-r|t>>>r-32,u0=(e,t,r)=>e>>>r-32|t<<64-r;BI=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),MI=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,NI=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),CI=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,DI=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),LI=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0});var Xm={};Q1(Xm,{_SHA224:()=>np,_SHA256:()=>ip,_SHA384:()=>ap,_SHA512:()=>op,_SHA512_224:()=>sp,_SHA512_256:()=>up,sha224:()=>T$,sha256:()=>bs,sha384:()=>R$,sha512:()=>k$,sha512_224:()=>M$,sha512_256:()=>B$});var I$,vs,rp,ip,np,UI,A$,P$,ms,ys,Lc,op,ap,hi,di,sp,up,bs,T$,k$,R$,B$,M$,fp=Xr(()=>{v();TI();qI();gs();I$=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),vs=new Uint32Array(64),rp=class extends a0{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:r,C:i,D:n,E:o,F:a,G:s,H:u}=this;return[t,r,i,n,o,a,s,u]}set(t,r,i,n,o,a,s,u){this.A=t|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0}process(t,r){for(let m=0;m<16;m++,r+=4)vs[m]=t.getUint32(r,!1);for(let m=16;m<64;m++){let w=vs[m-15],E=vs[m-2],P=Fn(w,7)^Fn(w,18)^w>>>3,M=Fn(E,17)^Fn(E,19)^E>>>10;vs[m]=M+vs[m-7]+P+vs[m-16]|0}let{A:i,B:n,C:o,D:a,E:s,F:u,G:c,H:l}=this;for(let m=0;m<64;m++){let w=Fn(s,6)^Fn(s,11)^Fn(s,25),E=l+w+AI(s,u,c)+I$[m]+vs[m]|0,M=(Fn(i,2)^Fn(i,13)^Fn(i,22))+PI(i,n,o)|0;l=c,c=u,u=s,s=a+E|0,a=o,o=n,n=i,i=E+M|0}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(i,n,o,a,s,u,c,l)}roundClean(){Sa(vs)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Sa(this.buffer)}},ip=class extends rp{constructor(){super(32);Z(this,"A",Ea[0]|0);Z(this,"B",Ea[1]|0);Z(this,"C",Ea[2]|0);Z(this,"D",Ea[3]|0);Z(this,"E",Ea[4]|0);Z(this,"F",Ea[5]|0);Z(this,"G",Ea[6]|0);Z(this,"H",Ea[7]|0)}},np=class extends rp{constructor(){super(28);Z(this,"A",Oa[0]|0);Z(this,"B",Oa[1]|0);Z(this,"C",Oa[2]|0);Z(this,"D",Oa[3]|0);Z(this,"E",Oa[4]|0);Z(this,"F",Oa[5]|0);Z(this,"G",Oa[6]|0);Z(this,"H",Oa[7]|0)}},UI=RI(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),A$=UI[0],P$=UI[1],ms=new Uint32Array(80),ys=new Uint32Array(80),Lc=class extends a0{constructor(t){super(128,t,16,!1)}get(){let{Ah:t,Al:r,Bh:i,Bl:n,Ch:o,Cl:a,Dh:s,Dl:u,Eh:c,El:l,Fh:m,Fl:w,Gh:E,Gl:P,Hh:M,Hl:D}=this;return[t,r,i,n,o,a,s,u,c,l,m,w,E,P,M,D]}set(t,r,i,n,o,a,s,u,c,l,m,w,E,P,M,D){this.Ah=t|0,this.Al=r|0,this.Bh=i|0,this.Bl=n|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=c|0,this.El=l|0,this.Fh=m|0,this.Fl=w|0,this.Gh=E|0,this.Gl=P|0,this.Hh=M|0,this.Hl=D|0}process(t,r){for(let K=0;K<16;K++,r+=4)ms[K]=t.getUint32(r),ys[K]=t.getUint32(r+=4);for(let K=16;K<80;K++){let N=ms[K-15]|0,C=ys[K-15]|0,F=Zu(N,C,1)^Zu(N,C,8)^Ym(N,C,7),H=Wu(N,C,1)^Wu(N,C,8)^$m(N,C,7),z=ms[K-2]|0,G=ys[K-2]|0,B=Zu(z,G,19)^s0(z,G,61)^Ym(z,G,6),g=Wu(z,G,19)^u0(z,G,61)^$m(z,G,6),O=NI(H,g,ys[K-7],ys[K-16]),y=CI(O,F,B,ms[K-7],ms[K-16]);ms[K]=y|0,ys[K]=O|0}let{Ah:i,Al:n,Bh:o,Bl:a,Ch:s,Cl:u,Dh:c,Dl:l,Eh:m,El:w,Fh:E,Fl:P,Gh:M,Gl:D,Hh:L,Hl:U}=this;for(let K=0;K<80;K++){let N=Zu(m,w,14)^Zu(m,w,18)^s0(m,w,41),C=Wu(m,w,14)^Wu(m,w,18)^u0(m,w,41),F=m&E^~m&M,H=w&P^~w&D,z=DI(U,C,H,P$[K],ys[K]),G=LI(z,L,N,F,A$[K],ms[K]),B=z|0,g=Zu(i,n,28)^s0(i,n,34)^s0(i,n,39),O=Wu(i,n,28)^u0(i,n,34)^u0(i,n,39),y=i&o^i&s^o&s,f=n&a^n&u^a&u;L=M|0,U=D|0,M=E|0,D=P|0,E=m|0,P=w|0,{h:m,l:w}=Oo(c|0,l|0,G|0,B|0),c=s|0,l=u|0,s=o|0,u=a|0,o=i|0,a=n|0;let d=BI(B,O,f);i=MI(d,G,g,y),n=d|0}({h:i,l:n}=Oo(this.Ah|0,this.Al|0,i|0,n|0)),{h:o,l:a}=Oo(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Oo(this.Ch|0,this.Cl|0,s|0,u|0),{h:c,l}=Oo(this.Dh|0,this.Dl|0,c|0,l|0),{h:m,l:w}=Oo(this.Eh|0,this.El|0,m|0,w|0),{h:E,l:P}=Oo(this.Fh|0,this.Fl|0,E|0,P|0),{h:M,l:D}=Oo(this.Gh|0,this.Gl|0,M|0,D|0),{h:L,l:U}=Oo(this.Hh|0,this.Hl|0,L|0,U|0),this.set(i,n,o,a,s,u,c,l,m,w,E,P,M,D,L,U)}roundClean(){Sa(ms,ys)}destroy(){this.destroyed=!0,Sa(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},op=class extends Lc{constructor(){super(64);Z(this,"Ah",ei[0]|0);Z(this,"Al",ei[1]|0);Z(this,"Bh",ei[2]|0);Z(this,"Bl",ei[3]|0);Z(this,"Ch",ei[4]|0);Z(this,"Cl",ei[5]|0);Z(this,"Dh",ei[6]|0);Z(this,"Dl",ei[7]|0);Z(this,"Eh",ei[8]|0);Z(this,"El",ei[9]|0);Z(this,"Fh",ei[10]|0);Z(this,"Fl",ei[11]|0);Z(this,"Gh",ei[12]|0);Z(this,"Gl",ei[13]|0);Z(this,"Hh",ei[14]|0);Z(this,"Hl",ei[15]|0)}},ap=class extends Lc{constructor(){super(48);Z(this,"Ah",Qr[0]|0);Z(this,"Al",Qr[1]|0);Z(this,"Bh",Qr[2]|0);Z(this,"Bl",Qr[3]|0);Z(this,"Ch",Qr[4]|0);Z(this,"Cl",Qr[5]|0);Z(this,"Dh",Qr[6]|0);Z(this,"Dl",Qr[7]|0);Z(this,"Eh",Qr[8]|0);Z(this,"El",Qr[9]|0);Z(this,"Fh",Qr[10]|0);Z(this,"Fl",Qr[11]|0);Z(this,"Gh",Qr[12]|0);Z(this,"Gl",Qr[13]|0);Z(this,"Hh",Qr[14]|0);Z(this,"Hl",Qr[15]|0)}},hi=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),di=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),sp=class extends Lc{constructor(){super(28);Z(this,"Ah",hi[0]|0);Z(this,"Al",hi[1]|0);Z(this,"Bh",hi[2]|0);Z(this,"Bl",hi[3]|0);Z(this,"Ch",hi[4]|0);Z(this,"Cl",hi[5]|0);Z(this,"Dh",hi[6]|0);Z(this,"Dl",hi[7]|0);Z(this,"Eh",hi[8]|0);Z(this,"El",hi[9]|0);Z(this,"Fh",hi[10]|0);Z(this,"Fl",hi[11]|0);Z(this,"Gh",hi[12]|0);Z(this,"Gl",hi[13]|0);Z(this,"Hh",hi[14]|0);Z(this,"Hl",hi[15]|0)}},up=class extends Lc{constructor(){super(32);Z(this,"Ah",di[0]|0);Z(this,"Al",di[1]|0);Z(this,"Bh",di[2]|0);Z(this,"Bl",di[3]|0);Z(this,"Ch",di[4]|0);Z(this,"Cl",di[5]|0);Z(this,"Dh",di[6]|0);Z(this,"Dl",di[7]|0);Z(this,"Eh",di[8]|0);Z(this,"El",di[9]|0);Z(this,"Fh",di[10]|0);Z(this,"Fl",di[11]|0);Z(this,"Gh",di[12]|0);Z(this,"Gl",di[13]|0);Z(this,"Hh",di[14]|0);Z(this,"Hl",di[15]|0)}},bs=Vu(()=>new ip,Gu(1)),T$=Vu(()=>new np,Gu(4)),k$=Vu(()=>new op,Gu(3)),R$=Vu(()=>new ap,Gu(2)),B$=Vu(()=>new up,Gu(6)),M$=Vu(()=>new sp,Gu(5))});function $u(e,t=""){if(typeof e!="boolean"){let r=t&&`"${t}" `;throw new TypeError(r+"expected boolean, got type="+typeof e)}return e}function hp(e){if(typeof e=="bigint"){if(!cp(e))throw new RangeError("positive bigint expected, got "+e)}else Qm(e);return e}function dn(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(r+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){let r=t&&`"${t}" `;throw new RangeError(r+"expected safe integer, got "+e)}}function f0(e){let t=hp(e).toString(16);return t.length&1?"0"+t:t}function FI(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?lp:BigInt("0x"+e)}function bi(e){return FI(ep(e))}function Uc(e){return FI(ep(pp(Eo(e)).reverse()))}function dp(e,t){if(ps(t),t===0)throw new RangeError("zero length");e=hp(e);let r=e.toString(16);if(r.length>t*2)throw new RangeError("number too large");return Wm(r.padStart(t*2,"0"))}function ey(e,t){return dp(e,t).reverse()}function pp(e){return Uint8Array.from(qt(e))}function Fc(e){if(typeof e!="string")throw new TypeError("ascii string expected, got "+typeof e);return Uint8Array.from(e,(t,r)=>{let i=t.charCodeAt(0);if(t.length!==1||i>127)throw new RangeError(`string contains non-ASCII character "${e[r]}" with code ${i} at position ${r}`);return i})}function N$(e,t,r){return cp(e)&&cp(t)&&cp(r)&&t<=e&&e<r}function ty(e,t,r,i){if(!N$(t,r,i))throw new RangeError("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}function Xu(e){if(e<lp)throw new Error("expected non-negative bigint, got "+e);let t;for(t=0;e>lp;e>>=Jm,t+=1);return t}function HI(e,t,r){if(ps(e,"hashLen"),ps(t,"qByteLen"),typeof r!="function")throw new TypeError("hmacFn must be a function");let i=D=>new Uint8Array(D),n=Uint8Array.of(),o=Uint8Array.of(0),a=Uint8Array.of(1),s=1e3,u=i(e),c=i(e),l=0,m=()=>{u.fill(1),c.fill(0),l=0},w=(...D)=>r(c,kt(u,...D)),E=(D=n)=>{c=w(o,D),u=w(),D.length!==0&&(c=w(a,D),u=w())},P=()=>{if(l++>=s)throw new Error("drbg: tried max amount of iterations");let D=0,L=[];for(;D<t;){u=w();let U=u.slice();L.push(U),D+=u.length}return kt(...L)};return(D,L)=>{m(),E(D);let U;for(;(U=L(P()))===void 0;)E();return m(),U}}function pn(e,t={},r={}){if(Object.prototype.toString.call(e)!=="[object Object]")throw new TypeError("expected valid options object");function i(o,a,s){if(!s&&a!=="function"&&!Object.hasOwn(e,o))throw new TypeError(`param "${o}" is invalid: expected own property`);let u=e[o];if(s&&u===void 0)return;let c=typeof u;if(c!==a||u===null)throw new TypeError(`param "${o}" is invalid: expected ${a}, got ${c}`)}let n=(o,a)=>Object.entries(o).forEach(([s,u])=>i(s,u,a));n(t,!1),n(r,!0)}var qt,Qm,Ia,kt,qc,Yu,ki,lp,Jm,cp,Hc,Ju=Xr(()=>{v();gs();qt=(e,t,r)=>Eo(e,t,r),Qm=ps,Ia=ep,kt=(...e)=>II(...e),qc=e=>Wm(e),Yu=Zm,ki=e=>o0(e),lp=BigInt(0),Jm=BigInt(1);cp=e=>typeof e=="bigint"&&lp<=e;Hc=e=>(Jm<<BigInt(e))-Jm});function Ui(e,t){if(t<=ti)throw new Error("mod: expected positive modulus, got "+t);let r=e%t;return r>=ti?r:t+r}function Fi(e,t,r){if(t<ti)throw new Error("pow2: expected non-negative exponent, got "+t);let i=e;for(;t-- >ti;)i*=i,i%=r;return i}function jI(e,t){if(e===ti)throw new Error("invert: expected non-zero number");if(t<=ti)throw new Error("invert: expected positive modulus, got "+t);let r=Ui(e,t),i=t,n=ti,o=wr,a=wr,s=ti;for(;r!==ti;){let c=i/r,l=i-r*c,m=n-a*c,w=o-s*c;i=r,r=l,n=a,o=s,a=m,s=w}if(i!==wr)throw new Error("invert: does not exist");return Ui(n,t)}function iy(e,t,r){let i=e;if(!i.eql(i.sqr(t),r))throw new Error("Cannot find square root")}function YI(e,t){let r=e,i=(r.ORDER+wr)/VI,n=r.pow(t,i);return iy(r,n,t),n}function L$(e,t){let r=e,i=(r.ORDER-GI)/ZI,n=r.mul(t,Qu),o=r.pow(n,i),a=r.mul(t,o),s=r.mul(r.mul(a,Qu),o),u=r.mul(a,r.sub(s,r.ONE));return iy(r,u,t),u}function q$(e){let t=jc(e),r=$I(e),i=r(t,t.neg(t.ONE)),n=r(t,i),o=r(t,t.neg(i)),a=(e+C$)/WI;return((s,u)=>{let c=s,l=c.pow(u,a),m=c.mul(l,i),w=c.mul(l,n),E=c.mul(l,o),P=c.eql(c.sqr(m),u),M=c.eql(c.sqr(w),u);l=c.cmov(l,m,P),m=c.cmov(E,w,M);let D=c.eql(c.sqr(m),u),L=c.cmov(l,m,D);return iy(c,L,u),L})}function $I(e){if(e<KI)throw new Error("sqrt is not defined for small field");let t=e-wr,r=0;for(;t%Qu===ti;)t/=Qu,r++;let i=Qu,n=jc(e);for(;ry(n,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return YI;let o=n.pow(i,t),a=(t+wr)/Qu;return function(u,c){let l=u;if(l.is0(c))return c;if(ry(l,c)!==1)throw new Error("Cannot find square root");let m=r,w=l.mul(l.ONE,o),E=l.pow(c,t),P=l.pow(c,a);for(;!l.eql(E,l.ONE);){if(l.is0(E))return l.ZERO;let M=1,D=l.sqr(E);for(;!l.eql(D,l.ONE);)if(M++,D=l.sqr(D),M===m)throw new Error("Cannot find square root");let L=wr<<BigInt(m-M-1),U=l.pow(w,L);m=M,w=l.sqr(U),E=l.mul(E,w),P=l.mul(P,U)}return P}}function U$(e){return e%VI===KI?YI:e%ZI===GI?L$:e%WI===D$?q$(e):$I(e)}function ef(e){let t={ORDER:"bigint",BYTES:"number",BITS:"number"},r=F$.reduce((i,n)=>(i[n]="function",i),t);if(pn(e,r),dn(e.BYTES,"BYTES"),dn(e.BITS,"BITS"),e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=wr)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function H$(e,t,r){let i=e;if(r<ti)throw new Error("invalid exponent, negatives unsupported");if(r===ti)return i.ONE;if(r===wr)return t;let n=i.ONE,o=t;for(;r>ti;)r&wr&&(n=i.mul(n,o)),o=i.sqr(o),r>>=wr;return n}function tf(e,t,r=!1){let i=e,n=new Array(t.length).fill(r?i.ZERO:void 0),o=t.reduce((s,u,c)=>i.is0(u)?s:(n[c]=s,i.mul(s,u)),i.ONE),a=i.inv(o);return t.reduceRight((s,u,c)=>i.is0(u)?s:(n[c]=i.mul(s,n[c]),i.mul(s,u)),a),n}function ry(e,t){let r=e,i=(r.ORDER-wr)/Qu,n=r.pow(t,i),o=r.eql(n,r.ONE),a=r.eql(n,r.ZERO),s=r.eql(n,r.neg(r.ONE));if(!o&&!a&&!s)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}function ny(e,t){return ry(e,t)!==-1}function j$(e,t){if(t!==void 0&&Qm(t),e<=ti)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);let r=Xu(e);if(t!==void 0&&t<r)throw new Error(`invalid n length: expected bit length (${r}) >= n.length (${t})`);let i=t!==void 0?t:r,n=Math.ceil(i/8);return{nBitLength:i,nByteLength:n}}function jc(e,t={}){return new gp(e,t)}function XI(e){if(typeof e!="bigint")throw new Error("field order must be bigint");if(e<=wr)throw new Error("field order must be greater than 1");let t=Xu(e-wr);return Math.ceil(t/8)}function c0(e){let t=XI(e);return t+Math.ceil(t/2)}function zc(e,t,r=!1){qt(e);let i=e.length,n=XI(t),o=Math.max(c0(t),16);if(i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let a=r?Uc(e):bi(e),s=Ui(a,t-wr)+wr;return r?ey(s,n):dp(s,n)}var ti,wr,Qu,KI,VI,GI,C$,ZI,D$,WI,F$,zI,gp,Kc=Xr(()=>{v();Ju();ti=BigInt(0),wr=BigInt(1),Qu=BigInt(2),KI=BigInt(3),VI=BigInt(4),GI=BigInt(5),C$=BigInt(7),ZI=BigInt(8),D$=BigInt(9),WI=BigInt(16);F$=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];zI=new WeakMap,gp=class{constructor(t,r={}){Z(this,"ORDER");Z(this,"BITS");Z(this,"BYTES");Z(this,"isLE");Z(this,"ZERO",ti);Z(this,"ONE",wr);Z(this,"_lengths");Z(this,"_mod");if(t<=wr)throw new Error("invalid field: expected ORDER > 1, got "+t);let i;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(i=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:!0}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:n,nByteLength:o}=j$(t,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=n,this.BYTES=o,Object.freeze(this)}create(t){return Ui(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return ti<=t&&t<this.ORDER}is0(t){return t===ti}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&wr)===wr}neg(t){return Ui(-t,this.ORDER)}eql(t,r){return t===r}sqr(t){return Ui(t*t,this.ORDER)}add(t,r){return Ui(t+r,this.ORDER)}sub(t,r){return Ui(t-r,this.ORDER)}mul(t,r){return Ui(t*r,this.ORDER)}pow(t,r){return H$(this,t,r)}div(t,r){return Ui(t*jI(r,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,r){return t+r}subN(t,r){return t-r}mulN(t,r){return t*r}inv(t){return jI(t,this.ORDER)}sqrt(t){let r=zI.get(this);return r||zI.set(this,r=U$(this.ORDER)),r(this,t)}toBytes(t){return this.isLE?ey(t,this.BYTES):dp(t,this.BYTES)}fromBytes(t,r=!1){qt(t);let{_lengths:i,BYTES:n,isLE:o,ORDER:a,_mod:s}=this;if(i){if(t.length<1||!i.includes(t.length)||t.length>n)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let c=new Uint8Array(n);c.set(t,o?0:c.length-t.length),t=c}if(t.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+t.length);let u=o?Uc(t):bi(t);if(s&&(u=Ui(u,a)),!r&&!this.isValid(u))throw new Error("invalid field element: outside of range 0..ORDER");return u}invertBatch(t){return tf(this,t)}cmov(t,r,i){return $u(i,"condition"),i?r:t}};Object.freeze(gp.prototype)});function tA(e){let t=e;if(typeof t!="function")throw new TypeError("Point must be a constructor");pn({Fp:t.Fp,Fn:t.Fn,fromAffine:t.fromAffine,fromBytes:t.fromBytes,fromHex:t.fromHex},{Fp:"object",Fn:"object",fromAffine:"function",fromBytes:"function",fromHex:"function"}),ef(t.Fp),ef(t.Fn)}function l0(e,t){let r=t.negate();return e?r:t}function uy(e,t){let r=tf(e.Fp,t.map(i=>i.Z));return t.map((i,n)=>e.fromAffine(i.toAffine(r[n])))}function rA(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function oy(e,t){rA(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e,o=Hc(e),a=BigInt(e);return{windows:r,windowSize:i,mask:o,maxNumber:n,shiftBy:a}}function JI(e,t,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:a}=r,s=Number(e&n),u=e>>a;s>i&&(s-=o,u+=rf);let c=t*i,l=c+Math.abs(s)-1,m=s===0,w=s<0,E=t%2!==0;return{nextN:u,offset:l,isZero:m,isNeg:w,isNegF:E,offsetF:c}}function z$(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,i)=>{if(!(r instanceof t))throw new Error("invalid point at index "+i)})}function K$(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,i)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+i)})}function sy(e){return iA.get(e)||1}function QI(e){if(e!==Vc)throw new Error("invalid wNAF")}function nA(e,t,r,i){let n=t,o=e.ZERO,a=e.ZERO;for(;r>Vc||i>Vc;)r&rf&&(o=o.add(n)),i&rf&&(a=a.add(n)),n=n.double(),r>>=rf,i>>=rf;return{p1:o,p2:a}}function oA(e,t,r){let i=e.Fn;z$(t,e),K$(r,i);let n=t.length,o=r.length;if(n!==o)throw new Error("arrays of points and scalars must have equal length");let a=e.ZERO,s=Xu(BigInt(n)),u=1;s>12?u=s-3:s>4?u=s-2:s>0&&(u=2);let c=Hc(u),l=new Array(Number(c)+1).fill(a),m=Math.floor((i.BITS-1)/u)*u,w=a;for(let E=m;E>=0;E-=u){l.fill(a);for(let M=0;M<o;M++){let D=r[M],L=Number(D>>BigInt(E)&c);l[L]=l[L].add(t[M])}let P=a;for(let M=l.length-1,D=a;M>0;M--)D=D.add(l[M]),P=P.add(D);if(w=w.add(P),E!==0)for(let M=0;M<u;M++)w=w.double()}return w}function eA(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return ef(t),t}else return jc(e,{isLE:r})}function aA(e,t,r={},i){if(i===void 0&&(i=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(let u of["p","n","h"]){let c=t[u];if(!(typeof c=="bigint"&&c>Vc))throw new Error(`CURVE.${u} must be positive bigint`)}let n=eA(t.p,r.Fp,i),o=eA(t.n,r.Fn,i),s=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let u of s)if(!n.isValid(t[u]))throw new Error(`CURVE.${u} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:n,Fn:o}}function mp(e,t){return function(i){let n=e(i);return{secretKey:n,publicKey:t(n)}}}var Vc,rf,ay,iA,vp,yp=Xr(()=>{v();Ju();Kc();Vc=BigInt(0),rf=BigInt(1);ay=new WeakMap,iA=new WeakMap;vp=class{constructor(t,r){Z(this,"BASE");Z(this,"ZERO");Z(this,"Fn");Z(this,"bits");this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,i=this.ZERO){let n=t;for(;r>Vc;)r&rf&&(i=i.add(n)),n=n.double(),r>>=rf;return i}precomputeWindow(t,r){let{windows:i,windowSize:n}=oy(r,this.bits),o=[],a=t,s=a;for(let u=0;u<i;u++){s=a,o.push(s);for(let c=1;c<n;c++)s=s.add(a),o.push(s);a=s.double()}return o}wNAF(t,r,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE,a=oy(t,this.bits);for(let s=0;s<a.windows;s++){let{nextN:u,offset:c,isZero:l,isNeg:m,isNegF:w,offsetF:E}=JI(i,s,a);i=u,l?o=o.add(l0(w,r[E])):n=n.add(l0(m,r[c]))}return QI(i),{p:n,f:o}}wNAFUnsafe(t,r,i,n=this.ZERO){let o=oy(t,this.bits);for(let a=0;a<o.windows&&i!==Vc;a++){let{nextN:s,offset:u,isZero:c,isNeg:l}=JI(i,a,o);if(i=s,!c){let m=r[u];n=n.add(l?m.negate():m)}}return QI(i),n}getPrecomputes(t,r,i){let n=ay.get(r);return n||(n=this.precomputeWindow(r,t),t!==1&&(typeof i=="function"&&(n=i(n)),ay.set(r,n))),n}cached(t,r,i){let n=sy(t);return this.wNAF(n,this.getPrecomputes(n,t,i),r)}unsafe(t,r,i,n){let o=sy(t);return o===1?this._unsafeLadder(t,r,n):this.wNAFUnsafe(o,this.getPrecomputes(o,t,i),r,n)}createCache(t,r){rA(r,this.bits),iA.set(t,r),ay.delete(t)}hasCache(t){return sy(t)!==1}}});function sA(e){if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw new Error("wrong u32 integer:"+e);return e}function V$(e){if(sA(e),e<=1)return 1;if(e>2147483648)throw new Error("nextPowerOfTwo overflow: result does not fit u32");return 1<<fy(e-1)+1>>>0}function fy(e){return sA(e),31-Math.clz32(e)}function uA(e,t,r,i,n){let o=e,a=r||((l,m)=>new Array(l).fill(m??o.ZERO)),s=l=>{if(Array.isArray(l))return!0;if(!ArrayBuffer.isView(l))return!1;let m=l;return typeof m.length=="number"&&typeof m.slice=="function"&&typeof m[Symbol.iterator]=="function"},u=(...l)=>{if(!l.length)return 0;for(let w of l)if(!s(w))throw new Error("poly: not polynomial: "+w);let m=l[0].length;for(let w=1;w<l.length;w++)if(l[w].length!==m)throw new Error(`poly: mismatched lengths ${m} vs ${l[w].length}`);if(n!==void 0&&m!==n)throw new Error(`poly: expected fixed length ${n}, got ${m}`);return m};function c(l,m,w=!1){let E=fy(m),P=w?t.brp(E):t.roots(E);for(let M=0;M<m;M++)if(o.eql(l,P[M]))return M;return-1}return{roots:t,create:a,length:n,extend:(l,m)=>{u(l);let w=a(m,o.ZERO);for(let E=0;E<Math.min(l.length,m);E++)w[E]=l[E];return w},degree:l=>{u(l);for(let m=l.length-1;m>=0;m--)if(!o.is0(l[m]))return m;return-1},add:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.add(l[P],m[P]);return E},sub:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.sub(l[P],m[P]);return E},dot:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.mul(l[P],m[P]);return E},mul:(l,m)=>{if(s(m)){let w=u(l,m);if(i){let E=i.direct(l,!1,!0),P=i.direct(m,!1,!0);for(let M=0;M<E.length;M++)E[M]=o.mul(E[M],P[M]);return i.inverse(E,!0,!1)}else{let E=a(w);for(let P=0;P<w;P++)for(let M=0;M<w;M++){let D=(P+M)%w;E[D]=o.add(E[D],o.mul(l[P],m[M]))}return E}}else{let w=a(u(l));for(let E=0;E<w.length;E++)w[E]=o.mul(l[E],m);return w}},convolve(l,m){let w=V$(l.length+m.length-1);return this.mul(this.extend(l,w),this.extend(m,w))},shift(l,m){let w=a(u(l));w[0]=l[0];for(let E=1,P=o.ONE;E<l.length;E++)P=o.mul(P,m),w[E]=o.mul(l[E],P);return w},clone:l=>{u(l);let m=a(l.length);for(let w=0;w<l.length;w++)m[w]=l[w];return m},eval:(l,m)=>{u(l,m);let w=o.ZERO;for(let E=0;E<l.length;E++)w=o.add(w,o.mul(l[E],m[E]));return w},monomial:{basis:(l,m)=>{let w=a(m),E=o.ONE;for(let P=0;P<m;P++)w[P]=E,E=o.mul(E,l);return w},eval:(l,m)=>{u(l);let w=o.ZERO;for(let E=l.length-1;E>=0;E--)w=o.add(o.mul(w,m),l[E]);return w}},lagrange:{basis:(l,m,w=!1,E)=>{let P=fy(m),M=E||(w?t.brp(P):t.roots(P)),D=a(m),L=c(l,m,w);if(L!==-1)return D[L]=o.ONE,D;let U=o.pow(l,BigInt(m)),K=o.mul(o.sub(U,o.ONE),o.inv(BigInt(m))),N=a(m);for(let F=0;F<m;F++)N[F]=o.sub(l,M[F]);let C=o.invertBatch(N);for(let F=0;F<m;F++)D[F]=o.mul(K,o.mul(M[F],C[F]));return D},eval(l,m,w=!1){u(l);let E=c(m,l.length,w);if(E!==-1)return l[E];let P=this.basis(m,l.length,w),M=o.ZERO;for(let D=0;D<l.length;D++)o.is0(l[D])||(M=o.add(M,o.mul(l[D],P[D])));return M}},vanishing(l){u(l);let m=a(l.length+1,o.ZERO);m[0]=o.ONE;for(let w of l){let E=o.neg(w);for(let P=m.length-1;P>0;P--)m[P]=o.add(o.mul(m[P],E),m[P-1]);m[0]=o.mul(m[0],E)}return m}}}var fA=Xr(()=>{v()});function nf(e,t){if(dn(e),dn(t),t<0||t>4)throw new Error("invalid I2OSP length: "+t);if(e<0||e>2**(8*t)-1)throw new Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let i=t-1;i>=0;i--)r[i]=e&255,e>>>=8;return new Uint8Array(r)}function Z$(e,t){let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e[i]^t[i];return r}function cA(e){if(!Yu(e)&&typeof e!="string")throw new Error("DST must be Uint8Array or ascii string");let t=typeof e=="string"?Fc(e):e;if(t.length===0)throw new Error("DST must be non-empty");return t}function W$(e,t,r,i){qt(e),dn(r),t=cA(t),t.length>255&&(t=i(kt(Fc("H2C-OVERSIZE-DST-"),t)));let{outputLen:n,blockLen:o}=i,a=Math.ceil(r/n);if(r>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");let s=kt(t,nf(t.length,1)),u=new Uint8Array(o),c=nf(r,2),l=new Array(a),m=i(kt(u,e,c,nf(0,1),s));l[0]=i(kt(m,nf(1,1),s));for(let E=1;E<a;E++){let P=[Z$(m,l[E-1]),nf(E+1,1),s];l[E]=i(kt(...P))}return kt(...l).slice(0,r)}function Y$(e,t,r,i,n){if(qt(e),dn(r),t=cA(t),t.length>255){let o=Math.ceil(2*i/8);t=n.create({dkLen:o}).update(Fc("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return n.create({dkLen:r}).update(e).update(nf(r,2)).update(t).update(nf(t.length,1)).digest()}function cy(e,t,r){pn(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:i,k:n,m:o,hash:a,expand:s,DST:u}=r;if(dn(a.outputLen,"valid hash"),qt(e),dn(t),t<1)throw new Error("hash_to_field: expected count >= 1");if(o<1)throw new Error("hash_to_field: expected m >= 1");let c=i.toString(2).length,l=Math.ceil((c+n)/8),m=t*o*l,w;if(s==="xmd")w=W$(e,u,m,a);else if(s==="xof")w=Y$(e,u,m,n,a);else if(s==="_internal_pass")w=e;else throw new Error('expand must be "xmd" or "xof"');let E=new Array(t);for(let P=0;P<t;P++){let M=new Array(o);for(let D=0;D<o;D++){let L=l*(D+P*o),U=w.subarray(L,L+l);M[D]=Ui(G$(U),i)}E[P]=M}return E}function lA(e,t){let r=t.map(i=>Array.from(i).reverse());return(i,n)=>{let[o,a,s,u]=r.map(m=>m.reduce((w,E)=>e.add(e.mul(w,i),E))),[c,l]=tf(e,[a,u],!0);return i=e.mul(o,c),n=e.mul(n,e.mul(s,l)),{x:i,y:n}}}function hA(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");let i=s=>Object.freeze({...s,DST:Yu(s.DST)?pp(s.DST):s.DST,...s.encodeDST===void 0?{}:{encodeDST:Yu(s.encodeDST)?pp(s.encodeDST):s.encodeDST}}),n=i(r);function o(s){return e.fromAffine(t(s))}function a(s){let u=s.clearCofactor();return u.equals(e.ZERO)?e.ZERO:(u.assertValidity(),u)}return Object.freeze({get defaults(){return i(n)},Point:e,hashToCurve(s,u){let c=Object.assign({},n,u),l=cy(s,2,c),m=o(l[0]),w=o(l[1]);return a(m.add(w))},encodeToCurve(s,u){let c=n.encodeDST?{DST:n.encodeDST}:{},l=Object.assign({},n,c,u),m=cy(s,1,l),w=o(m[0]);return a(w)},mapToCurve(s){if(n.m===1){if(typeof s!="bigint")throw new Error("expected bigint (m=1)");return a(o([s]))}if(!Array.isArray(s))throw new Error("expected array of bigints");for(let u of s)if(typeof u!="bigint")throw new Error("expected array of bigints");return a(o(s))},hashToScalar(s,u){let c=e.Fn.ORDER,l=Object.assign({},n,{p:c,m:1,DST:$$},u);return cy(s,1,l)[0][0]}})}var G$,$$,dA=Xr(()=>{v();Ju();Kc();G$=bi;$$="HashToScalar-"});function ly(e){pn(e,{name:"string",hash:"function"},{hashToScalar:"function",validatePoint:"function",parsePublicKey:"function",adjustScalar:"function",adjustPoint:"function",challenge:"function",adjustNonces:"function",adjustSecret:"function",adjustPublic:"function",adjustGroupCommitmentShare:"function",adjustDKG:"function"}),tA(e.Point);let{Point:t}=e,r=e.Fn===void 0?t.Fn:e.Fn,i=e.hash,n=e.hashToScalar===void 0?(q,W={DST:new Uint8Array})=>{let $=i(kt(W.DST,q));return r.create(r.isLE?Uc($):bi($))}:e.hashToScalar,o=xa(e.H1!==void 0?e.H1:e.name+"rho"),a=xa(e.H2!==void 0?e.H2:e.name+"chal"),s=xa(e.H3!==void 0?e.H3:e.name+"nonce"),u=xa(e.H4!==void 0?e.H4:e.name+"msg"),c=xa(e.H5!==void 0?e.H5:e.name+"com"),l=xa(e.HDKG!==void 0?e.HDKG:e.name+"dkg"),m=xa(e.HID!==void 0?e.HID:e.name+"id"),w=q=>n(q,{DST:o}),E=q=>n(q,{DST:a}),P=q=>n(q,{DST:s}),M=q=>i(kt(u,q)),D=q=>i(kt(c,q)),L=q=>n(q,{DST:l}),U=q=>n(q,{DST:m}),K=(q=ki)=>{let W=zc(q(c0(r.ORDER)),r.ORDER,r.isLE);return r.isLE?Uc(W):bi(W)},N=q=>q.toBytes(),C=q=>{let W=t.fromBytes(q);return e.validatePoint&&e.validatePoint(W),W},F=(q,W)=>({identifier:q,hiding:N(t.BASE.multiply(r.fromBytes(W.hiding))),binding:N(t.BASE.multiply(r.fromBytes(W.binding)))}),H=e.adjustPoint===void 0?q=>q:e.adjustPoint,z=q=>{if(!r.isValid(q)||r.is0(q))throw new Error("Invalid identifier "+q);return q},G=q=>Ia(r.toBytes(z(q))),B=q=>{let W=z(r.fromBytes(qc(q)));if(G(W)!==q)throw new Error("expected canonical identifier hex");return W},g={encode:(q,W)=>{let $=kt(N(q),r.toBytes(W));return e.adjustTx&&($=e.adjustTx.encode($)),$},decode:q=>{e.adjustTx&&(q=e.adjustTx.decode(q));let W=C(q.subarray(0,-r.BYTES)),$=r.fromBytes(q.subarray(-r.BYTES));return{R:W,z:$}}},O=(q=ki)=>{let W=K(q);e.adjustScalar&&(W=e.adjustScalar(W));let $=t.BASE.multiply(W);return{scalar:W,point:$}},y="roots are unavailable in FROST polynomial mode",f={info:{G:r.ZERO,oddFactor:r.ZERO,powerOfTwo:0},roots(){throw new Error(y)},brp(){throw new Error(y)},inverse(){throw new Error(y)},omega(){throw new Error(y)},clear(){}},d=uA(r,f),_=(q,W)=>oA(t,q,W),x=(q,W)=>{if(!W.length)throw new Error("empty coefficients");return d.monomial.eval(W,q)},b=(q,W)=>{let $="invalid parameters";if(!q.some(le=>r.eql(le,W)))throw new Error($);let ee=new Set(q);if(ee.size!==q.length)throw new Error($);if(!ee.has(W))throw new Error($);let se=r.ONE,ue=r.ONE;for(let le of q)r.eql(le,W)||(se=r.mul(se,le),ue=r.mul(ue,r.sub(le,W)));return r.div(se,ue)},p=(q,W)=>{let $=d.monomial.basis(q,W.length);return _(W,$)},I=(q,W,$,ee=ki)=>{bp(q);let se=W===void 0?K(ee):r.fromBytes(W);if(!$){$=[];for(let Ae=0;Ae<q.min-1;Ae++)$.push(K(ee))}if($.length!==q.min-1)throw new Error("wrong coefficients length");let ue=[se,...$],le=ue.map(Ae=>t.BASE.multiply(Ae));return{coefficients:ue,commitment:le,secret:se}},T={challenge:(q,W,$)=>L(kt(r.toBytes(q),N(W),N($))),compute(q,W,$,ee=ki){if(W.length<1)throw new Error("coefficients should have at least one element");let{point:se,scalar:ue}=O(ee),le=$[0],Ae=this.challenge(q,le,se),ge=r.add(ue,r.mul(W[0],Ae));return g.encode(se,ge)},validate(q,W,$){if(W.length<1)throw new Error("commitment should have at least one element");let{R:ee,z:se}=g.decode($),ue=C(W[0]),le=this.challenge(q,ue,ee);if(!ee.equals(t.BASE.multiply(se).subtract(ue.multiply(le))))throw new Error("invalid proof of knowledge")}},S={challenge:(q,W,$)=>e.challenge?e.challenge(q,W,$):E(kt(N(q),N(W),$)),sign(q,W,$=ki){let{point:ee,scalar:se}=O($),ue=t.BASE.multiply(W),le=this.challenge(ee,ue,q),Ae=r.add(se,r.mul(le,W));return[ee,Ae]},verify(q,W,$,ee){e.adjustPoint&&(ee=e.adjustPoint(ee)),e.adjustPoint&&(W=e.adjustPoint(W));let se=this.challenge(W,ee,q),ue=t.BASE.multiply($),le=ee.multiply(se),Ae=ue.subtract(le).subtract(W);return Ae.clearCofactor&&(Ae=Ae.clearCofactor()),t.ZERO.equals(Ae)}},R=(q,W,$)=>{if(!t.BASE.multiply($).equals(p(q,W)))throw new Error("invalid secret share")},Y={fromNumber(q){if(!Number.isSafeInteger(q))throw new Error("expected safe interger");return G(BigInt(q))},derive(q){if(typeof q!="string")throw new Error("wrong identifier string: "+q);return G(U(xa(q)))}},X=(q,W=ki)=>P(kt(W(32),r.toBytes(q))),ie=(q,W,$)=>{let ee=W.map(ye=>[ye.identifier,B(ye.identifier),C(ye.hiding),C(ye.binding)]);ee.sort((ye,Re)=>ye[1]<Re[1]?-1:ye[1]>Re[1]?1:0);let se=[];for(let[ye,Re,be,_e]of ee)se.push(r.toBytes(Re),N(be),N(_e));let ue=D(kt(...se)),le=kt(N(q),M($),ue),Ae={};for(let[ye,Re]of ee)Ae[ye]=w(kt(le,r.toBytes(Re)));let ge=[],ve=[];for(let[ye,Re,be,_e]of ee){if(t.ZERO.equals(be)||t.ZERO.equals(_e))throw new Error("infinity commitment");ge.push(be,_e),ve.push(r.ONE,Ae[ye])}let sr=_(ge,ve);return{identifiers:ee.map(ye=>ye[1]),groupCommitment:sr,bindingFactors:Ae}},ce=(q,W,$,ee)=>{let se=H(C(q)),ue=B(ee),{identifiers:le,groupCommitment:Ae,bindingFactors:ge}=ie(se,W,$),ve=ge[ee],sr=b(le,ue),xe=S.challenge(Ae,se,$);return{lambda:sr,challenge:xe,bindingFactor:ve,groupCommitment:Ae}};Object.freeze(Y);let pe={Identifier:Y,DKG:Object.freeze({round1:(q,W,$,ee=ki)=>{bp(W);let se=B(q),{coefficients:ue,commitment:le}=I(W,$,void 0,ee),Ae=T.compute(se,ue,le,ee),ge=le.map(N),ve={identifier:G(se),commitment:ge,proofOfKnowledge:Ae},sr={identifier:se,coefficients:ue,commitment:le.map(N),signers:{min:W.min,max:W.max},step:1};return{public:ve,secret:sr}},round2:(q,W)=>{if(W.length!==q.signers.max-1)throw new Error("wrong number of round1 packages");if(!q.coefficients||q.step===3)throw new Error("round3 package used in round2");let $={};for(let ee of W){if(ee.commitment.length!==q.signers.min)throw new Error("wrong number of commitments");let se=B(ee.identifier);if(se===q.identifier)throw new Error("duplicate id="+G(se));T.validate(se,ee.commitment,ee.proofOfKnowledge);for(let le of ee.commitment)C(le);if($[ee.identifier])throw new Error("Duplicate id="+se);let ue=r.toBytes(x(se,q.coefficients));$[ee.identifier]={identifier:G(q.identifier),signingShare:ue}}return q.step=2,$},round3:(q,W,$)=>{if(W.length!==q.signers.max-1)throw new Error("wrong length of round1 packages");if(!q.coefficients||q.step!==2)throw new Error("round2 package used in round3");if($.length!==W.length)throw new Error("wrong length of round2 packages");let ee={};for(let Re of W){if(!Re.identifier||!Re.commitment)throw new Error("wrong round1 share");ee[Re.identifier]={...Re}}for(let Re of $){if(!Re.identifier||!Re.signingShare)throw new Error("wrong round2 share");if(!ee[Re.identifier])throw new Error("round1 share for "+Re.identifier+" is missing");ee[Re.identifier].signingShare=Re.signingShare}if(Object.keys(ee).length!==W.length)throw new Error("mismatch identifiers between rounds");let se=r.ZERO;if(q.commitment.length!==q.signers.min)throw new Error("wrong commitments length");let ue=q.commitment.map(C),le=x(q.identifier,q.coefficients);R(q.identifier,ue,le);let Ae=ue.map(N),ge={[G(q.identifier)]:Ae};for(let Re in ee){let be=ee[Re];if(!be.signingShare||!be.commitment)throw new Error("mismatch identifiers");let _e=B(Re),Qi=r.fromBytes(be.signingShare),Be=be.commitment.map(C);R(q.identifier,Be,Qi),se=r.add(se,Qi);let ke=G(_e);if(ge[ke])throw new Error("duplicated id="+ke);ge[ke]=be.commitment}se=r.add(se,le);let ve=new Array(q.signers.min).fill(t.ZERO);for(let Re in ge){let be=ge[Re];if(be.length!==q.signers.min)throw new Error("wrong commitments length");for(let _e=0;_e<be.length;_e++)ve[_e]=ve[_e].add(C(be[_e]))}let sr=ve.map(N),xe={};for(let Re in ge)xe[Re]=N(p(B(Re),ve));let ye={public:{signers:{min:q.signers.min,max:q.signers.max},commitments:sr,verifyingShares:Object.fromEntries(Object.entries(xe).map(([Re,be])=>[Re,be.slice()]))},secret:{identifier:G(q.identifier),signingShare:r.toBytes(se)}};e.adjustDKG&&(ye=e.adjustDKG(ye));for(let Re=0;Re<q.coefficients.length;Re++)q.coefficients[Re]-=q.coefficients[Re];return delete q.coefficients,q.step=3,ye},clean(q){if(q.identifier-=q.identifier,q.coefficients)for(let W=0;W<q.coefficients.length;W++)q.coefficients[W]-=q.coefficients[W];q.step=3}}),trustedDealer(q,W,$,ee=ki){if(bp(q),W===void 0){W=[];for(let ve=1;ve<=q.max;ve++)W.push(Y.fromNumber(ve))}else if(!Array.isArray(W)||W.length!==q.max)throw new Error("identifiers should be array of "+q.max);let se={};for(let ve of W){let sr=B(ve);if(ve in se)throw new Error("duplicated id="+ve);se[ve]=sr}let ue=I(q,$,void 0,ee),le=ue.commitment.map(N),Ae={},ge={};for(let ve of W){let sr=x(se[ve],ue.coefficients);ge[ve]=N(t.BASE.multiply(sr)),Ae[ve]={identifier:ve,signingShare:r.toBytes(sr)}}return{public:{signers:{min:q.min,max:q.max},commitments:le,verifyingShares:ge},secretShares:Ae}},validateSecret(q,W){let $=B(q.identifier),ee=W.commitments.map(C),se=r.fromBytes(q.signingShare);R($,ee,se)},commit(q,W=ki){let $=r.fromBytes(q.signingShare),ee=X($,W),se=X($,W),ue={hiding:r.toBytes(ee),binding:r.toBytes(se)};return{nonces:ue,commitments:F(q.identifier,ue)}},signShare(q,W,$,ee,se){pA(W.signers,ee.length);let ue=r.fromBytes($.hiding),le=r.fromBytes($.binding);if(r.is0(ue)||r.is0(le))throw new Error("signing nonces already used");let Ae={identifier:q.identifier,hiding:N(t.BASE.multiply(ue)),binding:N(t.BASE.multiply(le))},ge=ee.find(Ce=>Ce.identifier===q.identifier);if(!ge)throw new Error("missing signer commitment");if(Ia(ge.hiding)!==Ia(Ae.hiding)||Ia(ge.binding)!==Ia(Ae.binding))throw new Error("incorrect signer commitment");e.adjustSecret&&(q=e.adjustSecret(q,W)),e.adjustPublic&&(W=e.adjustPublic(W));let ve=r.fromBytes(q.signingShare),{lambda:sr,challenge:xe,bindingFactor:ye,groupCommitment:Re}=ce(W.commitments[0],ee,se,q.identifier),be=e.adjustNonces?e.adjustNonces(Re,$):$,_e=e.adjustNonces?r.fromBytes(be.hiding):ue,Qi=e.adjustNonces?r.fromBytes(be.binding):le,Be=r.mul(r.mul(sr,ve),xe),ke=r.mul(Qi,ye),$s=r.toBytes(r.add(r.add(_e,ke),Be));return $.hiding.fill(0),$.binding.fill(0),$s},verifyShare(q,W,$,ee,se){e.adjustPublic&&(q=e.adjustPublic(q));let ue=W.find(Qi=>Qi.identifier===ee);if(!ue)throw new Error("cannot find identifier commitment");let le=C(q.verifyingShares[ee]),Ae=C(ue.hiding),ge=C(ue.binding),{lambda:ve,challenge:sr,bindingFactor:xe,groupCommitment:ye}=ce(q.commitments[0],W,$,ee),Re=Ae.add(ge.multiply(xe));e.adjustGroupCommitmentShare&&(Re=e.adjustGroupCommitmentShare(ye,Re));let be=t.BASE.multiply(r.fromBytes(se)),_e=Re.add(le.multiply(r.mul(sr,ve)));return be.equals(_e)},aggregate(q,W,$,ee){e.adjustPublic&&(q=e.adjustPublic(q));try{pA(q.signers,W.length)}catch{throw new Gc("aggregation failed",[])}let se=W.map(ge=>ge.identifier);if(se.length!==Object.keys(ee).length)throw new Gc("aggregation failed",[]);for(let ge of se)if(!(ge in ee)||!(ge in q.verifyingShares))throw new Gc("aggregation failed",[]);let ue=C(q.commitments[0]),{groupCommitment:le}=ie(ue,W,$),Ae=r.ZERO;for(let ge of se)Ae=r.add(Ae,r.fromBytes(ee[ge]));if(!S.verify($,le,Ae,ue)){let ge=[];for(let ve of se)this.verifyShare(q,W,$,ve,ee[ve])||ge.push(ve);throw new Gc("aggregation failed",ge)}return g.encode(le,Ae)},sign(q,W){let $=r.fromBytes(W);e.adjustScalar&&($=e.adjustScalar($));let[ee,se]=S.sign(q,$);return g.encode(ee,se)},verify(q,W,$){let ee=e.parsePublicKey?e.parsePublicKey($):C($),{R:se,z:ue}=g.decode(q);return S.verify(W,se,ue,ee)},combineSecret(q,W){if(bp(W),!Array.isArray(q)||q.length<W.min)throw new Error("wrong secret shares array");let $=[],ee={};for(let le of q){let Ae=B(le.identifier),ge=G(Ae);if(ee[ge])throw new Error("duplicated id="+ge);ee[ge]=!0,$.push([Ae,r.fromBytes(le.signingShare)])}let se=$.map(([le])=>le),ue=r.ZERO;for(let[le,Ae]of $)ue=r.add(ue,r.mul(Ae,b(se,le)));return r.toBytes(ue)},utils:Object.freeze({Fn:r,randomScalar:(q=ki)=>r.toBytes(O(q).scalar),generateSecretPolynomial:(q,W,$,ee)=>{let se=I(q,W,$,ee);return{...se,commitment:se.commitment.map(N)}}})};return Object.freeze(pe)}var bp,pA,Gc,gA=Xr(()=>{v();gs();Ju();yp();fA();Kc();bp=e=>{if(!Number.isSafeInteger(e.min)||!Number.isSafeInteger(e.max))throw new Error("Wrong signers info: min="+e.min+" max="+e.max);if(e.min<2||e.max<2||e.min>e.max)throw new Error("Wrong signers info: min="+e.min+" max="+e.max)},pA=(e,t)=>{if(t<e.min||t>e.max)throw new Error("Wrong number of commitments="+t)},Gc=class extends Error{constructor(r,i){super(r);Z(this,"cheaters");this.cheaters=i}}});var dy={};Q1(dy,{_HMAC:()=>h0,hmac:()=>hy});var h0,hy,_p=Xr(()=>{v();gs();h0=class{constructor(t,r){Z(this,"oHash");Z(this,"iHash");Z(this,"blockLen");Z(this,"outputLen");Z(this,"canXOF",!1);Z(this,"finished",!1);Z(this,"destroyed",!1);if(X2(t),Eo(r,void 0,"key"),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;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=t.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),Sa(n)}update(t){return Dc(this),this.iHash.update(t),this}digestInto(t){Dc(this),J2(t,this),this.finished=!0;let r=t.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:i,finished:n,destroyed:o,blockLen:a,outputLen:s}=this;return t=t,t.finished=n,t.destroyed=o,t.blockLen=a,t.outputLen=s,t.oHash=r._cloneInto(t.oHash),t.iHash=i._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},hy=(()=>{let e=((t,r,i)=>new h0(t,r).update(i).digest());return e.create=(t,r)=>new h0(t,r),e})()});function X$(e,t,r){ty("scalar",e,gn,r);let[[i,n],[o,a]]=t,s=vA(a*e,r),u=vA(-n*e,r),c=e-s*i-u*o,l=-s*n-u*a,m=c<gn,w=l<gn;m&&(c=-c),w&&(l=-l);let E=Hc(Math.ceil(Xu(r)/2))+Kr;if(c<gn||c>=E||l<gn||l>=E)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:m,k1:c,k2neg:w,k2:l}}function gy(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function py(e,t){pn(e);let r={};for(let i of Object.keys(t))r[i]=e[i]===void 0?t[i]:e[i];return $u(r.lowS,"lowS"),$u(r.prehash,"prehash"),r.format!==void 0&&gy(r.format),r}function mA(e,t={}){let r=aA("weierstrass",e,t),i=r.Fp,n=r.Fn,o=r.CURVE,{h:a,n:s}=o;pn(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:u,allowInfinityPoint:c}=t;if(u&&(!i.is0(o.a)||typeof u.beta!="bigint"||!Array.isArray(u.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let l=_A(i,n);function m(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function w(O,y,f){if(c&&y.is0())return Uint8Array.of(0);let{x:d,y:_}=y.toAffine(),x=i.toBytes(d);if($u(f,"isCompressed"),f){m();let b=!i.isOdd(_);return kt(yA(b),x)}else return kt(Uint8Array.of(4),x,i.toBytes(_))}function E(O){qt(O,void 0,"Point");let{publicKey:y,publicKeyUncompressed:f}=l,d=O.length,_=O[0],x=O.subarray(1);if(c&&d===1&&_===0)return{x:i.ZERO,y:i.ZERO};if(d===y&&(_===2||_===3)){let b=i.fromBytes(x);if(!i.isValid(b))throw new Error("bad point: is not on curve, wrong x");let p=D(b),I;try{I=i.sqrt(p)}catch(R){let Y=R instanceof Error?": "+R.message:"";throw new Error("bad point: is not on curve, sqrt error"+Y)}m();let T=i.isOdd(I);return(_&1)===1!==T&&(I=i.neg(I)),{x:b,y:I}}else if(d===f&&_===4){let b=i.BYTES,p=i.fromBytes(x.subarray(0,b)),I=i.fromBytes(x.subarray(b,b*2));if(!L(p,I))throw new Error("bad point: is not on curve");return{x:p,y:I}}else throw new Error(`bad point: got length ${d}, expected compressed=${y} or uncompressed=${f}`)}let P=t.toBytes===void 0?w:t.toBytes,M=t.fromBytes===void 0?E:t.fromBytes;function D(O){let y=i.sqr(O),f=i.mul(y,O);return i.add(i.add(f,i.mul(O,o.a)),o.b)}function L(O,y){let f=i.sqr(y),d=D(O);return i.eql(f,d)}if(!L(o.Gx,o.Gy))throw new Error("bad curve params: generator point");let U=i.mul(i.pow(o.a,Zc),my),K=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(U,K)))throw new Error("bad curve params: a or b");function N(O,y,f=!1){if(!i.isValid(y)||f&&i.is0(y))throw new Error(`bad point coordinate ${O}`);return y}function C(O){if(!(O instanceof z))throw new Error("Weierstrass Point expected")}function F(O){if(!u||!u.basises)throw new Error("no endo");return X$(O,u.basises,n.ORDER)}function H(O,y,f,d,_){return f=new z(i.mul(f.X,O),f.Y,f.Z),y=l0(d,y),f=l0(_,f),y.add(f)}let g=class g{constructor(y,f,d){Z(this,"X");Z(this,"Y");Z(this,"Z");this.X=N("x",y),this.Y=N("y",f,!0),this.Z=N("z",d),Object.freeze(this)}static CURVE(){return o}static fromAffine(y){let{x:f,y:d}=y||{};if(!y||!i.isValid(f)||!i.isValid(d))throw new Error("invalid affine point");if(y instanceof g)throw new Error("projective point not allowed");return i.is0(f)&&i.is0(d)?g.ZERO:new g(f,d,i.ONE)}static fromBytes(y){let f=g.fromAffine(M(qt(y,void 0,"point")));return f.assertValidity(),f}static fromHex(y){return g.fromBytes(qc(y))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(y=8,f=!0){return B.createCache(this,y),f||this.multiply(Zc),this}assertValidity(){let y=this;if(y.is0()){if(t.allowInfinityPoint&&i.is0(y.X)&&i.eql(y.Y,i.ONE)&&i.is0(y.Z))return;throw new Error("bad point: ZERO")}let{x:f,y:d}=y.toAffine();if(!i.isValid(f)||!i.isValid(d))throw new Error("bad point: x or y not field elements");if(!L(f,d))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(y)}equals(y){C(y);let{X:f,Y:d,Z:_}=this,{X:x,Y:b,Z:p}=y,I=i.eql(i.mul(f,p),i.mul(x,_)),T=i.eql(i.mul(d,p),i.mul(b,_));return I&&T}negate(){return new g(this.X,i.neg(this.Y),this.Z)}double(){let{a:y,b:f}=o,d=i.mul(f,Zc),{X:_,Y:x,Z:b}=this,p=i.ZERO,I=i.ZERO,T=i.ZERO,S=i.mul(_,_),R=i.mul(x,x),Y=i.mul(b,b),X=i.mul(_,x);return X=i.add(X,X),T=i.mul(_,b),T=i.add(T,T),p=i.mul(y,T),I=i.mul(d,Y),I=i.add(p,I),p=i.sub(R,I),I=i.add(R,I),I=i.mul(p,I),p=i.mul(X,p),T=i.mul(d,T),Y=i.mul(y,Y),X=i.sub(S,Y),X=i.mul(y,X),X=i.add(X,T),T=i.add(S,S),S=i.add(T,S),S=i.add(S,Y),S=i.mul(S,X),I=i.add(I,S),Y=i.mul(x,b),Y=i.add(Y,Y),S=i.mul(Y,X),p=i.sub(p,S),T=i.mul(Y,R),T=i.add(T,T),T=i.add(T,T),new g(p,I,T)}add(y){C(y);let{X:f,Y:d,Z:_}=this,{X:x,Y:b,Z:p}=y,I=i.ZERO,T=i.ZERO,S=i.ZERO,R=o.a,Y=i.mul(o.b,Zc),X=i.mul(f,x),ie=i.mul(d,b),ce=i.mul(_,p),pe=i.add(f,d),q=i.add(x,b);pe=i.mul(pe,q),q=i.add(X,ie),pe=i.sub(pe,q),q=i.add(f,_);let W=i.add(x,p);return q=i.mul(q,W),W=i.add(X,ce),q=i.sub(q,W),W=i.add(d,_),I=i.add(b,p),W=i.mul(W,I),I=i.add(ie,ce),W=i.sub(W,I),S=i.mul(R,q),I=i.mul(Y,ce),S=i.add(I,S),I=i.sub(ie,S),S=i.add(ie,S),T=i.mul(I,S),ie=i.add(X,X),ie=i.add(ie,X),ce=i.mul(R,ce),q=i.mul(Y,q),ie=i.add(ie,ce),ce=i.sub(X,ce),ce=i.mul(R,ce),q=i.add(q,ce),X=i.mul(ie,q),T=i.add(T,X),X=i.mul(W,q),I=i.mul(pe,I),I=i.sub(I,X),X=i.mul(pe,ie),S=i.mul(W,S),S=i.add(S,X),new g(I,T,S)}subtract(y){return C(y),this.add(y.negate())}is0(){return this.equals(g.ZERO)}multiply(y){let{endo:f}=t;if(!n.isValidNot0(y))throw new RangeError("invalid scalar: out of range");let d,_,x=b=>B.cached(this,b,p=>uy(g,p));if(f){let{k1neg:b,k1:p,k2neg:I,k2:T}=F(y),{p:S,f:R}=x(p),{p:Y,f:X}=x(T);_=R.add(X),d=H(f.beta,S,Y,b,I)}else{let{p:b,f:p}=x(y);d=b,_=p}return uy(g,[d,_])[0]}multiplyUnsafe(y){let{endo:f}=t,d=this,_=y;if(!n.isValid(_))throw new RangeError("invalid scalar: out of range");if(_===gn||d.is0())return g.ZERO;if(_===Kr)return d;if(B.hasCache(this))return this.multiply(_);if(f){let{k1neg:x,k1:b,k2neg:p,k2:I}=F(_),{p1:T,p2:S}=nA(g,d,b,I);return H(f.beta,T,S,x,p)}else return B.unsafe(d,_)}toAffine(y){let f=this,d=y,{X:_,Y:x,Z:b}=f;if(i.eql(b,i.ONE))return{x:_,y:x};let p=f.is0();d==null&&(d=p?i.ONE:i.inv(b));let I=i.mul(_,d),T=i.mul(x,d),S=i.mul(b,d);if(p)return{x:i.ZERO,y:i.ZERO};if(!i.eql(S,i.ONE))throw new Error("invZ was invalid");return{x:I,y:T}}isTorsionFree(){let{isTorsionFree:y}=t;return a===Kr?!0:y?y(g,this):B.unsafe(this,s).is0()}clearCofactor(){let{clearCofactor:y}=t;return a===Kr?this:y?y(g,this):this.multiplyUnsafe(a)}isSmallOrder(){return a===Kr?this.is0():this.clearCofactor().is0()}toBytes(y=!0){return $u(y,"isCompressed"),this.assertValidity(),P(g,this,y)}toHex(y=!0){return Ia(this.toBytes(y))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}};Z(g,"BASE",new g(o.Gx,o.Gy,i.ONE)),Z(g,"ZERO",new g(i.ZERO,i.ONE,i.ZERO)),Z(g,"Fp",i),Z(g,"Fn",n);let z=g,G=n.BITS,B=new vp(z,t.endo?Math.ceil(G/2):G);return G>=8&&z.BASE.precompute(8),Object.freeze(z.prototype),Object.freeze(z),z}function yA(e){return Uint8Array.of(e?2:3)}function J$(e,t){let r=ef(e),i=r.ORDER,n=gn;for(let M=i-Kr;M%Io===gn;M/=Io)n+=Kr;let o=n,a=Io<<o-Kr-Kr,s=a*Io,u=(i-Kr)/s,c=(u-Kr)/Io,l=s-Kr,m=a,w=r.pow(t,u),E=r.pow(t,(u+Kr)/Io),P=(M,D)=>{let L=w,U=r.pow(D,l),K=r.sqr(U);K=r.mul(K,D);let N=r.mul(M,K);N=r.pow(N,c),N=r.mul(N,U),U=r.mul(N,D),K=r.mul(N,M);let C=r.mul(K,U);N=r.pow(C,m);let F=r.eql(N,r.ONE);U=r.mul(K,E),N=r.mul(C,L),K=r.cmov(U,K,F),C=r.cmov(N,C,F);for(let H=o;H>Kr;H--){let z=H-Io;z=Io<<z-Kr;let G=r.pow(C,z),B=r.eql(G,r.ONE);U=r.mul(K,L),L=r.mul(L,L),G=r.mul(C,L),K=r.cmov(U,K,B),C=r.cmov(G,C,B)}return{isValid:!r.is0(D)&&(F||r.is0(M)),value:K}};if(r.ORDER%my===Zc){let M=(r.ORDER-Zc)/my,D=r.sqrt(r.neg(t));P=(L,U)=>{let K=r.sqr(U),N=r.mul(L,U);K=r.mul(K,N);let C=r.pow(K,M);C=r.mul(C,N);let F=r.mul(C,D),H=r.mul(r.sqr(C),U),z=r.eql(H,L),G=r.cmov(F,C,z);return{isValid:!r.is0(U)&&z,value:G}}}return P}function bA(e,t){let r=ef(e),{A:i,B:n,Z:o}=t;if(!r.isValidNot0(i)||!r.isValidNot0(n)||!r.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");if(r.eql(o,r.neg(r.ONE))||ny(r,o))throw new Error("mapToCurveSimpleSWU: invalid opts");let a=r.mul(n,r.inv(r.mul(o,i))),s=r.add(r.add(r.mul(r.sqr(a),a),r.mul(i,a)),n);if(!ny(r,s))throw new Error("mapToCurveSimpleSWU: invalid opts");let u=J$(r,o);if(!r.isOdd)throw new Error("Field does not have .isOdd()");return c=>{let l,m,w,E,P,M,D,L;l=r.sqr(c),l=r.mul(l,o),m=r.sqr(l),m=r.add(m,l),w=r.add(m,r.ONE),w=r.mul(w,n),E=r.cmov(o,r.neg(m),!r.eql(m,r.ZERO)),E=r.mul(E,i),m=r.sqr(w),M=r.sqr(E),P=r.mul(M,i),m=r.add(m,P),m=r.mul(m,w),M=r.mul(M,E),P=r.mul(M,n),m=r.add(m,P),D=r.mul(l,w);let{isValid:U,value:K}=u(m,M);L=r.mul(l,c),L=r.mul(L,K),D=r.cmov(D,w,U),L=r.cmov(L,K,U);let N=r.isOdd(c)===r.isOdd(L);L=r.cmov(r.neg(L),L,N);let C=tf(r,[E],!0)[0];return D=r.mul(D,C),{x:D,y:L}}}function _A(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Q$(e,t={}){let{Fn:r}=e,i=t.randomBytes===void 0?ki:t.randomBytes,n=Object.assign(_A(e.Fp,r),{seed:Math.max(c0(r.ORDER),16)});function o(E){try{let P=r.fromBytes(E);return r.isValidNot0(P)}catch{return!1}}function a(E,P){let{publicKey:M,publicKeyUncompressed:D}=n;try{let L=E.length;return P===!0&&L!==M||P===!1&&L!==D?!1:!!e.fromBytes(E)}catch{return!1}}function s(E){return E=E===void 0?i(n.seed):E,zc(qt(E,n.seed,"seed"),r.ORDER)}function u(E,P=!0){return e.BASE.multiply(r.fromBytes(E)).toBytes(P)}function c(E){let{secretKey:P,publicKey:M,publicKeyUncompressed:D}=n,L=r._lengths;if(!Yu(E))return;let U=qt(E,void 0,"key").length,K=U===M||U===D,N=U===P||!!L?.includes(U);if(!(K&&N))return K}function l(E,P,M=!0){if(c(E)===!0)throw new Error("first arg must be private key");if(c(P)===!1)throw new Error("second arg must be public key");let D=r.fromBytes(E);return e.fromBytes(P).multiply(D).toBytes(M)}let m={isValidSecretKey:o,isValidPublicKey:a,randomSecretKey:s},w=mp(s,u);return Object.freeze(m),Object.freeze(n),Object.freeze({getPublicKey:u,getSharedSecret:l,keygen:w,Point:e,utils:m,lengths:n})}function wA(e,t,r={}){let i=t;X2(i),pn(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes===void 0?ki:r.randomBytes,o=r.hmac===void 0?(d,_)=>hy(i,d,_):r.hmac,{Fp:a,Fn:s}=e,{ORDER:u,BITS:c}=s,{keygen:l,getPublicKey:m,getSharedSecret:w,utils:E,lengths:P}=Q$(e,r),M={prehash:!0,lowS:typeof r.lowS=="boolean"?r.lowS:!0,format:"compact",extraEntropy:!1},D=u*Io+Kr<a.ORDER;function L(d){let _=u>>Kr;return d>_}function U(d,_){if(!s.isValidNot0(_))throw new Error(`invalid signature ${d}: out of range 1..Point.Fn.ORDER`);return _}function K(){if(D)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function N(d,_){gy(_);let x=P.signature,b=_==="compact"?x:_==="recovered"?x+1:void 0;return qt(d,b)}class C{constructor(_,x,b){Z(this,"r");Z(this,"s");Z(this,"recovery");if(this.r=U("r",_),this.s=U("s",x),b!=null){if(K(),![0,1,2,3].includes(b))throw new Error("invalid recovery id");this.recovery=b}Object.freeze(this)}static fromBytes(_,x=M.format){N(_,x);let b;if(x==="der"){let{r:S,s:R}=Hn.toSig(qt(_));return new C(S,R)}x==="recovered"&&(b=_[0],x="compact",_=_.subarray(1));let p=P.signature/2,I=_.subarray(0,p),T=_.subarray(p,p*2);return new C(s.fromBytes(I),s.fromBytes(T),b)}static fromHex(_,x){return this.fromBytes(qc(_),x)}assertRecovery(){let{recovery:_}=this;if(_==null)throw new Error("invalid recovery id: must be present");return _}addRecoveryBit(_){return new C(this.r,this.s,_)}recoverPublicKey(_){let{r:x,s:b}=this,p=this.assertRecovery(),I=p===2||p===3?x+u:x;if(!a.isValid(I))throw new Error("invalid recovery id: sig.r+curve.n != R.x");let T=a.toBytes(I),S=e.fromBytes(kt(yA((p&1)===0),T)),R=s.inv(I),Y=H(qt(_,void 0,"msgHash")),X=s.create(-Y*R),ie=s.create(b*R),ce=e.BASE.multiplyUnsafe(X).add(S.multiplyUnsafe(ie));if(ce.is0())throw new Error("invalid recovery: point at infinify");return ce.assertValidity(),ce}hasHighS(){return L(this.s)}toBytes(_=M.format){if(gy(_),_==="der")return qc(Hn.hexFromSig(this));let{r:x,s:b}=this,p=s.toBytes(x),I=s.toBytes(b);return _==="recovered"?(K(),kt(Uint8Array.of(this.assertRecovery()),p,I)):kt(p,I)}toHex(_){return Ia(this.toBytes(_))}}Object.freeze(C.prototype),Object.freeze(C);let F=r.bits2int===void 0?function(_){if(_.length>8192)throw new Error("input is too large");let x=bi(_),b=_.length*8-c;return b>0?x>>BigInt(b):x}:r.bits2int,H=r.bits2int_modN===void 0?function(_){return s.create(F(_))}:r.bits2int_modN,z=Hc(c);function G(d){return ty("num < 2^"+c,d,gn,z),s.toBytes(d)}function B(d,_){return qt(d,void 0,"message"),_?qt(i(d),void 0,"prehashed message"):d}function g(d,_,x){let{lowS:b,prehash:p,extraEntropy:I}=py(x,M);d=B(d,p);let T=H(d),S=s.fromBytes(_);if(!s.isValidNot0(S))throw new Error("invalid private key");let R=[G(S),G(T)];if(I!=null&&I!==!1){let ce=I===!0?n(P.secretKey):I;R.push(qt(ce,void 0,"extraEntropy"))}let Y=kt(...R),X=T;function ie(ce){let pe=F(ce);if(!s.isValidNot0(pe))return;let q=s.inv(pe),W=e.BASE.multiply(pe).toAffine(),$=s.create(W.x);if($===gn)return;let ee=s.create(q*s.create(X+$*S));if(ee===gn)return;let se=(W.x===$?0:2)|Number(W.y&Kr),ue=ee;return b&&L(ee)&&(ue=s.neg(ee),se^=1),new C($,ue,D?void 0:se)}return{seed:Y,k2sig:ie}}function O(d,_,x={}){let{seed:b,k2sig:p}=g(d,_,x);return HI(i.outputLen,s.BYTES,o)(b,p).toBytes(x.format)}function y(d,_,x,b={}){let{lowS:p,prehash:I,format:T}=py(b,M);if(x=qt(x,void 0,"publicKey"),_=B(_,I),!Yu(d)){let S=d instanceof C?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+S)}N(d,T);try{let S=C.fromBytes(d,T),R=e.fromBytes(x);if(p&&S.hasHighS())return!1;let{r:Y,s:X}=S,ie=H(_),ce=s.inv(X),pe=s.create(ie*ce),q=s.create(Y*ce),W=e.BASE.multiplyUnsafe(pe).add(R.multiplyUnsafe(q));return W.is0()?!1:s.create(W.x)===Y}catch{return!1}}function f(d,_,x={}){let{prehash:b}=py(x,M);return _=B(_,b),C.fromBytes(d,"recovered").recoverPublicKey(_).toBytes()}return Object.freeze({keygen:l,getPublicKey:m,getSharedSecret:w,utils:E,lengths:P,Point:e,sign:O,verify:y,recoverPublicKey:f,Signature:C,hash:i})}var vA,vy,Hn,gn,Kr,Io,Zc,my,SA=Xr(()=>{v();_p();gs();Ju();yp();Kc();vA=(e,t)=>(e+(e>=0?t:-t)/Io)/t;vy=class extends Error{constructor(t=""){super(t)}},Hn={Err:vy,_tlv:{encode:(e,t)=>{let{Err:r}=Hn;if(dn(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if(typeof t!="string")throw new TypeError('"data" expected string, got type='+typeof t);if(t.length&1)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=f0(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?f0(n.length/2|128):"";return f0(e)+o+n+t},decode(e,t){let{Err:r}=Hn;t=qt(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[i++],o=!!(n&128),a=0;if(!o)a=n;else{let u=n&127;if(!u)throw new r("tlv.decode(long): indefinite length not supported");if(u>4)throw new r("tlv.decode(long): byte length is too big");let c=t.subarray(i,i+u);if(c.length!==u)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let l of c)a=a<<8|l;if(i+=u,a<128)throw new r("tlv.decode(long): not minimal encoding")}let s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){let{Err:t}=Hn;if(hp(e),e<gn)throw new t("integer: negative integers are not allowed");let r=f0(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Hn;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return bi(e)}},toSig(e){let{Err:t,_int:r,_tlv:i}=Hn,n=qt(e,void 0,"signature"),{v:o,l:a}=i.decode(48,n);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:s,l:u}=i.decode(2,o),{v:c,l}=i.decode(2,u);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(s),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=Hn,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s)),o=i+n;return t.encode(48,o)}};Object.freeze(Hn._tlv);Object.freeze(Hn._int);Object.freeze(Hn);gn=BigInt(0),Kr=BigInt(1),Io=BigInt(2),Zc=BigInt(3),my=BigInt(4)});var p0={};Q1(p0,{__TEST:()=>nX,schnorr:()=>oX,schnorr_FROST:()=>hX,secp256k1:()=>rX,secp256k1_FROST:()=>uX,secp256k1_hasher:()=>_y});function tX(e){let t=wp.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,m=Fi(l,r,t)*l%t,w=Fi(m,r,t)*l%t,E=Fi(w,yy,t)*c%t,P=Fi(E,n,t)*E%t,M=Fi(P,o,t)*P%t,D=Fi(M,s,t)*M%t,L=Fi(D,u,t)*D%t,U=Fi(L,s,t)*M%t,K=Fi(U,r,t)*l%t,N=Fi(K,a,t)*P%t,C=Fi(N,i,t)*c%t,F=Fi(C,yy,t);if(!Aa.eql(Aa.sqr(F),e))throw new Error("Cannot find square root");return F}function d0(e,...t){let r=xA[e];if(r===void 0){let i=bs(Fc(e));r=kt(i,i),xA[e]=r}return bs(kt(r,...t))}function AA(e){let{Fn:t,BASE:r}=Ut,i=t.fromBytes(e),n=r.multiply(i);return{scalar:Ao(n.y)?i:t.neg(i),bytes:of(n)}}function Sp(e){let t=Aa;if(!t.isValidNot0(e))throw new Error("invalid x: Fail if x \u2265 p");let r=t.create(e*e),i=t.create(r*e+BigInt(7)),n=t.sqrt(i);Ao(n)||(n=t.neg(n));let o=Ut.fromAffine({x:e,y:n});return o.assertValidity(),o}function by(...e){return Ut.Fn.create(Wc(d0("BIP0340/challenge",...e)))}function EA(e){return AA(e).bytes}function iX(e,t,r=o0(32)){let{Fn:i,BASE:n}=Ut,o=qt(e,void 0,"message"),{bytes:a,scalar:s}=AA(t),u=qt(r,32,"auxRand"),c=i.toBytes(s^Wc(d0("BIP0340/aux",u))),l=d0("BIP0340/nonce",c,a,o),m=i.create(Wc(l));if(m===0n)throw new Error("sign failed: k is zero");let w=n.multiply(m),E=Ao(w.y)?m:i.neg(m),P=of(w),M=by(P,a,o),D=new Uint8Array(64);if(D.set(P,0),D.set(i.toBytes(i.create(E+M*s)),32),!PA(D,o,a))throw new Error("sign: Invalid signature produced");return D}function PA(e,t,r){let{Fp:i,Fn:n,BASE:o}=Ut,a=qt(e,64,"signature"),s=qt(t,void 0,"message"),u=qt(r,32,"publicKey");try{let c=Sp(Wc(u)),l=Wc(a.subarray(0,32));if(!i.isValidNot0(l))return!1;let m=Wc(a.subarray(32,64));if(!n.isValidNot0(m))return!1;let w=by(n.toBytes(l),of(c),s),E=o.multiplyUnsafe(m).add(c.multiplyUnsafe(n.neg(w))),{x:P,y:M}=E.toAffine();return!(E.is0()||!Ao(M)||P!==l)}catch{return!1}}function TA(e,t){if(t===void 0)return IA;let r=of(e),i=bi(d0("TapTweak",r,t));if(!Ut.Fn.isValid(i))throw new Error("invalid TapTweak hash");return i}function wy(e){let t=Ut.fromBytes(e.commitments[0]);return Ao(t.y)?e:{signers:{min:e.signers.min,max:e.signers.max},commitments:e.commitments.map(r=>Ut.fromBytes(r).negate().toBytes()),verifyingShares:Object.fromEntries(Object.entries(e.verifyingShares).map(([r,i])=>[r,Ut.fromBytes(i).negate().toBytes()]))}}function kA(e,t){let r=Ut.fromBytes(t.commitments[0]);if(Ao(r.y))return e;let i=Ut.Fn;return{...e,signingShare:i.toBytes(i.neg(i.fromBytes(e.signingShare)))}}function fX(e,t){if(Ao(e.y))return t;let r=Ut.Fn;return{binding:r.toBytes(r.neg(r.fromBytes(t.binding))),hiding:r.toBytes(r.neg(r.fromBytes(t.hiding)))}}function cX(e,t,r){let i=Ut.Fn,n=kA(e,t),o=wy(t),a=TA(Ut.fromBytes(o.commitments[0]),r),s=i.toBytes(i.add(i.fromBytes(n.signingShare),a));return{identifier:n.identifier,signingShare:s}}function lX(e,t){let r=wy(e),i=TA(Ut.fromBytes(r.commitments[0]),t),n=Ut.BASE.multiply(i),o=r.commitments.map((s,u)=>(u===0?Ut.fromBytes(s).add(n):Ut.fromBytes(s)).toBytes()),a={};for(let s in r.verifyingShares)a[s]=Ut.fromBytes(r.verifyingShares[s]).add(n).toBytes();return{signers:{min:r.signers.min,max:r.signers.max},commitments:o,verifyingShares:a}}var wp,eX,IA,yy,Aa,Ut,rX,xA,of,Ao,Wc,nX,oX,aX,OA,sX,_y,uX,hX,g0=Xr(()=>{v();fp();gs();yp();gA();dA();Kc();SA();Ju();wp={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},eX={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},IA=BigInt(0),yy=BigInt(2);Aa=jc(wp.p,{sqrt:tX}),Ut=mA(wp,{Fp:Aa,endo:eX}),rX=wA(Ut,bs),xA={};of=e=>e.toBytes(!0).slice(1),Ao=e=>e%yy===IA;Wc=bi;nX=Object.freeze({lift_x:Sp}),oX=(()=>{let r=i=>(i=i===void 0?o0(48):i,zc(i,wp.n));return Object.freeze({keygen:mp(r,EA),getPublicKey:EA,sign:iX,verify:PA,Point:Ut,utils:Object.freeze({randomSecretKey:r,taggedHash:d0,lift_x:Sp,pointToBytes:of}),lengths:Object.freeze({secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48})})})(),aX=lA(Aa,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),sX=()=>OA||(OA=bA(Aa,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Aa.create(BigInt("-11"))})),_y=hA(Ut,e=>{let{x:t,y:r}=sX()(Aa.create(e[0]));return aX(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Aa.ORDER,m:1,k:128,expand:"xmd",hash:bs}),uX=ly({name:"FROST-secp256k1-SHA256-v1",Point:Ut,hashToScalar:_y.hashToScalar,hash:bs});hX=ly({name:"FROST-secp256k1-SHA256-TR-v1",Point:Ut,hashToScalar:_y.hashToScalar,hash:bs,parsePublicKey(e){if(e.length===32)return Sp(bi(e));if(e.length===33)return Ut.fromBytes(e);throw new Error(`expected x-only or compressed public key, got length=${e.length}`)},adjustScalar(e){let t=Ut.BASE.multiply(e);return Ao(t.y)?e:Ut.Fn.neg(e)},adjustPoint:e=>Ao(e.y)?e:e.negate(),challenge(e,t,r){return by(of(e),of(t),r)},adjustNonces:fX,adjustGroupCommitmentShare:(e,t)=>Ao(e.y)?t:t.negate(),adjustPublic:wy,adjustSecret:kA,adjustTx:{encode:e=>e.subarray(1),decode:e=>kt(Uint8Array.of(2),e)},adjustDKG:e=>{let t=new Uint8Array(0);return{public:lX(e.public,t),secret:cX(e.secret,e.public,t)}}})});var vn=k((v2e,NA)=>{"use strict";v();var RA=fr(),{secp256k1:dX}=(g0(),lo(p0)),m0=dX.Point,xp=m0.Fn.ORDER;function pX(e){return BigInt("0x"+(e.toString(16)||"0"))}function Sy(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new RA(t,16)}function Ep(e){if(e==null)throw new Error("Invalid Point");if(typeof e=="bigint")return e;if(typeof e=="number")return BigInt(e);if(typeof e=="string")return BigInt(e.indexOf("0x")===0?e:"0x"+e);if(typeof e.toString=="function")return pX(e);throw new Error("Invalid Point")}function v0(e){var t=Object.create(Ft.prototype);return t._p=e,t}function BA(e,t){var r=Ep(t).toString(16).padStart(64,"0");return m0.fromHex((e?"03":"02")+r)}function MA(e,t){var r;try{r=BA((t&1n)===1n,e)}catch{throw new Error("Point does not lie on the curve")}if(r.toAffine().y!==t)throw new Error("Invalid y value for curve.")}function Ft(e,t,r){if(!(this instanceof Ft))return new Ft(e,t,r);var i,n;try{i=Ep(e),n=Ep(t)}catch{throw new Error("Invalid Point")}MA(i,n);try{this._p=m0.fromAffine({x:i,y:n})}catch{throw new Error("Invalid Point")}return this}Ft.fromX=function(t,r){try{var i=v0(BA(t,r))}catch{throw new Error("Invalid X")}return i.validate(),i};Ft.getG=function(){return v0(m0.BASE)};Ft.getN=function(){return Sy(xp)};Ft.prototype.getX=function(){return Sy(this._p.toAffine().x)};Ft.prototype.getY=function(){return Sy(this._p.toAffine().y)};Object.defineProperty(Ft.prototype,"x",{configurable:!0,enumerable:!0,get:function(){return this.getX()}});Object.defineProperty(Ft.prototype,"y",{configurable:!0,enumerable:!0,get:function(){return this.getY()}});Ft.prototype.mul=function(t){var r=(Ep(t)%xp+xp)%xp;return r===0n||this._p.is0()?v0(m0.ZERO):v0(this._p.multiply(r))};Ft.prototype.add=function(t){return v0(this._p.add(t._p))};Ft.prototype.mulAdd=function(t,r,i){return this.mul(t).add(r.mul(i))};Ft.prototype.eq=function(t){return this._p.equals(t._p)};Ft.prototype.isInfinity=function(){return this._p.is0()};Ft.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var t=this._p.toAffine();return MA(t.x,t.y),this};Ft.pointToCompressed=function(t){var r=t.getX().toBuffer({size:32}),i=t.getY().toBuffer({size:32}),n,o=i[i.length-1]%2;return o?n=h.Buffer.from([3]):n=h.Buffer.from([2]),h.Buffer.concat([n,r])};Ft.pointFromCompressed=function(e){if(e.length!==33)throw new Error("invalid buffer length");var t=e[0],r;if(t===3)r=!0;else if(t===2)r=!1;else throw new Error("invalid value of compressed prefix");var i=RA.fromBuffer(e.slice(1,33));return Ft.fromX(r,i)};Ft.prototype.toBuffer=function(){return Ft.pointToCompressed(this)};Ft.prototype.toHex=function(){return this.toBuffer().toString("hex")};Ft.fromBuffer=function(e){return Ft.pointFromCompressed(e)};Ft.fromHex=function(e){return Ft.fromBuffer(h.Buffer.from(e,"hex"))};NA.exports=Ft});var pi=k((y2e,LA)=>{"use strict";v();var DA=xt(),gX=Bt(),CA=function(t){return DA.isString(t)?/^[0-9a-fA-F]+$/.test(t):!1};LA.exports={isValidJSON:function(t){var r;if(!DA.isString(t))return!1;try{r=JSON.parse(t)}catch{return!1}return typeof r=="object"},isHexa:CA,isHexaString:CA,defineImmutable:function(t,r){return Object.keys(r).forEach(function(i){Object.defineProperty(t,i,{configurable:!1,enumerable:!0,value:r[i]})}),t},isNaturalNumber:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&t>=0},integerAsBuffer:function(t){gX.checkArgumentType(t,"number","integer");let r=h.Buffer.allocUnsafe(4);return r.writeUInt32BE(t,0),r}}});var Vr=k((_2e,UA)=>{"use strict";v();var af=fr(),vX=xt(),_i=Bt(),mX=pi(),mt=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof af)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};mt.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=typeof e.i<"u"?e.i:this.i,this.compressed=typeof e.compressed<"u"?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this};mt.fromCompact=function(e){_i.checkArgument(h.Buffer.isBuffer(e),"Argument is expected to be a Buffer");var t=new mt,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i=i+4);var n=e.slice(1,33),o=e.slice(33,65);return _i.checkArgument(i===0||i===1||i===2||i===3,new Error("i must be 0, 1, 2, or 3")),_i.checkArgument(n.length===32,new Error("r must be 32 bytes")),_i.checkArgument(o.length===32,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=af.fromBuffer(n),t.s=af.fromBuffer(o),t};mt.fromDER=mt.fromBuffer=function(e,t){var r=mt.parseDER(e,t),i=new mt;return i.r=r.r,i.s=r.s,i};mt.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=mt.fromDER(r,!1);return i.nhashtype=t,i};mt.fromString=function(e){var t=h.Buffer.from(e,"hex");return mt.fromDER(t)};function qA(e,t){_i.checkArgument(t.length>0,new Error("Length of "+e+" is zero")),_i.checkArgument(!(t[0]&128),new Error("Value of "+e+" is negative")),_i.checkArgument(!(t.length>1&&t[0]===0&&!(t[1]&128)),new Error("Value of "+e+" is excessively padded"))}mt.parseDER=function(e,t){_i.checkArgument(h.Buffer.isBuffer(e),new Error("DER formatted signature should be a buffer")),vX.isUndefined(t)&&(t=!0);var r=e[0];_i.checkArgument(r===48,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;_i.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i<n?i:n;var o=e[2];_i.checkArgument(o===2,new Error("Integer byte for r should be 0x02"));var a=e[3],s=e.slice(4,4+a),u=af.fromBuffer(s),c=e[4]===0;_i.checkArgument(a===s.length,new Error("Length of r incorrect"));var l=e[4+a+0];_i.checkArgument(l===2,new Error("Integer byte for s should be 0x02"));var m=e[4+a+1],w=e.slice(4+a+2,4+a+2+m),E=af.fromBuffer(w),P=e[4+a+2]===0;_i.checkArgument(m===w.length,new Error("Length of s incorrect"));var M=4+a+2+m;_i.checkArgument(i===M-2,new Error("Length of signature incorrect")),t&&(qA("r",s),qA("s",w));var D={header:r,length:i,rheader:o,rlength:a,rneg:c,rbuf:s,r:u,sheader:l,slength:m,sneg:P,sbuf:w,s:E};return D};mt.prototype.toCompact=function(e,t){if(e=typeof e=="number"?e:this.i,t=typeof t=="boolean"?t:this.compressed,!(e===0||e===1||e===2||e===3))throw new Error("i must be equal to 0, 1, 2, or 3");var r=e+27+4;t===!1&&(r=r-4);var i=h.Buffer.from([r]),n=this.r.toBuffer({size:32}),o=this.s.toBuffer({size:32});return h.Buffer.concat([i,n,o])};mt.prototype.toBuffer=mt.prototype.toDER=function(){var e=this.r.toBuffer(),t=this.s.toBuffer(),r=!!(e[0]&128),i=!!(t[0]&128),n=r?h.Buffer.concat([h.Buffer.from([0]),e]):e,o=i?h.Buffer.concat([h.Buffer.from([0]),t]):t,a=n.length,s=o.length,u=2+a+2+s,c=2,l=2,m=48,w=h.Buffer.concat([h.Buffer.from([m,u,c,a]),n,h.Buffer.from([l,s]),o]);return w};mt.prototype.toString=function(){var e=this.toDER();return e.toString("hex")};mt.isTxDER=function(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(e[2]!==2||t===0||i[0]&128||t>1&&i[0]===0&&!(i[1]&128))return!1;var n=e.slice(6+t);return!(e[6+t-2]!==2||r===0||n[0]&128||r>1&&n[0]===0&&!(n[1]&128))};mt.prototype.hasLowS=function(){return!(this.s.lt(new af(1))||this.s.gt(new af("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))};mt.prototype.hasDefinedHashtype=function(){if(!mX.isNaturalNumber(this.nhashtype))return!1;var e=this.nhashtype&31;return!(e<mt.SIGHASH_ALL||e>mt.SIGHASH_SINGLE)};mt.prototype.toTxFormat=function(){var e=this.toDER(),t=h.Buffer.alloc(1);return t.writeUInt8(this.nhashtype,0),h.Buffer.concat([e,t])};mt.SIGHASH_ALL=1;mt.SIGHASH_NONE=2;mt.SIGHASH_SINGLE=3;mt.SIGHASH_FORKID=64;mt.SIGHASH_ANYONECANPAY=128;mt.prototype.isCanonical=function(){var e=vn(),t=e.getN().shrn(1);return this.s.lte(t)};mt.prototype.toCanonical=function(){if(this.isCanonical())return new mt({r:this.r,s:this.s,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype});var e=vn(),t=e.getN(),r=t.sub(this.s);return new mt({r:this.r,s:r,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype})};mt.prototype.validate=function(){if(!this.r||!this.s)throw new Error("Signature missing r or s component");if(this.r.isZero())throw new Error("Signature r component is zero");if(this.s.isZero())throw new Error("Signature s component is zero");var e=vn(),t=e.getN();if(this.r.gte(t))throw new Error("Signature r component >= curve order");if(this.s.gte(t))throw new Error("Signature s component >= curve order");if(this.r.isNeg())throw new Error("Signature r component is negative");if(this.s.isNeg())throw new Error("Signature s component is negative");return!0};mt.prototype.isValid=function(){try{return this.validate(),!0}catch{return!1}};mt.prototype.applySecurityPatches=function(){var e=vn(),t=e.getN(),r=t.shrn(1);if(this.r.isZero()||this.s.isZero())throw new Error("Invalid signature: zero r or s");if(this.r.gte(t)||this.s.gte(t))throw new Error("Invalid signature: out of range");if(this.s.gt(r))throw new Error("Invalid signature: non-canonical (high) s");return this};UA.exports=mt});var jn=k(Ht=>{"use strict";v();var yX=Rn(),bX=Ot();Ht.inherits=bX;function _X(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function wX(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=o&63|128):_X(e,n)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(n=0;n<e.length;n++)r[n]=e[n]|0;return r}Ht.toArray=wX;function SX(e){for(var t="",r=0;r<e.length;r++)t+=HA(e[r].toString(16));return t}Ht.toHex=SX;function FA(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Ht.htonl=FA;function xX(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];t==="little"&&(n=FA(n)),r+=jA(n.toString(16))}return r}Ht.toHex32=xX;function HA(e){return e.length===1?"0"+e:e}Ht.zero2=HA;function jA(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}Ht.zero8=jA;function EX(e,t,r,i){var n=r-t;yX(n%4===0);for(var o=new Array(n/4),a=0,s=t;a<o.length;a++,s+=4){var u;i==="big"?u=e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:u=e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o}Ht.join32=EX;function OX(e,t){for(var r=new Array(e.length*4),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];t==="big"?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o&255):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=o&255)}return r}Ht.split32=OX;function IX(e,t){return e>>>t|e<<32-t}Ht.rotr32=IX;function AX(e,t){return e<<t|e>>>32-t}Ht.rotl32=AX;function PX(e,t){return e+t>>>0}Ht.sum32=PX;function TX(e,t,r){return e+t+r>>>0}Ht.sum32_3=TX;function kX(e,t,r,i){return e+t+r+i>>>0}Ht.sum32_4=kX;function RX(e,t,r,i,n){return e+t+r+i+n>>>0}Ht.sum32_5=RX;function BX(e,t,r,i){var n=e[t],o=e[t+1],a=i+o>>>0,s=(a<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=a}Ht.sum64=BX;function MX(e,t,r,i){var n=t+i>>>0,o=(n<t?1:0)+e+r;return o>>>0}Ht.sum64_hi=MX;function NX(e,t,r,i){var n=t+i;return n>>>0}Ht.sum64_lo=NX;function CX(e,t,r,i,n,o,a,s){var u=0,c=t;c=c+i>>>0,u+=c<t?1:0,c=c+o>>>0,u+=c<o?1:0,c=c+s>>>0,u+=c<s?1:0;var l=e+r+n+a+u;return l>>>0}Ht.sum64_4_hi=CX;function DX(e,t,r,i,n,o,a,s){var u=t+i+o+s;return u>>>0}Ht.sum64_4_lo=DX;function LX(e,t,r,i,n,o,a,s,u,c){var l=0,m=t;m=m+i>>>0,l+=m<t?1:0,m=m+o>>>0,l+=m<o?1:0,m=m+s>>>0,l+=m<s?1:0,m=m+c>>>0,l+=m<c?1:0;var w=e+r+n+a+u+l;return w>>>0}Ht.sum64_5_hi=LX;function qX(e,t,r,i,n,o,a,s,u,c){var l=t+i+o+s+c;return l>>>0}Ht.sum64_5_lo=qX;function UX(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}Ht.rotr64_hi=UX;function FX(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Ht.rotr64_lo=FX;function HX(e,t,r){return e>>>r}Ht.shr64_hi=HX;function jX(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Ht.shr64_lo=jX});var Yc=k(KA=>{"use strict";v();var zA=jn(),zX=Rn();function Op(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}KA.BlockHash=Op;Op.prototype.update=function(t,r){if(t=zA.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var i=t.length%this._delta8;this.pending=t.slice(t.length-i,t.length),this.pending.length===0&&(this.pending=null),t=zA.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this};Op.prototype.digest=function(t){return this.update(this._pad()),zX(this.pending===null),this._digest(t)};Op.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,i=r-(t+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var o=1;o<i;o++)n[o]=0;if(t<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=t&255}else for(n[o++]=t&255,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,a=8;a<this.padLength;a++)n[o++]=0;return n}});var xy=k(Pa=>{"use strict";v();var KX=jn(),Po=KX.rotr32;function VX(e,t,r,i){if(e===0)return VA(t,r,i);if(e===1||e===3)return ZA(t,r,i);if(e===2)return GA(t,r,i)}Pa.ft_1=VX;function VA(e,t,r){return e&t^~e&r}Pa.ch32=VA;function GA(e,t,r){return e&t^e&r^t&r}Pa.maj32=GA;function ZA(e,t,r){return e^t^r}Pa.p32=ZA;function GX(e){return Po(e,2)^Po(e,13)^Po(e,22)}Pa.s0_256=GX;function ZX(e){return Po(e,6)^Po(e,11)^Po(e,25)}Pa.s1_256=ZX;function WX(e){return Po(e,7)^Po(e,18)^e>>>3}Pa.g0_256=WX;function YX(e){return Po(e,17)^Po(e,19)^e>>>10}Pa.g1_256=YX});var $A=k((P2e,YA)=>{"use strict";v();var $c=jn(),$X=Yc(),XX=xy(),Ey=$c.rotl32,y0=$c.sum32,JX=$c.sum32_5,QX=XX.ft_1,WA=$X.BlockHash,eJ=[1518500249,1859775393,2400959708,3395469782];function To(){if(!(this instanceof To))return new To;WA.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}$c.inherits(To,WA);YA.exports=To;To.blockSize=512;To.outSize=160;To.hmacStrength=80;To.padLength=64;To.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=Ey(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var o=this.h[0],a=this.h[1],s=this.h[2],u=this.h[3],c=this.h[4];for(n=0;n<i.length;n++){var l=~~(n/20),m=JX(Ey(o,5),QX(l,a,s,u),c,i[n],eJ[l]);c=u,u=s,s=Ey(a,30),a=o,o=m}this.h[0]=y0(this.h[0],o),this.h[1]=y0(this.h[1],a),this.h[2]=y0(this.h[2],s),this.h[3]=y0(this.h[3],u),this.h[4]=y0(this.h[4],c)};To.prototype._digest=function(t){return t==="hex"?$c.toHex32(this.h,"big"):$c.split32(this.h,"big")}});var Oy=k((k2e,JA)=>{"use strict";v();var Xc=jn(),tJ=Yc(),Jc=xy(),rJ=Rn(),zn=Xc.sum32,iJ=Xc.sum32_4,nJ=Xc.sum32_5,oJ=Jc.ch32,aJ=Jc.maj32,sJ=Jc.s0_256,uJ=Jc.s1_256,fJ=Jc.g0_256,cJ=Jc.g1_256,XA=tJ.BlockHash,lJ=[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];function ko(){if(!(this instanceof ko))return new ko;XA.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=lJ,this.W=new Array(64)}Xc.inherits(ko,XA);JA.exports=ko;ko.blockSize=512;ko.outSize=256;ko.hmacStrength=192;ko.padLength=64;ko.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=iJ(cJ(i[n-2]),i[n-7],fJ(i[n-15]),i[n-16]);var o=this.h[0],a=this.h[1],s=this.h[2],u=this.h[3],c=this.h[4],l=this.h[5],m=this.h[6],w=this.h[7];for(rJ(this.k.length===i.length),n=0;n<i.length;n++){var E=nJ(w,uJ(c),oJ(c,l,m),this.k[n],i[n]),P=zn(sJ(o),aJ(o,a,s));w=m,m=l,l=c,c=zn(u,E),u=s,s=a,a=o,o=zn(E,P)}this.h[0]=zn(this.h[0],o),this.h[1]=zn(this.h[1],a),this.h[2]=zn(this.h[2],s),this.h[3]=zn(this.h[3],u),this.h[4]=zn(this.h[4],c),this.h[5]=zn(this.h[5],l),this.h[6]=zn(this.h[6],m),this.h[7]=zn(this.h[7],w)};ko.prototype._digest=function(t){return t==="hex"?Xc.toHex32(this.h,"big"):Xc.split32(this.h,"big")}});var tP=k((B2e,eP)=>{"use strict";v();var Iy=jn(),QA=Oy();function Ta(){if(!(this instanceof Ta))return new Ta;QA.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Iy.inherits(Ta,QA);eP.exports=Ta;Ta.blockSize=512;Ta.outSize=224;Ta.hmacStrength=192;Ta.padLength=64;Ta.prototype._digest=function(t){return t==="hex"?Iy.toHex32(this.h.slice(0,7),"big"):Iy.split32(this.h.slice(0,7),"big")}});var Ty=k((N2e,oP)=>{"use strict";v();var Ri=jn(),hJ=Yc(),dJ=Rn(),Ro=Ri.rotr64_hi,Bo=Ri.rotr64_lo,rP=Ri.shr64_hi,iP=Ri.shr64_lo,_s=Ri.sum64,Ay=Ri.sum64_hi,Py=Ri.sum64_lo,pJ=Ri.sum64_4_hi,gJ=Ri.sum64_4_lo,vJ=Ri.sum64_5_hi,mJ=Ri.sum64_5_lo,nP=hJ.BlockHash,yJ=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Kn(){if(!(this instanceof Kn))return new Kn;nP.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=yJ,this.W=new Array(160)}Ri.inherits(Kn,nP);oP.exports=Kn;Kn.blockSize=1024;Kn.outSize=512;Kn.hmacStrength=192;Kn.padLength=128;Kn.prototype._prepareBlock=function(t,r){for(var i=this.W,n=0;n<32;n++)i[n]=t[r+n];for(;n<i.length;n+=2){var o=TJ(i[n-4],i[n-3]),a=kJ(i[n-4],i[n-3]),s=i[n-14],u=i[n-13],c=AJ(i[n-30],i[n-29]),l=PJ(i[n-30],i[n-29]),m=i[n-32],w=i[n-31];i[n]=pJ(o,a,s,u,c,l,m,w),i[n+1]=gJ(o,a,s,u,c,l,m,w)}};Kn.prototype._update=function(t,r){this._prepareBlock(t,r);var i=this.W,n=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],m=this.h[7],w=this.h[8],E=this.h[9],P=this.h[10],M=this.h[11],D=this.h[12],L=this.h[13],U=this.h[14],K=this.h[15];dJ(this.k.length===i.length);for(var N=0;N<i.length;N+=2){var C=U,F=K,H=OJ(w,E),z=IJ(w,E),G=bJ(w,E,P,M,D,L),B=_J(w,E,P,M,D,L),g=this.k[N],O=this.k[N+1],y=i[N],f=i[N+1],d=vJ(C,F,H,z,G,B,g,O,y,f),_=mJ(C,F,H,z,G,B,g,O,y,f);C=xJ(n,o),F=EJ(n,o),H=wJ(n,o,a,s,u,c),z=SJ(n,o,a,s,u,c);var x=Ay(C,F,H,z),b=Py(C,F,H,z);U=D,K=L,D=P,L=M,P=w,M=E,w=Ay(l,m,d,_),E=Py(m,m,d,_),l=u,m=c,u=a,c=s,a=n,s=o,n=Ay(d,_,x,b),o=Py(d,_,x,b)}_s(this.h,0,n,o),_s(this.h,2,a,s),_s(this.h,4,u,c),_s(this.h,6,l,m),_s(this.h,8,w,E),_s(this.h,10,P,M),_s(this.h,12,D,L),_s(this.h,14,U,K)};Kn.prototype._digest=function(t){return t==="hex"?Ri.toHex32(this.h,"big"):Ri.split32(this.h,"big")};function bJ(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function _J(e,t,r,i,n,o){var a=t&i^~t&o;return a<0&&(a+=4294967296),a}function wJ(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function SJ(e,t,r,i,n,o){var a=t&i^t&o^i&o;return a<0&&(a+=4294967296),a}function xJ(e,t){var r=Ro(e,t,28),i=Ro(t,e,2),n=Ro(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function EJ(e,t){var r=Bo(e,t,28),i=Bo(t,e,2),n=Bo(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function OJ(e,t){var r=Ro(e,t,14),i=Ro(e,t,18),n=Ro(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function IJ(e,t){var r=Bo(e,t,14),i=Bo(e,t,18),n=Bo(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function AJ(e,t){var r=Ro(e,t,1),i=Ro(e,t,8),n=rP(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function PJ(e,t){var r=Bo(e,t,1),i=Bo(e,t,8),n=iP(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function TJ(e,t){var r=Ro(e,t,19),i=Ro(t,e,29),n=rP(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}function kJ(e,t){var r=Bo(e,t,19),i=Bo(t,e,29),n=iP(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}});var uP=k((D2e,sP)=>{"use strict";v();var ky=jn(),aP=Ty();function ka(){if(!(this instanceof ka))return new ka;aP.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ky.inherits(ka,aP);sP.exports=ka;ka.blockSize=1024;ka.outSize=384;ka.hmacStrength=192;ka.padLength=128;ka.prototype._digest=function(t){return t==="hex"?ky.toHex32(this.h.slice(0,12),"big"):ky.split32(this.h.slice(0,12),"big")}});var fP=k(Qc=>{"use strict";v();Qc.sha1=$A();Qc.sha224=tP();Qc.sha256=Oy();Qc.sha384=uP();Qc.sha512=Ty()});var gP=k(pP=>{"use strict";v();var sf=jn(),RJ=Yc(),Ip=sf.rotl32,cP=sf.sum32,b0=sf.sum32_3,lP=sf.sum32_4,dP=RJ.BlockHash;function Mo(){if(!(this instanceof Mo))return new Mo;dP.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}sf.inherits(Mo,dP);pP.ripemd160=Mo;Mo.blockSize=512;Mo.outSize=160;Mo.hmacStrength=192;Mo.padLength=64;Mo.prototype._update=function(t,r){for(var i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=i,c=n,l=o,m=a,w=s,E=0;E<80;E++){var P=cP(Ip(lP(i,hP(E,n,o,a),t[NJ[E]+r],BJ(E)),DJ[E]),s);i=s,s=a,a=Ip(o,10),o=n,n=P,P=cP(Ip(lP(u,hP(79-E,c,l,m),t[CJ[E]+r],MJ(E)),LJ[E]),w),u=w,w=m,m=Ip(l,10),l=c,c=P}P=b0(this.h[1],o,m),this.h[1]=b0(this.h[2],a,w),this.h[2]=b0(this.h[3],s,u),this.h[3]=b0(this.h[4],i,c),this.h[4]=b0(this.h[0],n,l),this.h[0]=P};Mo.prototype._digest=function(t){return t==="hex"?sf.toHex32(this.h,"little"):sf.split32(this.h,"little")};function hP(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function BJ(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function MJ(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var NJ=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],CJ=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],DJ=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],LJ=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var mP=k((j2e,vP)=>{"use strict";v();var qJ=jn(),UJ=Rn();function el(e,t,r){if(!(this instanceof el))return new el(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(qJ.toArray(t,r))}vP.exports=el;el.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),UJ(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};el.prototype.update=function(t,r){return this.inner.update(t,r),this};el.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var bP=k(yP=>{v();var ri=yP;ri.utils=jn();ri.common=Yc();ri.sha=fP();ri.ripemd=gP();ri.hmac=mP();ri.sha1=ri.sha.sha1;ri.sha256=ri.sha.sha256;ri.sha224=ri.sha.sha224;ri.sha384=ri.sha.sha384;ri.sha512=ri.sha.sha512;ri.ripemd160=ri.ripemd.ripemd160});var wP=k((G2e,_P)=>{"use strict";v();var Ap=bP(),Ra=Bt(),Sr=_P.exports;Sr.sha1=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.sha1().update(e).digest("hex"),"hex")};Sr.sha1.blocksize=512;Sr.sha256=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.sha256().update(e).digest("hex"),"hex")};Sr.sha256.blocksize=512;Sr.sha256sha256=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),Sr.sha256(Sr.sha256(e))};Sr.ripemd160=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.ripemd160().update(e).digest("hex"),"hex")};Sr.sha256ripemd160=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),Sr.ripemd160(Sr.sha256(e))};Sr.sha512=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.sha512().update(e).digest("hex"),"hex")};Sr.sha512.blocksize=1024;Sr.hmac=function(e,t,r){Ra.checkArgument(h.Buffer.isBuffer(t)),Ra.checkArgument(h.Buffer.isBuffer(r)),Ra.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=h.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=h.Buffer.alloc(i);o.fill(92);var a=h.Buffer.alloc(i);a.fill(54);for(var s=h.Buffer.alloc(i),u=h.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(h.Buffer.concat([s,e(h.Buffer.concat([u,t]))]))};Sr.sha256hmac=function(e,t){return Sr.hmac(Sr.sha256,e,t)};Sr.sha512hmac=function(e,t){return Sr.hmac(Sr.sha512,e,t)}});var xP=k((W2e,SP)=>{"use strict";v();var Pp=_r(),Ba=Bt(),xr=SP.exports;xr.sha1=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("sha1").update(e).digest()};xr.sha1.blocksize=512;xr.sha256=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("sha256").update(e).digest()};xr.sha256.blocksize=512;xr.sha256sha256=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),xr.sha256(xr.sha256(e))};xr.ripemd160=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("ripemd160").update(e).digest()};xr.sha256ripemd160=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),xr.ripemd160(xr.sha256(e))};xr.sha512=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("sha512").update(e).digest()};xr.sha512.blocksize=1024;xr.hmac=function(e,t,r){Ba.checkArgument(h.Buffer.isBuffer(t)),Ba.checkArgument(h.Buffer.isBuffer(r)),Ba.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=h.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=h.Buffer.alloc(i);o.fill(92);var a=h.Buffer.alloc(i);a.fill(54);for(var s=h.Buffer.alloc(i),u=h.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(h.Buffer.concat([s,e(h.Buffer.concat([u,t]))]))};xr.sha256hmac=function(e,t){return xr.hmac(xr.sha256,e,t)};xr.sha512hmac=function(e,t){return xr.hmac(xr.sha512,e,t)}});var cr=k(($2e,Ry)=>{v();A.default.browser?Ry.exports=wP():Ry.exports=xP()});var Ss=k((J2e,IP)=>{"use strict";v();var Ma=xt(),_0=pi(),uf=[],w0={};function EP(){}EP.prototype.toString=function(){return this.name};function S0(e,t){if(~uf.indexOf(e))return e;if(t){Ma.isArray(t)||(t=[t]);for(var r=0;r<uf.length;r++){var i=uf[r],n=Ma.pick(i,t),o=Ma.values(n);if(~o.indexOf(e))return i}return}return w0[e]}function My(e){for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r)&31);return t}function x0(e){var t=new EP;_0.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey});var r=e.indexBy||Object.keys(e);return e.cashAddrPrefix&&Ma.extend(t,{cashAddrPrefix:e.cashAddrPrefix,cashAddrPrefixArray:My(e.cashAddrPrefix)}),e.networkMagic&&Ma.extend(t,{networkMagic:_0.integerAsBuffer(e.networkMagic)}),e.port&&Ma.extend(t,{port:e.port}),e.dnsSeeds&&Ma.extend(t,{dnsSeeds:e.dnsSeeds}),uf.push(t),FJ(t,r),t}function FJ(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=e[i];!Ma.isUndefined(n)&&!Ma.isObject(n)&&(w0[n]=e)}}function HJ(e,t){for(var r=0;r<t.length;r++){var i=t[r];w0[i]===e&&delete w0[i]}}function jJ(e){for(var t=0;t<uf.length;t++)uf[t]===e&&uf.splice(t,1);HJ(e,Object.keys(w0))}var Tp={livenet:3823236072,testnet:4108710900,regtest:3669344250,stn:4224632057},OP=["seed.bitcoinsv.org","seed.bitcoinunlimited.info"],ws={PORT:18333,NETWORK_MAGIC:Tp.testnet,DNS_SEEDS:OP,PREFIX:"testnet",CASHADDRPREFIX:"bchtest"},Na={PORT:18444,NETWORK_MAGIC:Tp.regtest,DNS_SEEDS:[],PREFIX:"regtest",CASHADDRPREFIX:"bchreg"},Ca={PORT:9333,NETWORK_MAGIC:Tp.stn,DNS_SEEDS:["stn-seed.bitcoinsv.io"],PREFIX:"stn",CASHADDRPREFIX:"bsvstn"},zJ={name:"livenet",alias:"mainnet",prefix:"bitcoin",cashAddrPrefix:"bitcoincash",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:Tp.livenet,port:8333,dnsSeeds:OP},KJ={name:"testnet",prefix:ws.PREFIX,cashAddrPrefix:ws.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:ws.NETWORK_MAGIC},VJ={name:"regtest",prefix:Na.PREFIX,cashAddrPrefix:Na.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Na.NETWORK_MAGIC,port:Na.PORT,dnsSeeds:[],indexBy:["port","name","cashAddrPrefix","networkMagic"]},GJ={name:"stn",prefix:Ca.PREFIX,cashAddrPrefix:Ca.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Ca.NETWORK_MAGIC,indexBy:["port","name","cashAddrPrefix","networkMagic"]};x0(KJ);x0(GJ);x0(VJ);x0(zJ);var By=S0("livenet"),ZJ=S0("regtest"),No=S0("testnet"),WJ=S0("stn");Object.defineProperty(No,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.PORT:this.stnEnabled?Ca.PORT:ws.PORT}});Object.defineProperty(No,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?_0.integerAsBuffer(Na.NETWORK_MAGIC):this.stnEnabled?_0.integerAsBuffer(Ca.NETWORK_MAGIC):_0.integerAsBuffer(ws.NETWORK_MAGIC)}});Object.defineProperty(No,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.DNS_SEEDS:this.stnEnabled?Ca.DNS_SEEDS:ws.DNS_SEEDS}});Object.defineProperty(No,"cashAddrPrefix",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.CASHADDRPREFIX:this.stnEnabled?Ca.CASHADDRPREFIX:ws.CASHADDRPREFIX}});Object.defineProperty(No,"cashAddrPrefixArray",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?My(Na.CASHADDRPREFIX):this.stnEnabled?Ca.cashAddrPrefixToArray(Ca.CASHADDRPREFIX):My(ws.CASHADDRPREFIX)}});function YJ(){No.regtestEnabled=!0}function $J(){No.regtestEnabled=!1}function XJ(){No.stnEnabled=!0}function JJ(){No.stnEnabled=!1}IP.exports={add:x0,remove:jJ,defaultNetwork:By,livenet:By,mainnet:By,testnet:No,regtest:ZJ,stn:WJ,get:S0,enableRegtest:YJ,disableRegtest:$J,enableStn:XJ,disableStn:JJ}});var E0=k((epe,TP)=>{"use strict";v();var Ny=xt(),AP=Y2(),PP=Kt(),QJ="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),Gr=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};Gr.validCharacters=function(t){return PP.Buffer.isBuffer(t)&&(t=t.toString()),Ny.every(Ny.map(t,function(r){return Ny.includes(QJ,r)}))};Gr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Gr.encode=function(e){if(!PP.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return AP.encode(e)};Gr.decode=function(e){if(typeof e!="string")throw new Error("Input should be a string");return h.Buffer.from(AP.decode(e))};Gr.prototype.fromBuffer=function(e){return this.buf=e,this};Gr.fromBuffer=function(e){return new Gr().fromBuffer(e)};Gr.fromHex=function(e){return Gr.fromBuffer(h.Buffer.from(e,"hex"))};Gr.prototype.fromString=function(e){var t=Gr.decode(e);return this.buf=t,this};Gr.fromString=function(e){return new Gr().fromString(e)};Gr.prototype.toBuffer=function(){return this.buf};Gr.prototype.toHex=function(){return this.toBuffer().toString("hex")};Gr.prototype.toString=function(){return Gr.encode(this.buf)};TP.exports=Gr});var tl=k((rpe,MP)=>{"use strict";v();var kP=xt(),kp=E0(),RP=Kt(),BP=cr().sha256sha256,lr=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};lr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};lr.validChecksum=function(t,r){return kP.isString(t)&&(t=RP.Buffer.from(kp.decode(t))),kP.isString(r)&&(r=RP.Buffer.from(kp.decode(r))),r||(r=t.slice(-4),t=t.slice(0,-4)),lr.checksum(t).toString("hex")===r.toString("hex")};lr.decode=function(e){if(typeof e!="string")throw new Error("Input must be a string");var t=h.Buffer.from(kp.decode(e));if(t.length<4)throw new Error("Input string too short");var r=t.slice(0,-4),i=t.slice(-4),n=BP(r),o=n.slice(0,4);if(i.toString("hex")!==o.toString("hex"))throw new Error("Checksum mismatch");return r};lr.checksum=function(e){return BP(e).slice(0,4)};lr.encode=function(e){if(!h.Buffer.isBuffer(e))throw new Error("Input must be a buffer");var t=h.Buffer.alloc(e.length+4),r=lr.checksum(e);return e.copy(t),r.copy(t,e.length),kp.encode(t)};lr.prototype.fromBuffer=function(e){return this.buf=e,this};lr.fromBuffer=function(e){return new lr().fromBuffer(e)};lr.fromHex=function(e){return lr.fromBuffer(h.Buffer.from(e,"hex"))};lr.prototype.fromString=function(e){var t=lr.decode(e);return this.buf=t,this};lr.fromString=function(e){var t=lr.decode(e);return new lr(t)};lr.prototype.toBuffer=function(){return this.buf};lr.prototype.toHex=function(){return this.toBuffer().toString("hex")};lr.prototype.toString=function(){return lr.encode(this.buf)};MP.exports=lr});var Da=k((npe,CP)=>{"use strict";v();var O0=xt(),NP=Bt(),rl=fr(),gr=function e(t){if(!(this instanceof e))return new e(t);if(!O0.isUndefined(t))if(h.Buffer.isBuffer(t))this.set({buf:t});else if(O0.isString(t)){var r=h.Buffer.from(t,"hex");if(r.length*2!==t.length)throw new TypeError("Invalid hex string");this.set({buf:r})}else if(O0.isObject(t)){var i=t;this.set(i)}else throw new TypeError("Unrecognized argument for BufferReader")};gr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this};gr.prototype.eof=function(){return this.pos>=this.buf.length};gr.prototype.finished=gr.prototype.eof;gr.prototype.read=function(e){NP.checkArgument(!O0.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t};gr.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e};gr.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e};gr.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e};gr.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e};gr.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=rl.fromBuffer(e);return this.pos=this.pos+8,t};gr.prototype.readUInt64LEBN=function(){var e=this.buf.readUInt32LE(this.pos),t=this.buf.readUInt32LE(this.pos+4),r=t*4294967296+e,i;if(r<=9007199254740991)i=new rl(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);i=new rl(n,10,"le")}return this.pos=this.pos+8,i};gr.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN(),r=t.toNumber();if(r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarintBN");default:return e}};gr.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return NP.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t};gr.prototype.readVarintBuf=function(){var e=this.buf.readUInt8(this.pos);switch(e){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}};gr.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new rl(this.readUInt16LE());case 254:return new rl(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new rl(e)}};gr.prototype.reverse=function(){for(var e=h.Buffer.alloc(this.buf.length),t=0;t<e.length;t++)e[t]=this.buf[this.buf.length-1-t];return this.buf=e,this};gr.prototype.readReverse=function(e){O0.isUndefined(e)&&(e=this.buf.length);var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,h.Buffer.from(t).reverse()};CP.exports=gr});var Ly=k((ape,UP)=>{"use strict";v();function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function DP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,tQ(i.key),i)}}function eQ(e,t,r){return t&&DP(e.prototype,t),r&&DP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tQ(e){var t=rQ(e,"string");return xs(t)==="symbol"?t:String(t)}function rQ(e,t){if(xs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(xs(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dy(e,t)}function Dy(e,t){return Dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},Dy(e,t)}function oQ(e){var t=uQ();return function(){var i=Rp(e),n;if(t){var o=Rp(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return aQ(this,n)}}function aQ(e,t){if(t&&(xs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sQ(e)}function sQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rp(e){return Rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rp(e)}var qP={},il,Cy;function I0(e,t,r){r||(r=Error);function i(o,a,s){return typeof t=="string"?t:t(o,a,s)}var n=(function(o){nQ(s,o);var a=oQ(s);function s(u,c,l){var m;return iQ(this,s),m=a.call(this,i(u,c,l)),m.code=e,m}return eQ(s)})(r);qP[e]=n}function LP(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function fQ(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function cQ(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function lQ(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}I0("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError);I0("ERR_INVALID_ARG_TYPE",function(e,t,r){il===void 0&&(il=Es()),il(typeof e=="string","'name' must be a string");var i;typeof t=="string"&&fQ(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(cQ(e," argument"))n="The ".concat(e," ").concat(i," ").concat(LP(t,"type"));else{var o=lQ(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(i," ").concat(LP(t,"type"))}return n+=". Received type ".concat(xs(r)),n},TypeError);I0("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";Cy===void 0&&(Cy=rn());var i=Cy.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(i)},TypeError,RangeError);I0("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return r&&r.constructor&&r.constructor.name?i="instance of ".concat(r.constructor.name):i="type ".concat(xs(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError);I0("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];il===void 0&&(il=Es()),il(t.length>0,"At least one arg needs to be specified");var i="The ",n=t.length;switch(t=t.map(function(o){return'"'.concat(o,'"')}),n){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,n-1).join(", "),i+=", and ".concat(t[n-1]," arguments");break}return"".concat(i," must be specified")},TypeError);UP.exports.codes=qP});var YP=k((upe,WP)=>{"use strict";v();function FP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function HP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(r),!0).forEach(function(i){hQ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FP(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function hQ(e,t,r){return t=VP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,VP(i.key),i)}}function pQ(e,t,r){return t&&jP(e.prototype,t),r&&jP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function VP(e){var t=gQ(e,"string");return Bi(t)==="symbol"?t:String(t)}function gQ(e,t){if(Bi(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(Bi(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&k0(e,t)}function mQ(e){var t=ZP();return function(){var i=R0(e),n;if(t){var o=R0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return GP(this,n)}}function GP(e,t){if(t&&(Bi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qy(e)}function qy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uy(e){var t=typeof Map=="function"?new Map:void 0;return Uy=function(i){if(i===null||!yQ(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(i))return t.get(i);t.set(i,n)}function n(){return Bp(i,arguments,R0(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k0(n,i)},Uy(e)}function Bp(e,t,r){return ZP()?Bp=Reflect.construct.bind():Bp=function(n,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(n,s),c=new u;return a&&k0(c,a.prototype),c},Bp.apply(null,arguments)}function ZP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yQ(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function k0(e,t){return k0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},k0(e,t)}function R0(e){return R0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},R0(e)}function Bi(e){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bi(e)}var bQ=rn(),Fy=bQ.inspect,_Q=Ly(),wQ=_Q.codes.ERR_INVALID_ARG_TYPE;function zP(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function SQ(e,t){if(t=Math.floor(t),e.length==0||t==0)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,r-e.length),e}var Vn="",A0="",P0="",ii="",ff={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},xQ=10;function KP(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(i){r[i]=e[i]}),Object.defineProperty(r,"message",{value:e.message}),r}function T0(e){return Fy(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function EQ(e,t,r){var i="",n="",o=0,a="",s=!1,u=T0(e),c=u.split(`
|
|
19
|
+
`+new Error().stack};Cc.Error.prototype=Object.create(Error.prototype);Cc.Error.prototype.name="bsv.Error";var w$=yI();_$(Cc.Error,w$);Vm.exports=Cc.Error;Vm.exports.extend=function(e){return bI(Cc.Error,e)}});var Bt=k((fde,wI)=>{"use strict";v();var n0=hn(),S$=xt();wI.exports={checkState:function(e,t){if(!e)throw new n0.InvalidState(t)},checkArgument:function(e,t,r,i){if(!e)throw new n0.InvalidArgument(t,r,i)},checkArgumentType:function(e,t,r){if(r=r||"(unknown name)",S$.isString(t)){if(t==="Buffer"){var i=Kt();if(!i.Buffer.isBuffer(e))throw new n0.InvalidArgumentType(e,t,r)}else if(typeof e!==t)throw new n0.InvalidArgumentType(e,t,r)}else if(!(e instanceof t))throw new n0.InvalidArgumentType(e,t.name,r)}}});var fr=k((lde,xI)=>{"use strict";v();var It=Nn(),Gm=Bt(),SI=xt(),$2=function(e){for(var t=h.Buffer.alloc(e.length),r=0;r<e.length;r++)t[r]=e[e.length-1-r];return t};It.Zero=new It(0);It.One=new It(1);It.Minus1=new It(-1);It.fromNumber=function(e){return Gm.checkArgument(SI.isNumber(e)),new It(e)};It.fromString=function(e,t){return Gm.checkArgument(SI.isString(e)),new It(e,t)};It.fromBuffer=function(e,t){typeof t<"u"&&t.endian==="little"&&(e=$2(e));var r=e.toString("hex"),i=new It(r,16);return i};It.fromSM=function(e,t){var r;if(e.length===0)return It.fromBuffer(h.Buffer.from([0]));var i="big";return t&&(i=t.endian),i==="little"&&(e=$2(e)),e[0]&128?(e[0]=e[0]&127,r=It.fromBuffer(e),r.neg().copy(r)):r=It.fromBuffer(e),r};It.prototype.toNumber=function(){return parseInt(this.toString(10),10)};It.prototype.toBuffer=function(e){var t,r;if(e&&e.size){r=this.toString(16,2);var i=r.length/2;t=h.Buffer.from(r,"hex"),i===e.size||(i>e.size?t=It.trim(t,i):i<e.size&&(t=It.pad(t,i,e.size)))}else r=this.toString(16,2),t=h.Buffer.from(r,"hex");return typeof e<"u"&&e.endian==="little"&&(t=$2(t)),t};It.prototype.toSMBigEndian=function(){var e;return this.cmp(It.Zero)===-1?(e=this.neg().toBuffer(),e[0]&128?e=h.Buffer.concat([h.Buffer.from([128]),e]):e[0]=e[0]|128):(e=this.toBuffer(),e[0]&128&&(e=h.Buffer.concat([h.Buffer.from([0]),e]))),e.length===1&e[0]===0&&(e=h.Buffer.from([])),e};It.prototype.toSM=function(e){var t=e?e.endian:"big",r=this.toSMBigEndian();return t==="little"&&(r=$2(r)),r};It.fromScriptNumBuffer=function(e,t,r){var i=r||4;if(Gm.checkArgument(e.length<=i,new Error("script number overflow")),t&&e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))throw new Error("non-minimally encoded script number");return It.fromSM(e,{endian:"little"})};It.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})};It.trim=function(e,t){return e.slice(t-e.length,e.length)};It.pad=function(e,t,r){for(var i=h.Buffer.alloc(r),n=0;n<e.length;n++)i[i.length-1-n]=e[e.length-1-n];for(n=0;n<r-t;n++)i[n]=0;return i};It.prototype.toHex=function(...e){return this.toBuffer(...e).toString("hex")};It.fromHex=function(e,...t){return It.fromBuffer(h.Buffer.from(e,"hex"),...t)};xI.exports=It});function Zm(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ps(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(`${r}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){let r=t&&`"${t}" `;throw new RangeError(`${r}expected integer >= 0, got ${e}`)}}function Eo(e,t,r=""){let i=Zm(e),n=e?.length,o=t!==void 0;if(!i||o&&n!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=i?`length=${n}`:`type=${typeof e}`,c=a+"expected Uint8Array"+s+", got "+u;throw i?new RangeError(c):new TypeError(c)}return e}function X2(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ps(e.outputLen),ps(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function Dc(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 J2(e,t){Eo(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function Sa(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Q2(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Fn(e,t){return e<<32-t|e>>>t}function ep(e){if(Eo(e),OI)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=x$[e[r]];return t}function EI(e){if(e>=wa._0&&e<=wa._9)return e-wa._0;if(e>=wa.A&&e<=wa.F)return e-(wa.A-10);if(e>=wa.a&&e<=wa.f)return e-(wa.a-10)}function Wm(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(OI)try{return Uint8Array.fromHex(e)}catch(n){throw n instanceof SyntaxError?new RangeError(n.message):n}let t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);let i=new Uint8Array(r);for(let n=0,o=0;n<r;n++,o+=2){let a=EI(e.charCodeAt(o)),s=EI(e.charCodeAt(o+1));if(a===void 0||s===void 0){let u=e[o]+e[o+1];throw new RangeError('hex string expected, got non-hex character "'+u+'" at index '+o)}i[n]=a*16+s}return i}function xa(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function II(...e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];Eo(n),t+=n.length}let r=new Uint8Array(t);for(let i=0,n=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return r}function Vu(e,t={}){let r=(n,o)=>e(o).update(n).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=n=>e(n),Object.assign(r,t),Object.freeze(r)}function o0(e=32){ps(e,"bytesLength");let t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}var OI,x$,wa,Gu,gs=Xr(()=>{v();OI=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",x$=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));wa={_0:48,_9:57,A:65,F:70,a:97,f:102};Gu=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})});function AI(e,t,r){return e&t^~e&r}function PI(e,t,r){return e&t^e&r^t&r}var a0,Ea,Oa,Qr,ei,TI=Xr(()=>{v();gs();a0=class{constructor(t,r,i,n){Z(this,"blockLen");Z(this,"outputLen");Z(this,"canXOF",!1);Z(this,"padOffset");Z(this,"isLE");Z(this,"buffer");Z(this,"view");Z(this,"finished",!1);Z(this,"length",0);Z(this,"pos",0);Z(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=Q2(this.buffer)}update(t){Dc(this),Eo(t);let{view:r,buffer:i,blockLen:n}=this,o=t.length;for(let a=0;a<o;){let s=Math.min(n-this.pos,o-a);if(s===n){let u=Q2(t);for(;n<=o-a;a+=n)this.process(u,a);continue}i.set(t.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Dc(this),J2(t,this),this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:a}=this;r[a++]=128,Sa(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(i,0),a=0);for(let m=a;m<n;m++)r[m]=0;i.setBigUint64(n-8,BigInt(this.length*8),o),this.process(i,0);let s=Q2(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<c;m++)s.setUint32(4*m,l[m],o)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:i,length:n,finished:o,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=o,t.length=n,t.pos=s,n%r&&t.buffer.set(i),t}clone(){return this._cloneInto()}},Ea=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Oa=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Qr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ei=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});function E$(e,t=!1){return t?{h:Number(e&tp),l:Number(e>>kI&tp)}:{h:Number(e>>kI&tp)|0,l:Number(e&tp)|0}}function RI(e,t=!1){let r=e.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:a,l:s}=E$(e[o],t);[i[o],n[o]]=[a,s]}return[i,n]}function Oo(e,t,r,i){let n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:n|0}}var tp,kI,Ym,$m,Zu,Wu,s0,u0,BI,MI,NI,CI,DI,LI,qI=Xr(()=>{v();tp=BigInt(4294967295),kI=BigInt(32);Ym=(e,t,r)=>e>>>r,$m=(e,t,r)=>e<<32-r|t>>>r,Zu=(e,t,r)=>e>>>r|t<<32-r,Wu=(e,t,r)=>e<<32-r|t>>>r,s0=(e,t,r)=>e<<64-r|t>>>r-32,u0=(e,t,r)=>e>>>r-32|t<<64-r;BI=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),MI=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,NI=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),CI=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,DI=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),LI=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0});var Xm={};Q1(Xm,{_SHA224:()=>np,_SHA256:()=>ip,_SHA384:()=>ap,_SHA512:()=>op,_SHA512_224:()=>sp,_SHA512_256:()=>up,sha224:()=>T$,sha256:()=>bs,sha384:()=>R$,sha512:()=>k$,sha512_224:()=>M$,sha512_256:()=>B$});var I$,vs,rp,ip,np,UI,A$,P$,ms,ys,Lc,op,ap,hi,di,sp,up,bs,T$,k$,R$,B$,M$,fp=Xr(()=>{v();TI();qI();gs();I$=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),vs=new Uint32Array(64),rp=class extends a0{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:r,C:i,D:n,E:o,F:a,G:s,H:u}=this;return[t,r,i,n,o,a,s,u]}set(t,r,i,n,o,a,s,u){this.A=t|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0}process(t,r){for(let m=0;m<16;m++,r+=4)vs[m]=t.getUint32(r,!1);for(let m=16;m<64;m++){let w=vs[m-15],E=vs[m-2],P=Fn(w,7)^Fn(w,18)^w>>>3,M=Fn(E,17)^Fn(E,19)^E>>>10;vs[m]=M+vs[m-7]+P+vs[m-16]|0}let{A:i,B:n,C:o,D:a,E:s,F:u,G:c,H:l}=this;for(let m=0;m<64;m++){let w=Fn(s,6)^Fn(s,11)^Fn(s,25),E=l+w+AI(s,u,c)+I$[m]+vs[m]|0,M=(Fn(i,2)^Fn(i,13)^Fn(i,22))+PI(i,n,o)|0;l=c,c=u,u=s,s=a+E|0,a=o,o=n,n=i,i=E+M|0}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(i,n,o,a,s,u,c,l)}roundClean(){Sa(vs)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Sa(this.buffer)}},ip=class extends rp{constructor(){super(32);Z(this,"A",Ea[0]|0);Z(this,"B",Ea[1]|0);Z(this,"C",Ea[2]|0);Z(this,"D",Ea[3]|0);Z(this,"E",Ea[4]|0);Z(this,"F",Ea[5]|0);Z(this,"G",Ea[6]|0);Z(this,"H",Ea[7]|0)}},np=class extends rp{constructor(){super(28);Z(this,"A",Oa[0]|0);Z(this,"B",Oa[1]|0);Z(this,"C",Oa[2]|0);Z(this,"D",Oa[3]|0);Z(this,"E",Oa[4]|0);Z(this,"F",Oa[5]|0);Z(this,"G",Oa[6]|0);Z(this,"H",Oa[7]|0)}},UI=RI(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),A$=UI[0],P$=UI[1],ms=new Uint32Array(80),ys=new Uint32Array(80),Lc=class extends a0{constructor(t){super(128,t,16,!1)}get(){let{Ah:t,Al:r,Bh:i,Bl:n,Ch:o,Cl:a,Dh:s,Dl:u,Eh:c,El:l,Fh:m,Fl:w,Gh:E,Gl:P,Hh:M,Hl:D}=this;return[t,r,i,n,o,a,s,u,c,l,m,w,E,P,M,D]}set(t,r,i,n,o,a,s,u,c,l,m,w,E,P,M,D){this.Ah=t|0,this.Al=r|0,this.Bh=i|0,this.Bl=n|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=c|0,this.El=l|0,this.Fh=m|0,this.Fl=w|0,this.Gh=E|0,this.Gl=P|0,this.Hh=M|0,this.Hl=D|0}process(t,r){for(let K=0;K<16;K++,r+=4)ms[K]=t.getUint32(r),ys[K]=t.getUint32(r+=4);for(let K=16;K<80;K++){let N=ms[K-15]|0,C=ys[K-15]|0,F=Zu(N,C,1)^Zu(N,C,8)^Ym(N,C,7),H=Wu(N,C,1)^Wu(N,C,8)^$m(N,C,7),z=ms[K-2]|0,G=ys[K-2]|0,B=Zu(z,G,19)^s0(z,G,61)^Ym(z,G,6),g=Wu(z,G,19)^u0(z,G,61)^$m(z,G,6),O=NI(H,g,ys[K-7],ys[K-16]),y=CI(O,F,B,ms[K-7],ms[K-16]);ms[K]=y|0,ys[K]=O|0}let{Ah:i,Al:n,Bh:o,Bl:a,Ch:s,Cl:u,Dh:c,Dl:l,Eh:m,El:w,Fh:E,Fl:P,Gh:M,Gl:D,Hh:L,Hl:U}=this;for(let K=0;K<80;K++){let N=Zu(m,w,14)^Zu(m,w,18)^s0(m,w,41),C=Wu(m,w,14)^Wu(m,w,18)^u0(m,w,41),F=m&E^~m&M,H=w&P^~w&D,z=DI(U,C,H,P$[K],ys[K]),G=LI(z,L,N,F,A$[K],ms[K]),B=z|0,g=Zu(i,n,28)^s0(i,n,34)^s0(i,n,39),O=Wu(i,n,28)^u0(i,n,34)^u0(i,n,39),y=i&o^i&s^o&s,f=n&a^n&u^a&u;L=M|0,U=D|0,M=E|0,D=P|0,E=m|0,P=w|0,{h:m,l:w}=Oo(c|0,l|0,G|0,B|0),c=s|0,l=u|0,s=o|0,u=a|0,o=i|0,a=n|0;let d=BI(B,O,f);i=MI(d,G,g,y),n=d|0}({h:i,l:n}=Oo(this.Ah|0,this.Al|0,i|0,n|0)),{h:o,l:a}=Oo(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Oo(this.Ch|0,this.Cl|0,s|0,u|0),{h:c,l}=Oo(this.Dh|0,this.Dl|0,c|0,l|0),{h:m,l:w}=Oo(this.Eh|0,this.El|0,m|0,w|0),{h:E,l:P}=Oo(this.Fh|0,this.Fl|0,E|0,P|0),{h:M,l:D}=Oo(this.Gh|0,this.Gl|0,M|0,D|0),{h:L,l:U}=Oo(this.Hh|0,this.Hl|0,L|0,U|0),this.set(i,n,o,a,s,u,c,l,m,w,E,P,M,D,L,U)}roundClean(){Sa(ms,ys)}destroy(){this.destroyed=!0,Sa(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},op=class extends Lc{constructor(){super(64);Z(this,"Ah",ei[0]|0);Z(this,"Al",ei[1]|0);Z(this,"Bh",ei[2]|0);Z(this,"Bl",ei[3]|0);Z(this,"Ch",ei[4]|0);Z(this,"Cl",ei[5]|0);Z(this,"Dh",ei[6]|0);Z(this,"Dl",ei[7]|0);Z(this,"Eh",ei[8]|0);Z(this,"El",ei[9]|0);Z(this,"Fh",ei[10]|0);Z(this,"Fl",ei[11]|0);Z(this,"Gh",ei[12]|0);Z(this,"Gl",ei[13]|0);Z(this,"Hh",ei[14]|0);Z(this,"Hl",ei[15]|0)}},ap=class extends Lc{constructor(){super(48);Z(this,"Ah",Qr[0]|0);Z(this,"Al",Qr[1]|0);Z(this,"Bh",Qr[2]|0);Z(this,"Bl",Qr[3]|0);Z(this,"Ch",Qr[4]|0);Z(this,"Cl",Qr[5]|0);Z(this,"Dh",Qr[6]|0);Z(this,"Dl",Qr[7]|0);Z(this,"Eh",Qr[8]|0);Z(this,"El",Qr[9]|0);Z(this,"Fh",Qr[10]|0);Z(this,"Fl",Qr[11]|0);Z(this,"Gh",Qr[12]|0);Z(this,"Gl",Qr[13]|0);Z(this,"Hh",Qr[14]|0);Z(this,"Hl",Qr[15]|0)}},hi=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),di=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),sp=class extends Lc{constructor(){super(28);Z(this,"Ah",hi[0]|0);Z(this,"Al",hi[1]|0);Z(this,"Bh",hi[2]|0);Z(this,"Bl",hi[3]|0);Z(this,"Ch",hi[4]|0);Z(this,"Cl",hi[5]|0);Z(this,"Dh",hi[6]|0);Z(this,"Dl",hi[7]|0);Z(this,"Eh",hi[8]|0);Z(this,"El",hi[9]|0);Z(this,"Fh",hi[10]|0);Z(this,"Fl",hi[11]|0);Z(this,"Gh",hi[12]|0);Z(this,"Gl",hi[13]|0);Z(this,"Hh",hi[14]|0);Z(this,"Hl",hi[15]|0)}},up=class extends Lc{constructor(){super(32);Z(this,"Ah",di[0]|0);Z(this,"Al",di[1]|0);Z(this,"Bh",di[2]|0);Z(this,"Bl",di[3]|0);Z(this,"Ch",di[4]|0);Z(this,"Cl",di[5]|0);Z(this,"Dh",di[6]|0);Z(this,"Dl",di[7]|0);Z(this,"Eh",di[8]|0);Z(this,"El",di[9]|0);Z(this,"Fh",di[10]|0);Z(this,"Fl",di[11]|0);Z(this,"Gh",di[12]|0);Z(this,"Gl",di[13]|0);Z(this,"Hh",di[14]|0);Z(this,"Hl",di[15]|0)}},bs=Vu(()=>new ip,Gu(1)),T$=Vu(()=>new np,Gu(4)),k$=Vu(()=>new op,Gu(3)),R$=Vu(()=>new ap,Gu(2)),B$=Vu(()=>new up,Gu(6)),M$=Vu(()=>new sp,Gu(5))});function $u(e,t=""){if(typeof e!="boolean"){let r=t&&`"${t}" `;throw new TypeError(r+"expected boolean, got type="+typeof e)}return e}function hp(e){if(typeof e=="bigint"){if(!cp(e))throw new RangeError("positive bigint expected, got "+e)}else Qm(e);return e}function dn(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(r+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){let r=t&&`"${t}" `;throw new RangeError(r+"expected safe integer, got "+e)}}function f0(e){let t=hp(e).toString(16);return t.length&1?"0"+t:t}function FI(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?lp:BigInt("0x"+e)}function bi(e){return FI(ep(e))}function Uc(e){return FI(ep(pp(Eo(e)).reverse()))}function dp(e,t){if(ps(t),t===0)throw new RangeError("zero length");e=hp(e);let r=e.toString(16);if(r.length>t*2)throw new RangeError("number too large");return Wm(r.padStart(t*2,"0"))}function ey(e,t){return dp(e,t).reverse()}function pp(e){return Uint8Array.from(qt(e))}function Fc(e){if(typeof e!="string")throw new TypeError("ascii string expected, got "+typeof e);return Uint8Array.from(e,(t,r)=>{let i=t.charCodeAt(0);if(t.length!==1||i>127)throw new RangeError(`string contains non-ASCII character "${e[r]}" with code ${i} at position ${r}`);return i})}function N$(e,t,r){return cp(e)&&cp(t)&&cp(r)&&t<=e&&e<r}function ty(e,t,r,i){if(!N$(t,r,i))throw new RangeError("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}function Xu(e){if(e<lp)throw new Error("expected non-negative bigint, got "+e);let t;for(t=0;e>lp;e>>=Jm,t+=1);return t}function HI(e,t,r){if(ps(e,"hashLen"),ps(t,"qByteLen"),typeof r!="function")throw new TypeError("hmacFn must be a function");let i=D=>new Uint8Array(D),n=Uint8Array.of(),o=Uint8Array.of(0),a=Uint8Array.of(1),s=1e3,u=i(e),c=i(e),l=0,m=()=>{u.fill(1),c.fill(0),l=0},w=(...D)=>r(c,kt(u,...D)),E=(D=n)=>{c=w(o,D),u=w(),D.length!==0&&(c=w(a,D),u=w())},P=()=>{if(l++>=s)throw new Error("drbg: tried max amount of iterations");let D=0,L=[];for(;D<t;){u=w();let U=u.slice();L.push(U),D+=u.length}return kt(...L)};return(D,L)=>{m(),E(D);let U;for(;(U=L(P()))===void 0;)E();return m(),U}}function pn(e,t={},r={}){if(Object.prototype.toString.call(e)!=="[object Object]")throw new TypeError("expected valid options object");function i(o,a,s){if(!s&&a!=="function"&&!Object.hasOwn(e,o))throw new TypeError(`param "${o}" is invalid: expected own property`);let u=e[o];if(s&&u===void 0)return;let c=typeof u;if(c!==a||u===null)throw new TypeError(`param "${o}" is invalid: expected ${a}, got ${c}`)}let n=(o,a)=>Object.entries(o).forEach(([s,u])=>i(s,u,a));n(t,!1),n(r,!0)}var qt,Qm,Ia,kt,qc,Yu,ki,lp,Jm,cp,Hc,Ju=Xr(()=>{v();gs();qt=(e,t,r)=>Eo(e,t,r),Qm=ps,Ia=ep,kt=(...e)=>II(...e),qc=e=>Wm(e),Yu=Zm,ki=e=>o0(e),lp=BigInt(0),Jm=BigInt(1);cp=e=>typeof e=="bigint"&&lp<=e;Hc=e=>(Jm<<BigInt(e))-Jm});function Ui(e,t){if(t<=ti)throw new Error("mod: expected positive modulus, got "+t);let r=e%t;return r>=ti?r:t+r}function Fi(e,t,r){if(t<ti)throw new Error("pow2: expected non-negative exponent, got "+t);let i=e;for(;t-- >ti;)i*=i,i%=r;return i}function jI(e,t){if(e===ti)throw new Error("invert: expected non-zero number");if(t<=ti)throw new Error("invert: expected positive modulus, got "+t);let r=Ui(e,t),i=t,n=ti,o=wr,a=wr,s=ti;for(;r!==ti;){let c=i/r,l=i-r*c,m=n-a*c,w=o-s*c;i=r,r=l,n=a,o=s,a=m,s=w}if(i!==wr)throw new Error("invert: does not exist");return Ui(n,t)}function iy(e,t,r){let i=e;if(!i.eql(i.sqr(t),r))throw new Error("Cannot find square root")}function YI(e,t){let r=e,i=(r.ORDER+wr)/VI,n=r.pow(t,i);return iy(r,n,t),n}function L$(e,t){let r=e,i=(r.ORDER-GI)/ZI,n=r.mul(t,Qu),o=r.pow(n,i),a=r.mul(t,o),s=r.mul(r.mul(a,Qu),o),u=r.mul(a,r.sub(s,r.ONE));return iy(r,u,t),u}function q$(e){let t=jc(e),r=$I(e),i=r(t,t.neg(t.ONE)),n=r(t,i),o=r(t,t.neg(i)),a=(e+C$)/WI;return((s,u)=>{let c=s,l=c.pow(u,a),m=c.mul(l,i),w=c.mul(l,n),E=c.mul(l,o),P=c.eql(c.sqr(m),u),M=c.eql(c.sqr(w),u);l=c.cmov(l,m,P),m=c.cmov(E,w,M);let D=c.eql(c.sqr(m),u),L=c.cmov(l,m,D);return iy(c,L,u),L})}function $I(e){if(e<KI)throw new Error("sqrt is not defined for small field");let t=e-wr,r=0;for(;t%Qu===ti;)t/=Qu,r++;let i=Qu,n=jc(e);for(;ry(n,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return YI;let o=n.pow(i,t),a=(t+wr)/Qu;return function(u,c){let l=u;if(l.is0(c))return c;if(ry(l,c)!==1)throw new Error("Cannot find square root");let m=r,w=l.mul(l.ONE,o),E=l.pow(c,t),P=l.pow(c,a);for(;!l.eql(E,l.ONE);){if(l.is0(E))return l.ZERO;let M=1,D=l.sqr(E);for(;!l.eql(D,l.ONE);)if(M++,D=l.sqr(D),M===m)throw new Error("Cannot find square root");let L=wr<<BigInt(m-M-1),U=l.pow(w,L);m=M,w=l.sqr(U),E=l.mul(E,w),P=l.mul(P,U)}return P}}function U$(e){return e%VI===KI?YI:e%ZI===GI?L$:e%WI===D$?q$(e):$I(e)}function ef(e){let t={ORDER:"bigint",BYTES:"number",BITS:"number"},r=F$.reduce((i,n)=>(i[n]="function",i),t);if(pn(e,r),dn(e.BYTES,"BYTES"),dn(e.BITS,"BITS"),e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=wr)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function H$(e,t,r){let i=e;if(r<ti)throw new Error("invalid exponent, negatives unsupported");if(r===ti)return i.ONE;if(r===wr)return t;let n=i.ONE,o=t;for(;r>ti;)r&wr&&(n=i.mul(n,o)),o=i.sqr(o),r>>=wr;return n}function tf(e,t,r=!1){let i=e,n=new Array(t.length).fill(r?i.ZERO:void 0),o=t.reduce((s,u,c)=>i.is0(u)?s:(n[c]=s,i.mul(s,u)),i.ONE),a=i.inv(o);return t.reduceRight((s,u,c)=>i.is0(u)?s:(n[c]=i.mul(s,n[c]),i.mul(s,u)),a),n}function ry(e,t){let r=e,i=(r.ORDER-wr)/Qu,n=r.pow(t,i),o=r.eql(n,r.ONE),a=r.eql(n,r.ZERO),s=r.eql(n,r.neg(r.ONE));if(!o&&!a&&!s)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}function ny(e,t){return ry(e,t)!==-1}function j$(e,t){if(t!==void 0&&Qm(t),e<=ti)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);let r=Xu(e);if(t!==void 0&&t<r)throw new Error(`invalid n length: expected bit length (${r}) >= n.length (${t})`);let i=t!==void 0?t:r,n=Math.ceil(i/8);return{nBitLength:i,nByteLength:n}}function jc(e,t={}){return new gp(e,t)}function XI(e){if(typeof e!="bigint")throw new Error("field order must be bigint");if(e<=wr)throw new Error("field order must be greater than 1");let t=Xu(e-wr);return Math.ceil(t/8)}function c0(e){let t=XI(e);return t+Math.ceil(t/2)}function zc(e,t,r=!1){qt(e);let i=e.length,n=XI(t),o=Math.max(c0(t),16);if(i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let a=r?Uc(e):bi(e),s=Ui(a,t-wr)+wr;return r?ey(s,n):dp(s,n)}var ti,wr,Qu,KI,VI,GI,C$,ZI,D$,WI,F$,zI,gp,Kc=Xr(()=>{v();Ju();ti=BigInt(0),wr=BigInt(1),Qu=BigInt(2),KI=BigInt(3),VI=BigInt(4),GI=BigInt(5),C$=BigInt(7),ZI=BigInt(8),D$=BigInt(9),WI=BigInt(16);F$=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];zI=new WeakMap,gp=class{constructor(t,r={}){Z(this,"ORDER");Z(this,"BITS");Z(this,"BYTES");Z(this,"isLE");Z(this,"ZERO",ti);Z(this,"ONE",wr);Z(this,"_lengths");Z(this,"_mod");if(t<=wr)throw new Error("invalid field: expected ORDER > 1, got "+t);let i;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(i=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:!0}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:n,nByteLength:o}=j$(t,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=n,this.BYTES=o,Object.freeze(this)}create(t){return Ui(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return ti<=t&&t<this.ORDER}is0(t){return t===ti}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&wr)===wr}neg(t){return Ui(-t,this.ORDER)}eql(t,r){return t===r}sqr(t){return Ui(t*t,this.ORDER)}add(t,r){return Ui(t+r,this.ORDER)}sub(t,r){return Ui(t-r,this.ORDER)}mul(t,r){return Ui(t*r,this.ORDER)}pow(t,r){return H$(this,t,r)}div(t,r){return Ui(t*jI(r,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,r){return t+r}subN(t,r){return t-r}mulN(t,r){return t*r}inv(t){return jI(t,this.ORDER)}sqrt(t){let r=zI.get(this);return r||zI.set(this,r=U$(this.ORDER)),r(this,t)}toBytes(t){return this.isLE?ey(t,this.BYTES):dp(t,this.BYTES)}fromBytes(t,r=!1){qt(t);let{_lengths:i,BYTES:n,isLE:o,ORDER:a,_mod:s}=this;if(i){if(t.length<1||!i.includes(t.length)||t.length>n)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let c=new Uint8Array(n);c.set(t,o?0:c.length-t.length),t=c}if(t.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+t.length);let u=o?Uc(t):bi(t);if(s&&(u=Ui(u,a)),!r&&!this.isValid(u))throw new Error("invalid field element: outside of range 0..ORDER");return u}invertBatch(t){return tf(this,t)}cmov(t,r,i){return $u(i,"condition"),i?r:t}};Object.freeze(gp.prototype)});function tA(e){let t=e;if(typeof t!="function")throw new TypeError("Point must be a constructor");pn({Fp:t.Fp,Fn:t.Fn,fromAffine:t.fromAffine,fromBytes:t.fromBytes,fromHex:t.fromHex},{Fp:"object",Fn:"object",fromAffine:"function",fromBytes:"function",fromHex:"function"}),ef(t.Fp),ef(t.Fn)}function l0(e,t){let r=t.negate();return e?r:t}function uy(e,t){let r=tf(e.Fp,t.map(i=>i.Z));return t.map((i,n)=>e.fromAffine(i.toAffine(r[n])))}function rA(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function oy(e,t){rA(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e,o=Hc(e),a=BigInt(e);return{windows:r,windowSize:i,mask:o,maxNumber:n,shiftBy:a}}function JI(e,t,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:a}=r,s=Number(e&n),u=e>>a;s>i&&(s-=o,u+=rf);let c=t*i,l=c+Math.abs(s)-1,m=s===0,w=s<0,E=t%2!==0;return{nextN:u,offset:l,isZero:m,isNeg:w,isNegF:E,offsetF:c}}function z$(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,i)=>{if(!(r instanceof t))throw new Error("invalid point at index "+i)})}function K$(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,i)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+i)})}function sy(e){return iA.get(e)||1}function QI(e){if(e!==Vc)throw new Error("invalid wNAF")}function nA(e,t,r,i){let n=t,o=e.ZERO,a=e.ZERO;for(;r>Vc||i>Vc;)r&rf&&(o=o.add(n)),i&rf&&(a=a.add(n)),n=n.double(),r>>=rf,i>>=rf;return{p1:o,p2:a}}function oA(e,t,r){let i=e.Fn;z$(t,e),K$(r,i);let n=t.length,o=r.length;if(n!==o)throw new Error("arrays of points and scalars must have equal length");let a=e.ZERO,s=Xu(BigInt(n)),u=1;s>12?u=s-3:s>4?u=s-2:s>0&&(u=2);let c=Hc(u),l=new Array(Number(c)+1).fill(a),m=Math.floor((i.BITS-1)/u)*u,w=a;for(let E=m;E>=0;E-=u){l.fill(a);for(let M=0;M<o;M++){let D=r[M],L=Number(D>>BigInt(E)&c);l[L]=l[L].add(t[M])}let P=a;for(let M=l.length-1,D=a;M>0;M--)D=D.add(l[M]),P=P.add(D);if(w=w.add(P),E!==0)for(let M=0;M<u;M++)w=w.double()}return w}function eA(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return ef(t),t}else return jc(e,{isLE:r})}function aA(e,t,r={},i){if(i===void 0&&(i=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(let u of["p","n","h"]){let c=t[u];if(!(typeof c=="bigint"&&c>Vc))throw new Error(`CURVE.${u} must be positive bigint`)}let n=eA(t.p,r.Fp,i),o=eA(t.n,r.Fn,i),s=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let u of s)if(!n.isValid(t[u]))throw new Error(`CURVE.${u} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:n,Fn:o}}function mp(e,t){return function(i){let n=e(i);return{secretKey:n,publicKey:t(n)}}}var Vc,rf,ay,iA,vp,yp=Xr(()=>{v();Ju();Kc();Vc=BigInt(0),rf=BigInt(1);ay=new WeakMap,iA=new WeakMap;vp=class{constructor(t,r){Z(this,"BASE");Z(this,"ZERO");Z(this,"Fn");Z(this,"bits");this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,i=this.ZERO){let n=t;for(;r>Vc;)r&rf&&(i=i.add(n)),n=n.double(),r>>=rf;return i}precomputeWindow(t,r){let{windows:i,windowSize:n}=oy(r,this.bits),o=[],a=t,s=a;for(let u=0;u<i;u++){s=a,o.push(s);for(let c=1;c<n;c++)s=s.add(a),o.push(s);a=s.double()}return o}wNAF(t,r,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE,a=oy(t,this.bits);for(let s=0;s<a.windows;s++){let{nextN:u,offset:c,isZero:l,isNeg:m,isNegF:w,offsetF:E}=JI(i,s,a);i=u,l?o=o.add(l0(w,r[E])):n=n.add(l0(m,r[c]))}return QI(i),{p:n,f:o}}wNAFUnsafe(t,r,i,n=this.ZERO){let o=oy(t,this.bits);for(let a=0;a<o.windows&&i!==Vc;a++){let{nextN:s,offset:u,isZero:c,isNeg:l}=JI(i,a,o);if(i=s,!c){let m=r[u];n=n.add(l?m.negate():m)}}return QI(i),n}getPrecomputes(t,r,i){let n=ay.get(r);return n||(n=this.precomputeWindow(r,t),t!==1&&(typeof i=="function"&&(n=i(n)),ay.set(r,n))),n}cached(t,r,i){let n=sy(t);return this.wNAF(n,this.getPrecomputes(n,t,i),r)}unsafe(t,r,i,n){let o=sy(t);return o===1?this._unsafeLadder(t,r,n):this.wNAFUnsafe(o,this.getPrecomputes(o,t,i),r,n)}createCache(t,r){rA(r,this.bits),iA.set(t,r),ay.delete(t)}hasCache(t){return sy(t)!==1}}});function sA(e){if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw new Error("wrong u32 integer:"+e);return e}function V$(e){if(sA(e),e<=1)return 1;if(e>2147483648)throw new Error("nextPowerOfTwo overflow: result does not fit u32");return 1<<fy(e-1)+1>>>0}function fy(e){return sA(e),31-Math.clz32(e)}function uA(e,t,r,i,n){let o=e,a=r||((l,m)=>new Array(l).fill(m??o.ZERO)),s=l=>{if(Array.isArray(l))return!0;if(!ArrayBuffer.isView(l))return!1;let m=l;return typeof m.length=="number"&&typeof m.slice=="function"&&typeof m[Symbol.iterator]=="function"},u=(...l)=>{if(!l.length)return 0;for(let w of l)if(!s(w))throw new Error("poly: not polynomial: "+w);let m=l[0].length;for(let w=1;w<l.length;w++)if(l[w].length!==m)throw new Error(`poly: mismatched lengths ${m} vs ${l[w].length}`);if(n!==void 0&&m!==n)throw new Error(`poly: expected fixed length ${n}, got ${m}`);return m};function c(l,m,w=!1){let E=fy(m),P=w?t.brp(E):t.roots(E);for(let M=0;M<m;M++)if(o.eql(l,P[M]))return M;return-1}return{roots:t,create:a,length:n,extend:(l,m)=>{u(l);let w=a(m,o.ZERO);for(let E=0;E<Math.min(l.length,m);E++)w[E]=l[E];return w},degree:l=>{u(l);for(let m=l.length-1;m>=0;m--)if(!o.is0(l[m]))return m;return-1},add:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.add(l[P],m[P]);return E},sub:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.sub(l[P],m[P]);return E},dot:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.mul(l[P],m[P]);return E},mul:(l,m)=>{if(s(m)){let w=u(l,m);if(i){let E=i.direct(l,!1,!0),P=i.direct(m,!1,!0);for(let M=0;M<E.length;M++)E[M]=o.mul(E[M],P[M]);return i.inverse(E,!0,!1)}else{let E=a(w);for(let P=0;P<w;P++)for(let M=0;M<w;M++){let D=(P+M)%w;E[D]=o.add(E[D],o.mul(l[P],m[M]))}return E}}else{let w=a(u(l));for(let E=0;E<w.length;E++)w[E]=o.mul(l[E],m);return w}},convolve(l,m){let w=V$(l.length+m.length-1);return this.mul(this.extend(l,w),this.extend(m,w))},shift(l,m){let w=a(u(l));w[0]=l[0];for(let E=1,P=o.ONE;E<l.length;E++)P=o.mul(P,m),w[E]=o.mul(l[E],P);return w},clone:l=>{u(l);let m=a(l.length);for(let w=0;w<l.length;w++)m[w]=l[w];return m},eval:(l,m)=>{u(l,m);let w=o.ZERO;for(let E=0;E<l.length;E++)w=o.add(w,o.mul(l[E],m[E]));return w},monomial:{basis:(l,m)=>{let w=a(m),E=o.ONE;for(let P=0;P<m;P++)w[P]=E,E=o.mul(E,l);return w},eval:(l,m)=>{u(l);let w=o.ZERO;for(let E=l.length-1;E>=0;E--)w=o.add(o.mul(w,m),l[E]);return w}},lagrange:{basis:(l,m,w=!1,E)=>{let P=fy(m),M=E||(w?t.brp(P):t.roots(P)),D=a(m),L=c(l,m,w);if(L!==-1)return D[L]=o.ONE,D;let U=o.pow(l,BigInt(m)),K=o.mul(o.sub(U,o.ONE),o.inv(BigInt(m))),N=a(m);for(let F=0;F<m;F++)N[F]=o.sub(l,M[F]);let C=o.invertBatch(N);for(let F=0;F<m;F++)D[F]=o.mul(K,o.mul(M[F],C[F]));return D},eval(l,m,w=!1){u(l);let E=c(m,l.length,w);if(E!==-1)return l[E];let P=this.basis(m,l.length,w),M=o.ZERO;for(let D=0;D<l.length;D++)o.is0(l[D])||(M=o.add(M,o.mul(l[D],P[D])));return M}},vanishing(l){u(l);let m=a(l.length+1,o.ZERO);m[0]=o.ONE;for(let w of l){let E=o.neg(w);for(let P=m.length-1;P>0;P--)m[P]=o.add(o.mul(m[P],E),m[P-1]);m[0]=o.mul(m[0],E)}return m}}}var fA=Xr(()=>{v()});function nf(e,t){if(dn(e),dn(t),t<0||t>4)throw new Error("invalid I2OSP length: "+t);if(e<0||e>2**(8*t)-1)throw new Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let i=t-1;i>=0;i--)r[i]=e&255,e>>>=8;return new Uint8Array(r)}function Z$(e,t){let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e[i]^t[i];return r}function cA(e){if(!Yu(e)&&typeof e!="string")throw new Error("DST must be Uint8Array or ascii string");let t=typeof e=="string"?Fc(e):e;if(t.length===0)throw new Error("DST must be non-empty");return t}function W$(e,t,r,i){qt(e),dn(r),t=cA(t),t.length>255&&(t=i(kt(Fc("H2C-OVERSIZE-DST-"),t)));let{outputLen:n,blockLen:o}=i,a=Math.ceil(r/n);if(r>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");let s=kt(t,nf(t.length,1)),u=new Uint8Array(o),c=nf(r,2),l=new Array(a),m=i(kt(u,e,c,nf(0,1),s));l[0]=i(kt(m,nf(1,1),s));for(let E=1;E<a;E++){let P=[Z$(m,l[E-1]),nf(E+1,1),s];l[E]=i(kt(...P))}return kt(...l).slice(0,r)}function Y$(e,t,r,i,n){if(qt(e),dn(r),t=cA(t),t.length>255){let o=Math.ceil(2*i/8);t=n.create({dkLen:o}).update(Fc("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return n.create({dkLen:r}).update(e).update(nf(r,2)).update(t).update(nf(t.length,1)).digest()}function cy(e,t,r){pn(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:i,k:n,m:o,hash:a,expand:s,DST:u}=r;if(dn(a.outputLen,"valid hash"),qt(e),dn(t),t<1)throw new Error("hash_to_field: expected count >= 1");if(o<1)throw new Error("hash_to_field: expected m >= 1");let c=i.toString(2).length,l=Math.ceil((c+n)/8),m=t*o*l,w;if(s==="xmd")w=W$(e,u,m,a);else if(s==="xof")w=Y$(e,u,m,n,a);else if(s==="_internal_pass")w=e;else throw new Error('expand must be "xmd" or "xof"');let E=new Array(t);for(let P=0;P<t;P++){let M=new Array(o);for(let D=0;D<o;D++){let L=l*(D+P*o),U=w.subarray(L,L+l);M[D]=Ui(G$(U),i)}E[P]=M}return E}function lA(e,t){let r=t.map(i=>Array.from(i).reverse());return(i,n)=>{let[o,a,s,u]=r.map(m=>m.reduce((w,E)=>e.add(e.mul(w,i),E))),[c,l]=tf(e,[a,u],!0);return i=e.mul(o,c),n=e.mul(n,e.mul(s,l)),{x:i,y:n}}}function hA(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");let i=s=>Object.freeze({...s,DST:Yu(s.DST)?pp(s.DST):s.DST,...s.encodeDST===void 0?{}:{encodeDST:Yu(s.encodeDST)?pp(s.encodeDST):s.encodeDST}}),n=i(r);function o(s){return e.fromAffine(t(s))}function a(s){let u=s.clearCofactor();return u.equals(e.ZERO)?e.ZERO:(u.assertValidity(),u)}return Object.freeze({get defaults(){return i(n)},Point:e,hashToCurve(s,u){let c=Object.assign({},n,u),l=cy(s,2,c),m=o(l[0]),w=o(l[1]);return a(m.add(w))},encodeToCurve(s,u){let c=n.encodeDST?{DST:n.encodeDST}:{},l=Object.assign({},n,c,u),m=cy(s,1,l),w=o(m[0]);return a(w)},mapToCurve(s){if(n.m===1){if(typeof s!="bigint")throw new Error("expected bigint (m=1)");return a(o([s]))}if(!Array.isArray(s))throw new Error("expected array of bigints");for(let u of s)if(typeof u!="bigint")throw new Error("expected array of bigints");return a(o(s))},hashToScalar(s,u){let c=e.Fn.ORDER,l=Object.assign({},n,{p:c,m:1,DST:$$},u);return cy(s,1,l)[0][0]}})}var G$,$$,dA=Xr(()=>{v();Ju();Kc();G$=bi;$$="HashToScalar-"});function ly(e){pn(e,{name:"string",hash:"function"},{hashToScalar:"function",validatePoint:"function",parsePublicKey:"function",adjustScalar:"function",adjustPoint:"function",challenge:"function",adjustNonces:"function",adjustSecret:"function",adjustPublic:"function",adjustGroupCommitmentShare:"function",adjustDKG:"function"}),tA(e.Point);let{Point:t}=e,r=e.Fn===void 0?t.Fn:e.Fn,i=e.hash,n=e.hashToScalar===void 0?(q,W={DST:new Uint8Array})=>{let $=i(kt(W.DST,q));return r.create(r.isLE?Uc($):bi($))}:e.hashToScalar,o=xa(e.H1!==void 0?e.H1:e.name+"rho"),a=xa(e.H2!==void 0?e.H2:e.name+"chal"),s=xa(e.H3!==void 0?e.H3:e.name+"nonce"),u=xa(e.H4!==void 0?e.H4:e.name+"msg"),c=xa(e.H5!==void 0?e.H5:e.name+"com"),l=xa(e.HDKG!==void 0?e.HDKG:e.name+"dkg"),m=xa(e.HID!==void 0?e.HID:e.name+"id"),w=q=>n(q,{DST:o}),E=q=>n(q,{DST:a}),P=q=>n(q,{DST:s}),M=q=>i(kt(u,q)),D=q=>i(kt(c,q)),L=q=>n(q,{DST:l}),U=q=>n(q,{DST:m}),K=(q=ki)=>{let W=zc(q(c0(r.ORDER)),r.ORDER,r.isLE);return r.isLE?Uc(W):bi(W)},N=q=>q.toBytes(),C=q=>{let W=t.fromBytes(q);return e.validatePoint&&e.validatePoint(W),W},F=(q,W)=>({identifier:q,hiding:N(t.BASE.multiply(r.fromBytes(W.hiding))),binding:N(t.BASE.multiply(r.fromBytes(W.binding)))}),H=e.adjustPoint===void 0?q=>q:e.adjustPoint,z=q=>{if(!r.isValid(q)||r.is0(q))throw new Error("Invalid identifier "+q);return q},G=q=>Ia(r.toBytes(z(q))),B=q=>{let W=z(r.fromBytes(qc(q)));if(G(W)!==q)throw new Error("expected canonical identifier hex");return W},g={encode:(q,W)=>{let $=kt(N(q),r.toBytes(W));return e.adjustTx&&($=e.adjustTx.encode($)),$},decode:q=>{e.adjustTx&&(q=e.adjustTx.decode(q));let W=C(q.subarray(0,-r.BYTES)),$=r.fromBytes(q.subarray(-r.BYTES));return{R:W,z:$}}},O=(q=ki)=>{let W=K(q);e.adjustScalar&&(W=e.adjustScalar(W));let $=t.BASE.multiply(W);return{scalar:W,point:$}},y="roots are unavailable in FROST polynomial mode",f={info:{G:r.ZERO,oddFactor:r.ZERO,powerOfTwo:0},roots(){throw new Error(y)},brp(){throw new Error(y)},inverse(){throw new Error(y)},omega(){throw new Error(y)},clear(){}},d=uA(r,f),_=(q,W)=>oA(t,q,W),x=(q,W)=>{if(!W.length)throw new Error("empty coefficients");return d.monomial.eval(W,q)},b=(q,W)=>{let $="invalid parameters";if(!q.some(le=>r.eql(le,W)))throw new Error($);let ee=new Set(q);if(ee.size!==q.length)throw new Error($);if(!ee.has(W))throw new Error($);let se=r.ONE,ue=r.ONE;for(let le of q)r.eql(le,W)||(se=r.mul(se,le),ue=r.mul(ue,r.sub(le,W)));return r.div(se,ue)},p=(q,W)=>{let $=d.monomial.basis(q,W.length);return _(W,$)},I=(q,W,$,ee=ki)=>{bp(q);let se=W===void 0?K(ee):r.fromBytes(W);if(!$){$=[];for(let Ae=0;Ae<q.min-1;Ae++)$.push(K(ee))}if($.length!==q.min-1)throw new Error("wrong coefficients length");let ue=[se,...$],le=ue.map(Ae=>t.BASE.multiply(Ae));return{coefficients:ue,commitment:le,secret:se}},T={challenge:(q,W,$)=>L(kt(r.toBytes(q),N(W),N($))),compute(q,W,$,ee=ki){if(W.length<1)throw new Error("coefficients should have at least one element");let{point:se,scalar:ue}=O(ee),le=$[0],Ae=this.challenge(q,le,se),ge=r.add(ue,r.mul(W[0],Ae));return g.encode(se,ge)},validate(q,W,$){if(W.length<1)throw new Error("commitment should have at least one element");let{R:ee,z:se}=g.decode($),ue=C(W[0]),le=this.challenge(q,ue,ee);if(!ee.equals(t.BASE.multiply(se).subtract(ue.multiply(le))))throw new Error("invalid proof of knowledge")}},S={challenge:(q,W,$)=>e.challenge?e.challenge(q,W,$):E(kt(N(q),N(W),$)),sign(q,W,$=ki){let{point:ee,scalar:se}=O($),ue=t.BASE.multiply(W),le=this.challenge(ee,ue,q),Ae=r.add(se,r.mul(le,W));return[ee,Ae]},verify(q,W,$,ee){e.adjustPoint&&(ee=e.adjustPoint(ee)),e.adjustPoint&&(W=e.adjustPoint(W));let se=this.challenge(W,ee,q),ue=t.BASE.multiply($),le=ee.multiply(se),Ae=ue.subtract(le).subtract(W);return Ae.clearCofactor&&(Ae=Ae.clearCofactor()),t.ZERO.equals(Ae)}},R=(q,W,$)=>{if(!t.BASE.multiply($).equals(p(q,W)))throw new Error("invalid secret share")},Y={fromNumber(q){if(!Number.isSafeInteger(q))throw new Error("expected safe interger");return G(BigInt(q))},derive(q){if(typeof q!="string")throw new Error("wrong identifier string: "+q);return G(U(xa(q)))}},X=(q,W=ki)=>P(kt(W(32),r.toBytes(q))),ne=(q,W,$)=>{let ee=W.map(ye=>[ye.identifier,B(ye.identifier),C(ye.hiding),C(ye.binding)]);ee.sort((ye,Re)=>ye[1]<Re[1]?-1:ye[1]>Re[1]?1:0);let se=[];for(let[ye,Re,be,_e]of ee)se.push(r.toBytes(Re),N(be),N(_e));let ue=D(kt(...se)),le=kt(N(q),M($),ue),Ae={};for(let[ye,Re]of ee)Ae[ye]=w(kt(le,r.toBytes(Re)));let ge=[],ve=[];for(let[ye,Re,be,_e]of ee){if(t.ZERO.equals(be)||t.ZERO.equals(_e))throw new Error("infinity commitment");ge.push(be,_e),ve.push(r.ONE,Ae[ye])}let sr=_(ge,ve);return{identifiers:ee.map(ye=>ye[1]),groupCommitment:sr,bindingFactors:Ae}},ce=(q,W,$,ee)=>{let se=H(C(q)),ue=B(ee),{identifiers:le,groupCommitment:Ae,bindingFactors:ge}=ne(se,W,$),ve=ge[ee],sr=b(le,ue),xe=S.challenge(Ae,se,$);return{lambda:sr,challenge:xe,bindingFactor:ve,groupCommitment:Ae}};Object.freeze(Y);let pe={Identifier:Y,DKG:Object.freeze({round1:(q,W,$,ee=ki)=>{bp(W);let se=B(q),{coefficients:ue,commitment:le}=I(W,$,void 0,ee),Ae=T.compute(se,ue,le,ee),ge=le.map(N),ve={identifier:G(se),commitment:ge,proofOfKnowledge:Ae},sr={identifier:se,coefficients:ue,commitment:le.map(N),signers:{min:W.min,max:W.max},step:1};return{public:ve,secret:sr}},round2:(q,W)=>{if(W.length!==q.signers.max-1)throw new Error("wrong number of round1 packages");if(!q.coefficients||q.step===3)throw new Error("round3 package used in round2");let $={};for(let ee of W){if(ee.commitment.length!==q.signers.min)throw new Error("wrong number of commitments");let se=B(ee.identifier);if(se===q.identifier)throw new Error("duplicate id="+G(se));T.validate(se,ee.commitment,ee.proofOfKnowledge);for(let le of ee.commitment)C(le);if($[ee.identifier])throw new Error("Duplicate id="+se);let ue=r.toBytes(x(se,q.coefficients));$[ee.identifier]={identifier:G(q.identifier),signingShare:ue}}return q.step=2,$},round3:(q,W,$)=>{if(W.length!==q.signers.max-1)throw new Error("wrong length of round1 packages");if(!q.coefficients||q.step!==2)throw new Error("round2 package used in round3");if($.length!==W.length)throw new Error("wrong length of round2 packages");let ee={};for(let Re of W){if(!Re.identifier||!Re.commitment)throw new Error("wrong round1 share");ee[Re.identifier]={...Re}}for(let Re of $){if(!Re.identifier||!Re.signingShare)throw new Error("wrong round2 share");if(!ee[Re.identifier])throw new Error("round1 share for "+Re.identifier+" is missing");ee[Re.identifier].signingShare=Re.signingShare}if(Object.keys(ee).length!==W.length)throw new Error("mismatch identifiers between rounds");let se=r.ZERO;if(q.commitment.length!==q.signers.min)throw new Error("wrong commitments length");let ue=q.commitment.map(C),le=x(q.identifier,q.coefficients);R(q.identifier,ue,le);let Ae=ue.map(N),ge={[G(q.identifier)]:Ae};for(let Re in ee){let be=ee[Re];if(!be.signingShare||!be.commitment)throw new Error("mismatch identifiers");let _e=B(Re),Qi=r.fromBytes(be.signingShare),Be=be.commitment.map(C);R(q.identifier,Be,Qi),se=r.add(se,Qi);let ke=G(_e);if(ge[ke])throw new Error("duplicated id="+ke);ge[ke]=be.commitment}se=r.add(se,le);let ve=new Array(q.signers.min).fill(t.ZERO);for(let Re in ge){let be=ge[Re];if(be.length!==q.signers.min)throw new Error("wrong commitments length");for(let _e=0;_e<be.length;_e++)ve[_e]=ve[_e].add(C(be[_e]))}let sr=ve.map(N),xe={};for(let Re in ge)xe[Re]=N(p(B(Re),ve));let ye={public:{signers:{min:q.signers.min,max:q.signers.max},commitments:sr,verifyingShares:Object.fromEntries(Object.entries(xe).map(([Re,be])=>[Re,be.slice()]))},secret:{identifier:G(q.identifier),signingShare:r.toBytes(se)}};e.adjustDKG&&(ye=e.adjustDKG(ye));for(let Re=0;Re<q.coefficients.length;Re++)q.coefficients[Re]-=q.coefficients[Re];return delete q.coefficients,q.step=3,ye},clean(q){if(q.identifier-=q.identifier,q.coefficients)for(let W=0;W<q.coefficients.length;W++)q.coefficients[W]-=q.coefficients[W];q.step=3}}),trustedDealer(q,W,$,ee=ki){if(bp(q),W===void 0){W=[];for(let ve=1;ve<=q.max;ve++)W.push(Y.fromNumber(ve))}else if(!Array.isArray(W)||W.length!==q.max)throw new Error("identifiers should be array of "+q.max);let se={};for(let ve of W){let sr=B(ve);if(ve in se)throw new Error("duplicated id="+ve);se[ve]=sr}let ue=I(q,$,void 0,ee),le=ue.commitment.map(N),Ae={},ge={};for(let ve of W){let sr=x(se[ve],ue.coefficients);ge[ve]=N(t.BASE.multiply(sr)),Ae[ve]={identifier:ve,signingShare:r.toBytes(sr)}}return{public:{signers:{min:q.min,max:q.max},commitments:le,verifyingShares:ge},secretShares:Ae}},validateSecret(q,W){let $=B(q.identifier),ee=W.commitments.map(C),se=r.fromBytes(q.signingShare);R($,ee,se)},commit(q,W=ki){let $=r.fromBytes(q.signingShare),ee=X($,W),se=X($,W),ue={hiding:r.toBytes(ee),binding:r.toBytes(se)};return{nonces:ue,commitments:F(q.identifier,ue)}},signShare(q,W,$,ee,se){pA(W.signers,ee.length);let ue=r.fromBytes($.hiding),le=r.fromBytes($.binding);if(r.is0(ue)||r.is0(le))throw new Error("signing nonces already used");let Ae={identifier:q.identifier,hiding:N(t.BASE.multiply(ue)),binding:N(t.BASE.multiply(le))},ge=ee.find(Ce=>Ce.identifier===q.identifier);if(!ge)throw new Error("missing signer commitment");if(Ia(ge.hiding)!==Ia(Ae.hiding)||Ia(ge.binding)!==Ia(Ae.binding))throw new Error("incorrect signer commitment");e.adjustSecret&&(q=e.adjustSecret(q,W)),e.adjustPublic&&(W=e.adjustPublic(W));let ve=r.fromBytes(q.signingShare),{lambda:sr,challenge:xe,bindingFactor:ye,groupCommitment:Re}=ce(W.commitments[0],ee,se,q.identifier),be=e.adjustNonces?e.adjustNonces(Re,$):$,_e=e.adjustNonces?r.fromBytes(be.hiding):ue,Qi=e.adjustNonces?r.fromBytes(be.binding):le,Be=r.mul(r.mul(sr,ve),xe),ke=r.mul(Qi,ye),$s=r.toBytes(r.add(r.add(_e,ke),Be));return $.hiding.fill(0),$.binding.fill(0),$s},verifyShare(q,W,$,ee,se){e.adjustPublic&&(q=e.adjustPublic(q));let ue=W.find(Qi=>Qi.identifier===ee);if(!ue)throw new Error("cannot find identifier commitment");let le=C(q.verifyingShares[ee]),Ae=C(ue.hiding),ge=C(ue.binding),{lambda:ve,challenge:sr,bindingFactor:xe,groupCommitment:ye}=ce(q.commitments[0],W,$,ee),Re=Ae.add(ge.multiply(xe));e.adjustGroupCommitmentShare&&(Re=e.adjustGroupCommitmentShare(ye,Re));let be=t.BASE.multiply(r.fromBytes(se)),_e=Re.add(le.multiply(r.mul(sr,ve)));return be.equals(_e)},aggregate(q,W,$,ee){e.adjustPublic&&(q=e.adjustPublic(q));try{pA(q.signers,W.length)}catch{throw new Gc("aggregation failed",[])}let se=W.map(ge=>ge.identifier);if(se.length!==Object.keys(ee).length)throw new Gc("aggregation failed",[]);for(let ge of se)if(!(ge in ee)||!(ge in q.verifyingShares))throw new Gc("aggregation failed",[]);let ue=C(q.commitments[0]),{groupCommitment:le}=ne(ue,W,$),Ae=r.ZERO;for(let ge of se)Ae=r.add(Ae,r.fromBytes(ee[ge]));if(!S.verify($,le,Ae,ue)){let ge=[];for(let ve of se)this.verifyShare(q,W,$,ve,ee[ve])||ge.push(ve);throw new Gc("aggregation failed",ge)}return g.encode(le,Ae)},sign(q,W){let $=r.fromBytes(W);e.adjustScalar&&($=e.adjustScalar($));let[ee,se]=S.sign(q,$);return g.encode(ee,se)},verify(q,W,$){let ee=e.parsePublicKey?e.parsePublicKey($):C($),{R:se,z:ue}=g.decode(q);return S.verify(W,se,ue,ee)},combineSecret(q,W){if(bp(W),!Array.isArray(q)||q.length<W.min)throw new Error("wrong secret shares array");let $=[],ee={};for(let le of q){let Ae=B(le.identifier),ge=G(Ae);if(ee[ge])throw new Error("duplicated id="+ge);ee[ge]=!0,$.push([Ae,r.fromBytes(le.signingShare)])}let se=$.map(([le])=>le),ue=r.ZERO;for(let[le,Ae]of $)ue=r.add(ue,r.mul(Ae,b(se,le)));return r.toBytes(ue)},utils:Object.freeze({Fn:r,randomScalar:(q=ki)=>r.toBytes(O(q).scalar),generateSecretPolynomial:(q,W,$,ee)=>{let se=I(q,W,$,ee);return{...se,commitment:se.commitment.map(N)}}})};return Object.freeze(pe)}var bp,pA,Gc,gA=Xr(()=>{v();gs();Ju();yp();fA();Kc();bp=e=>{if(!Number.isSafeInteger(e.min)||!Number.isSafeInteger(e.max))throw new Error("Wrong signers info: min="+e.min+" max="+e.max);if(e.min<2||e.max<2||e.min>e.max)throw new Error("Wrong signers info: min="+e.min+" max="+e.max)},pA=(e,t)=>{if(t<e.min||t>e.max)throw new Error("Wrong number of commitments="+t)},Gc=class extends Error{constructor(r,i){super(r);Z(this,"cheaters");this.cheaters=i}}});var dy={};Q1(dy,{_HMAC:()=>h0,hmac:()=>hy});var h0,hy,_p=Xr(()=>{v();gs();h0=class{constructor(t,r){Z(this,"oHash");Z(this,"iHash");Z(this,"blockLen");Z(this,"outputLen");Z(this,"canXOF",!1);Z(this,"finished",!1);Z(this,"destroyed",!1);if(X2(t),Eo(r,void 0,"key"),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;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=t.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),Sa(n)}update(t){return Dc(this),this.iHash.update(t),this}digestInto(t){Dc(this),J2(t,this),this.finished=!0;let r=t.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:i,finished:n,destroyed:o,blockLen:a,outputLen:s}=this;return t=t,t.finished=n,t.destroyed=o,t.blockLen=a,t.outputLen=s,t.oHash=r._cloneInto(t.oHash),t.iHash=i._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},hy=(()=>{let e=((t,r,i)=>new h0(t,r).update(i).digest());return e.create=(t,r)=>new h0(t,r),e})()});function X$(e,t,r){ty("scalar",e,gn,r);let[[i,n],[o,a]]=t,s=vA(a*e,r),u=vA(-n*e,r),c=e-s*i-u*o,l=-s*n-u*a,m=c<gn,w=l<gn;m&&(c=-c),w&&(l=-l);let E=Hc(Math.ceil(Xu(r)/2))+Kr;if(c<gn||c>=E||l<gn||l>=E)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:m,k1:c,k2neg:w,k2:l}}function gy(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function py(e,t){pn(e);let r={};for(let i of Object.keys(t))r[i]=e[i]===void 0?t[i]:e[i];return $u(r.lowS,"lowS"),$u(r.prehash,"prehash"),r.format!==void 0&&gy(r.format),r}function mA(e,t={}){let r=aA("weierstrass",e,t),i=r.Fp,n=r.Fn,o=r.CURVE,{h:a,n:s}=o;pn(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:u,allowInfinityPoint:c}=t;if(u&&(!i.is0(o.a)||typeof u.beta!="bigint"||!Array.isArray(u.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let l=_A(i,n);function m(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function w(O,y,f){if(c&&y.is0())return Uint8Array.of(0);let{x:d,y:_}=y.toAffine(),x=i.toBytes(d);if($u(f,"isCompressed"),f){m();let b=!i.isOdd(_);return kt(yA(b),x)}else return kt(Uint8Array.of(4),x,i.toBytes(_))}function E(O){qt(O,void 0,"Point");let{publicKey:y,publicKeyUncompressed:f}=l,d=O.length,_=O[0],x=O.subarray(1);if(c&&d===1&&_===0)return{x:i.ZERO,y:i.ZERO};if(d===y&&(_===2||_===3)){let b=i.fromBytes(x);if(!i.isValid(b))throw new Error("bad point: is not on curve, wrong x");let p=D(b),I;try{I=i.sqrt(p)}catch(R){let Y=R instanceof Error?": "+R.message:"";throw new Error("bad point: is not on curve, sqrt error"+Y)}m();let T=i.isOdd(I);return(_&1)===1!==T&&(I=i.neg(I)),{x:b,y:I}}else if(d===f&&_===4){let b=i.BYTES,p=i.fromBytes(x.subarray(0,b)),I=i.fromBytes(x.subarray(b,b*2));if(!L(p,I))throw new Error("bad point: is not on curve");return{x:p,y:I}}else throw new Error(`bad point: got length ${d}, expected compressed=${y} or uncompressed=${f}`)}let P=t.toBytes===void 0?w:t.toBytes,M=t.fromBytes===void 0?E:t.fromBytes;function D(O){let y=i.sqr(O),f=i.mul(y,O);return i.add(i.add(f,i.mul(O,o.a)),o.b)}function L(O,y){let f=i.sqr(y),d=D(O);return i.eql(f,d)}if(!L(o.Gx,o.Gy))throw new Error("bad curve params: generator point");let U=i.mul(i.pow(o.a,Zc),my),K=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(U,K)))throw new Error("bad curve params: a or b");function N(O,y,f=!1){if(!i.isValid(y)||f&&i.is0(y))throw new Error(`bad point coordinate ${O}`);return y}function C(O){if(!(O instanceof z))throw new Error("Weierstrass Point expected")}function F(O){if(!u||!u.basises)throw new Error("no endo");return X$(O,u.basises,n.ORDER)}function H(O,y,f,d,_){return f=new z(i.mul(f.X,O),f.Y,f.Z),y=l0(d,y),f=l0(_,f),y.add(f)}let g=class g{constructor(y,f,d){Z(this,"X");Z(this,"Y");Z(this,"Z");this.X=N("x",y),this.Y=N("y",f,!0),this.Z=N("z",d),Object.freeze(this)}static CURVE(){return o}static fromAffine(y){let{x:f,y:d}=y||{};if(!y||!i.isValid(f)||!i.isValid(d))throw new Error("invalid affine point");if(y instanceof g)throw new Error("projective point not allowed");return i.is0(f)&&i.is0(d)?g.ZERO:new g(f,d,i.ONE)}static fromBytes(y){let f=g.fromAffine(M(qt(y,void 0,"point")));return f.assertValidity(),f}static fromHex(y){return g.fromBytes(qc(y))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(y=8,f=!0){return B.createCache(this,y),f||this.multiply(Zc),this}assertValidity(){let y=this;if(y.is0()){if(t.allowInfinityPoint&&i.is0(y.X)&&i.eql(y.Y,i.ONE)&&i.is0(y.Z))return;throw new Error("bad point: ZERO")}let{x:f,y:d}=y.toAffine();if(!i.isValid(f)||!i.isValid(d))throw new Error("bad point: x or y not field elements");if(!L(f,d))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(y)}equals(y){C(y);let{X:f,Y:d,Z:_}=this,{X:x,Y:b,Z:p}=y,I=i.eql(i.mul(f,p),i.mul(x,_)),T=i.eql(i.mul(d,p),i.mul(b,_));return I&&T}negate(){return new g(this.X,i.neg(this.Y),this.Z)}double(){let{a:y,b:f}=o,d=i.mul(f,Zc),{X:_,Y:x,Z:b}=this,p=i.ZERO,I=i.ZERO,T=i.ZERO,S=i.mul(_,_),R=i.mul(x,x),Y=i.mul(b,b),X=i.mul(_,x);return X=i.add(X,X),T=i.mul(_,b),T=i.add(T,T),p=i.mul(y,T),I=i.mul(d,Y),I=i.add(p,I),p=i.sub(R,I),I=i.add(R,I),I=i.mul(p,I),p=i.mul(X,p),T=i.mul(d,T),Y=i.mul(y,Y),X=i.sub(S,Y),X=i.mul(y,X),X=i.add(X,T),T=i.add(S,S),S=i.add(T,S),S=i.add(S,Y),S=i.mul(S,X),I=i.add(I,S),Y=i.mul(x,b),Y=i.add(Y,Y),S=i.mul(Y,X),p=i.sub(p,S),T=i.mul(Y,R),T=i.add(T,T),T=i.add(T,T),new g(p,I,T)}add(y){C(y);let{X:f,Y:d,Z:_}=this,{X:x,Y:b,Z:p}=y,I=i.ZERO,T=i.ZERO,S=i.ZERO,R=o.a,Y=i.mul(o.b,Zc),X=i.mul(f,x),ne=i.mul(d,b),ce=i.mul(_,p),pe=i.add(f,d),q=i.add(x,b);pe=i.mul(pe,q),q=i.add(X,ne),pe=i.sub(pe,q),q=i.add(f,_);let W=i.add(x,p);return q=i.mul(q,W),W=i.add(X,ce),q=i.sub(q,W),W=i.add(d,_),I=i.add(b,p),W=i.mul(W,I),I=i.add(ne,ce),W=i.sub(W,I),S=i.mul(R,q),I=i.mul(Y,ce),S=i.add(I,S),I=i.sub(ne,S),S=i.add(ne,S),T=i.mul(I,S),ne=i.add(X,X),ne=i.add(ne,X),ce=i.mul(R,ce),q=i.mul(Y,q),ne=i.add(ne,ce),ce=i.sub(X,ce),ce=i.mul(R,ce),q=i.add(q,ce),X=i.mul(ne,q),T=i.add(T,X),X=i.mul(W,q),I=i.mul(pe,I),I=i.sub(I,X),X=i.mul(pe,ne),S=i.mul(W,S),S=i.add(S,X),new g(I,T,S)}subtract(y){return C(y),this.add(y.negate())}is0(){return this.equals(g.ZERO)}multiply(y){let{endo:f}=t;if(!n.isValidNot0(y))throw new RangeError("invalid scalar: out of range");let d,_,x=b=>B.cached(this,b,p=>uy(g,p));if(f){let{k1neg:b,k1:p,k2neg:I,k2:T}=F(y),{p:S,f:R}=x(p),{p:Y,f:X}=x(T);_=R.add(X),d=H(f.beta,S,Y,b,I)}else{let{p:b,f:p}=x(y);d=b,_=p}return uy(g,[d,_])[0]}multiplyUnsafe(y){let{endo:f}=t,d=this,_=y;if(!n.isValid(_))throw new RangeError("invalid scalar: out of range");if(_===gn||d.is0())return g.ZERO;if(_===Kr)return d;if(B.hasCache(this))return this.multiply(_);if(f){let{k1neg:x,k1:b,k2neg:p,k2:I}=F(_),{p1:T,p2:S}=nA(g,d,b,I);return H(f.beta,T,S,x,p)}else return B.unsafe(d,_)}toAffine(y){let f=this,d=y,{X:_,Y:x,Z:b}=f;if(i.eql(b,i.ONE))return{x:_,y:x};let p=f.is0();d==null&&(d=p?i.ONE:i.inv(b));let I=i.mul(_,d),T=i.mul(x,d),S=i.mul(b,d);if(p)return{x:i.ZERO,y:i.ZERO};if(!i.eql(S,i.ONE))throw new Error("invZ was invalid");return{x:I,y:T}}isTorsionFree(){let{isTorsionFree:y}=t;return a===Kr?!0:y?y(g,this):B.unsafe(this,s).is0()}clearCofactor(){let{clearCofactor:y}=t;return a===Kr?this:y?y(g,this):this.multiplyUnsafe(a)}isSmallOrder(){return a===Kr?this.is0():this.clearCofactor().is0()}toBytes(y=!0){return $u(y,"isCompressed"),this.assertValidity(),P(g,this,y)}toHex(y=!0){return Ia(this.toBytes(y))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}};Z(g,"BASE",new g(o.Gx,o.Gy,i.ONE)),Z(g,"ZERO",new g(i.ZERO,i.ONE,i.ZERO)),Z(g,"Fp",i),Z(g,"Fn",n);let z=g,G=n.BITS,B=new vp(z,t.endo?Math.ceil(G/2):G);return G>=8&&z.BASE.precompute(8),Object.freeze(z.prototype),Object.freeze(z),z}function yA(e){return Uint8Array.of(e?2:3)}function J$(e,t){let r=ef(e),i=r.ORDER,n=gn;for(let M=i-Kr;M%Io===gn;M/=Io)n+=Kr;let o=n,a=Io<<o-Kr-Kr,s=a*Io,u=(i-Kr)/s,c=(u-Kr)/Io,l=s-Kr,m=a,w=r.pow(t,u),E=r.pow(t,(u+Kr)/Io),P=(M,D)=>{let L=w,U=r.pow(D,l),K=r.sqr(U);K=r.mul(K,D);let N=r.mul(M,K);N=r.pow(N,c),N=r.mul(N,U),U=r.mul(N,D),K=r.mul(N,M);let C=r.mul(K,U);N=r.pow(C,m);let F=r.eql(N,r.ONE);U=r.mul(K,E),N=r.mul(C,L),K=r.cmov(U,K,F),C=r.cmov(N,C,F);for(let H=o;H>Kr;H--){let z=H-Io;z=Io<<z-Kr;let G=r.pow(C,z),B=r.eql(G,r.ONE);U=r.mul(K,L),L=r.mul(L,L),G=r.mul(C,L),K=r.cmov(U,K,B),C=r.cmov(G,C,B)}return{isValid:!r.is0(D)&&(F||r.is0(M)),value:K}};if(r.ORDER%my===Zc){let M=(r.ORDER-Zc)/my,D=r.sqrt(r.neg(t));P=(L,U)=>{let K=r.sqr(U),N=r.mul(L,U);K=r.mul(K,N);let C=r.pow(K,M);C=r.mul(C,N);let F=r.mul(C,D),H=r.mul(r.sqr(C),U),z=r.eql(H,L),G=r.cmov(F,C,z);return{isValid:!r.is0(U)&&z,value:G}}}return P}function bA(e,t){let r=ef(e),{A:i,B:n,Z:o}=t;if(!r.isValidNot0(i)||!r.isValidNot0(n)||!r.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");if(r.eql(o,r.neg(r.ONE))||ny(r,o))throw new Error("mapToCurveSimpleSWU: invalid opts");let a=r.mul(n,r.inv(r.mul(o,i))),s=r.add(r.add(r.mul(r.sqr(a),a),r.mul(i,a)),n);if(!ny(r,s))throw new Error("mapToCurveSimpleSWU: invalid opts");let u=J$(r,o);if(!r.isOdd)throw new Error("Field does not have .isOdd()");return c=>{let l,m,w,E,P,M,D,L;l=r.sqr(c),l=r.mul(l,o),m=r.sqr(l),m=r.add(m,l),w=r.add(m,r.ONE),w=r.mul(w,n),E=r.cmov(o,r.neg(m),!r.eql(m,r.ZERO)),E=r.mul(E,i),m=r.sqr(w),M=r.sqr(E),P=r.mul(M,i),m=r.add(m,P),m=r.mul(m,w),M=r.mul(M,E),P=r.mul(M,n),m=r.add(m,P),D=r.mul(l,w);let{isValid:U,value:K}=u(m,M);L=r.mul(l,c),L=r.mul(L,K),D=r.cmov(D,w,U),L=r.cmov(L,K,U);let N=r.isOdd(c)===r.isOdd(L);L=r.cmov(r.neg(L),L,N);let C=tf(r,[E],!0)[0];return D=r.mul(D,C),{x:D,y:L}}}function _A(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Q$(e,t={}){let{Fn:r}=e,i=t.randomBytes===void 0?ki:t.randomBytes,n=Object.assign(_A(e.Fp,r),{seed:Math.max(c0(r.ORDER),16)});function o(E){try{let P=r.fromBytes(E);return r.isValidNot0(P)}catch{return!1}}function a(E,P){let{publicKey:M,publicKeyUncompressed:D}=n;try{let L=E.length;return P===!0&&L!==M||P===!1&&L!==D?!1:!!e.fromBytes(E)}catch{return!1}}function s(E){return E=E===void 0?i(n.seed):E,zc(qt(E,n.seed,"seed"),r.ORDER)}function u(E,P=!0){return e.BASE.multiply(r.fromBytes(E)).toBytes(P)}function c(E){let{secretKey:P,publicKey:M,publicKeyUncompressed:D}=n,L=r._lengths;if(!Yu(E))return;let U=qt(E,void 0,"key").length,K=U===M||U===D,N=U===P||!!L?.includes(U);if(!(K&&N))return K}function l(E,P,M=!0){if(c(E)===!0)throw new Error("first arg must be private key");if(c(P)===!1)throw new Error("second arg must be public key");let D=r.fromBytes(E);return e.fromBytes(P).multiply(D).toBytes(M)}let m={isValidSecretKey:o,isValidPublicKey:a,randomSecretKey:s},w=mp(s,u);return Object.freeze(m),Object.freeze(n),Object.freeze({getPublicKey:u,getSharedSecret:l,keygen:w,Point:e,utils:m,lengths:n})}function wA(e,t,r={}){let i=t;X2(i),pn(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes===void 0?ki:r.randomBytes,o=r.hmac===void 0?(d,_)=>hy(i,d,_):r.hmac,{Fp:a,Fn:s}=e,{ORDER:u,BITS:c}=s,{keygen:l,getPublicKey:m,getSharedSecret:w,utils:E,lengths:P}=Q$(e,r),M={prehash:!0,lowS:typeof r.lowS=="boolean"?r.lowS:!0,format:"compact",extraEntropy:!1},D=u*Io+Kr<a.ORDER;function L(d){let _=u>>Kr;return d>_}function U(d,_){if(!s.isValidNot0(_))throw new Error(`invalid signature ${d}: out of range 1..Point.Fn.ORDER`);return _}function K(){if(D)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function N(d,_){gy(_);let x=P.signature,b=_==="compact"?x:_==="recovered"?x+1:void 0;return qt(d,b)}class C{constructor(_,x,b){Z(this,"r");Z(this,"s");Z(this,"recovery");if(this.r=U("r",_),this.s=U("s",x),b!=null){if(K(),![0,1,2,3].includes(b))throw new Error("invalid recovery id");this.recovery=b}Object.freeze(this)}static fromBytes(_,x=M.format){N(_,x);let b;if(x==="der"){let{r:S,s:R}=Hn.toSig(qt(_));return new C(S,R)}x==="recovered"&&(b=_[0],x="compact",_=_.subarray(1));let p=P.signature/2,I=_.subarray(0,p),T=_.subarray(p,p*2);return new C(s.fromBytes(I),s.fromBytes(T),b)}static fromHex(_,x){return this.fromBytes(qc(_),x)}assertRecovery(){let{recovery:_}=this;if(_==null)throw new Error("invalid recovery id: must be present");return _}addRecoveryBit(_){return new C(this.r,this.s,_)}recoverPublicKey(_){let{r:x,s:b}=this,p=this.assertRecovery(),I=p===2||p===3?x+u:x;if(!a.isValid(I))throw new Error("invalid recovery id: sig.r+curve.n != R.x");let T=a.toBytes(I),S=e.fromBytes(kt(yA((p&1)===0),T)),R=s.inv(I),Y=H(qt(_,void 0,"msgHash")),X=s.create(-Y*R),ne=s.create(b*R),ce=e.BASE.multiplyUnsafe(X).add(S.multiplyUnsafe(ne));if(ce.is0())throw new Error("invalid recovery: point at infinify");return ce.assertValidity(),ce}hasHighS(){return L(this.s)}toBytes(_=M.format){if(gy(_),_==="der")return qc(Hn.hexFromSig(this));let{r:x,s:b}=this,p=s.toBytes(x),I=s.toBytes(b);return _==="recovered"?(K(),kt(Uint8Array.of(this.assertRecovery()),p,I)):kt(p,I)}toHex(_){return Ia(this.toBytes(_))}}Object.freeze(C.prototype),Object.freeze(C);let F=r.bits2int===void 0?function(_){if(_.length>8192)throw new Error("input is too large");let x=bi(_),b=_.length*8-c;return b>0?x>>BigInt(b):x}:r.bits2int,H=r.bits2int_modN===void 0?function(_){return s.create(F(_))}:r.bits2int_modN,z=Hc(c);function G(d){return ty("num < 2^"+c,d,gn,z),s.toBytes(d)}function B(d,_){return qt(d,void 0,"message"),_?qt(i(d),void 0,"prehashed message"):d}function g(d,_,x){let{lowS:b,prehash:p,extraEntropy:I}=py(x,M);d=B(d,p);let T=H(d),S=s.fromBytes(_);if(!s.isValidNot0(S))throw new Error("invalid private key");let R=[G(S),G(T)];if(I!=null&&I!==!1){let ce=I===!0?n(P.secretKey):I;R.push(qt(ce,void 0,"extraEntropy"))}let Y=kt(...R),X=T;function ne(ce){let pe=F(ce);if(!s.isValidNot0(pe))return;let q=s.inv(pe),W=e.BASE.multiply(pe).toAffine(),$=s.create(W.x);if($===gn)return;let ee=s.create(q*s.create(X+$*S));if(ee===gn)return;let se=(W.x===$?0:2)|Number(W.y&Kr),ue=ee;return b&&L(ee)&&(ue=s.neg(ee),se^=1),new C($,ue,D?void 0:se)}return{seed:Y,k2sig:ne}}function O(d,_,x={}){let{seed:b,k2sig:p}=g(d,_,x);return HI(i.outputLen,s.BYTES,o)(b,p).toBytes(x.format)}function y(d,_,x,b={}){let{lowS:p,prehash:I,format:T}=py(b,M);if(x=qt(x,void 0,"publicKey"),_=B(_,I),!Yu(d)){let S=d instanceof C?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+S)}N(d,T);try{let S=C.fromBytes(d,T),R=e.fromBytes(x);if(p&&S.hasHighS())return!1;let{r:Y,s:X}=S,ne=H(_),ce=s.inv(X),pe=s.create(ne*ce),q=s.create(Y*ce),W=e.BASE.multiplyUnsafe(pe).add(R.multiplyUnsafe(q));return W.is0()?!1:s.create(W.x)===Y}catch{return!1}}function f(d,_,x={}){let{prehash:b}=py(x,M);return _=B(_,b),C.fromBytes(d,"recovered").recoverPublicKey(_).toBytes()}return Object.freeze({keygen:l,getPublicKey:m,getSharedSecret:w,utils:E,lengths:P,Point:e,sign:O,verify:y,recoverPublicKey:f,Signature:C,hash:i})}var vA,vy,Hn,gn,Kr,Io,Zc,my,SA=Xr(()=>{v();_p();gs();Ju();yp();Kc();vA=(e,t)=>(e+(e>=0?t:-t)/Io)/t;vy=class extends Error{constructor(t=""){super(t)}},Hn={Err:vy,_tlv:{encode:(e,t)=>{let{Err:r}=Hn;if(dn(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if(typeof t!="string")throw new TypeError('"data" expected string, got type='+typeof t);if(t.length&1)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=f0(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?f0(n.length/2|128):"";return f0(e)+o+n+t},decode(e,t){let{Err:r}=Hn;t=qt(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[i++],o=!!(n&128),a=0;if(!o)a=n;else{let u=n&127;if(!u)throw new r("tlv.decode(long): indefinite length not supported");if(u>4)throw new r("tlv.decode(long): byte length is too big");let c=t.subarray(i,i+u);if(c.length!==u)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let l of c)a=a<<8|l;if(i+=u,a<128)throw new r("tlv.decode(long): not minimal encoding")}let s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){let{Err:t}=Hn;if(hp(e),e<gn)throw new t("integer: negative integers are not allowed");let r=f0(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Hn;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return bi(e)}},toSig(e){let{Err:t,_int:r,_tlv:i}=Hn,n=qt(e,void 0,"signature"),{v:o,l:a}=i.decode(48,n);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:s,l:u}=i.decode(2,o),{v:c,l}=i.decode(2,u);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(s),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=Hn,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s)),o=i+n;return t.encode(48,o)}};Object.freeze(Hn._tlv);Object.freeze(Hn._int);Object.freeze(Hn);gn=BigInt(0),Kr=BigInt(1),Io=BigInt(2),Zc=BigInt(3),my=BigInt(4)});var p0={};Q1(p0,{__TEST:()=>nX,schnorr:()=>oX,schnorr_FROST:()=>hX,secp256k1:()=>rX,secp256k1_FROST:()=>uX,secp256k1_hasher:()=>_y});function tX(e){let t=wp.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,m=Fi(l,r,t)*l%t,w=Fi(m,r,t)*l%t,E=Fi(w,yy,t)*c%t,P=Fi(E,n,t)*E%t,M=Fi(P,o,t)*P%t,D=Fi(M,s,t)*M%t,L=Fi(D,u,t)*D%t,U=Fi(L,s,t)*M%t,K=Fi(U,r,t)*l%t,N=Fi(K,a,t)*P%t,C=Fi(N,i,t)*c%t,F=Fi(C,yy,t);if(!Aa.eql(Aa.sqr(F),e))throw new Error("Cannot find square root");return F}function d0(e,...t){let r=xA[e];if(r===void 0){let i=bs(Fc(e));r=kt(i,i),xA[e]=r}return bs(kt(r,...t))}function AA(e){let{Fn:t,BASE:r}=Ut,i=t.fromBytes(e),n=r.multiply(i);return{scalar:Ao(n.y)?i:t.neg(i),bytes:of(n)}}function Sp(e){let t=Aa;if(!t.isValidNot0(e))throw new Error("invalid x: Fail if x \u2265 p");let r=t.create(e*e),i=t.create(r*e+BigInt(7)),n=t.sqrt(i);Ao(n)||(n=t.neg(n));let o=Ut.fromAffine({x:e,y:n});return o.assertValidity(),o}function by(...e){return Ut.Fn.create(Wc(d0("BIP0340/challenge",...e)))}function EA(e){return AA(e).bytes}function iX(e,t,r=o0(32)){let{Fn:i,BASE:n}=Ut,o=qt(e,void 0,"message"),{bytes:a,scalar:s}=AA(t),u=qt(r,32,"auxRand"),c=i.toBytes(s^Wc(d0("BIP0340/aux",u))),l=d0("BIP0340/nonce",c,a,o),m=i.create(Wc(l));if(m===0n)throw new Error("sign failed: k is zero");let w=n.multiply(m),E=Ao(w.y)?m:i.neg(m),P=of(w),M=by(P,a,o),D=new Uint8Array(64);if(D.set(P,0),D.set(i.toBytes(i.create(E+M*s)),32),!PA(D,o,a))throw new Error("sign: Invalid signature produced");return D}function PA(e,t,r){let{Fp:i,Fn:n,BASE:o}=Ut,a=qt(e,64,"signature"),s=qt(t,void 0,"message"),u=qt(r,32,"publicKey");try{let c=Sp(Wc(u)),l=Wc(a.subarray(0,32));if(!i.isValidNot0(l))return!1;let m=Wc(a.subarray(32,64));if(!n.isValidNot0(m))return!1;let w=by(n.toBytes(l),of(c),s),E=o.multiplyUnsafe(m).add(c.multiplyUnsafe(n.neg(w))),{x:P,y:M}=E.toAffine();return!(E.is0()||!Ao(M)||P!==l)}catch{return!1}}function TA(e,t){if(t===void 0)return IA;let r=of(e),i=bi(d0("TapTweak",r,t));if(!Ut.Fn.isValid(i))throw new Error("invalid TapTweak hash");return i}function wy(e){let t=Ut.fromBytes(e.commitments[0]);return Ao(t.y)?e:{signers:{min:e.signers.min,max:e.signers.max},commitments:e.commitments.map(r=>Ut.fromBytes(r).negate().toBytes()),verifyingShares:Object.fromEntries(Object.entries(e.verifyingShares).map(([r,i])=>[r,Ut.fromBytes(i).negate().toBytes()]))}}function kA(e,t){let r=Ut.fromBytes(t.commitments[0]);if(Ao(r.y))return e;let i=Ut.Fn;return{...e,signingShare:i.toBytes(i.neg(i.fromBytes(e.signingShare)))}}function fX(e,t){if(Ao(e.y))return t;let r=Ut.Fn;return{binding:r.toBytes(r.neg(r.fromBytes(t.binding))),hiding:r.toBytes(r.neg(r.fromBytes(t.hiding)))}}function cX(e,t,r){let i=Ut.Fn,n=kA(e,t),o=wy(t),a=TA(Ut.fromBytes(o.commitments[0]),r),s=i.toBytes(i.add(i.fromBytes(n.signingShare),a));return{identifier:n.identifier,signingShare:s}}function lX(e,t){let r=wy(e),i=TA(Ut.fromBytes(r.commitments[0]),t),n=Ut.BASE.multiply(i),o=r.commitments.map((s,u)=>(u===0?Ut.fromBytes(s).add(n):Ut.fromBytes(s)).toBytes()),a={};for(let s in r.verifyingShares)a[s]=Ut.fromBytes(r.verifyingShares[s]).add(n).toBytes();return{signers:{min:r.signers.min,max:r.signers.max},commitments:o,verifyingShares:a}}var wp,eX,IA,yy,Aa,Ut,rX,xA,of,Ao,Wc,nX,oX,aX,OA,sX,_y,uX,hX,g0=Xr(()=>{v();fp();gs();yp();gA();dA();Kc();SA();Ju();wp={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},eX={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},IA=BigInt(0),yy=BigInt(2);Aa=jc(wp.p,{sqrt:tX}),Ut=mA(wp,{Fp:Aa,endo:eX}),rX=wA(Ut,bs),xA={};of=e=>e.toBytes(!0).slice(1),Ao=e=>e%yy===IA;Wc=bi;nX=Object.freeze({lift_x:Sp}),oX=(()=>{let r=i=>(i=i===void 0?o0(48):i,zc(i,wp.n));return Object.freeze({keygen:mp(r,EA),getPublicKey:EA,sign:iX,verify:PA,Point:Ut,utils:Object.freeze({randomSecretKey:r,taggedHash:d0,lift_x:Sp,pointToBytes:of}),lengths:Object.freeze({secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48})})})(),aX=lA(Aa,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),sX=()=>OA||(OA=bA(Aa,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Aa.create(BigInt("-11"))})),_y=hA(Ut,e=>{let{x:t,y:r}=sX()(Aa.create(e[0]));return aX(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Aa.ORDER,m:1,k:128,expand:"xmd",hash:bs}),uX=ly({name:"FROST-secp256k1-SHA256-v1",Point:Ut,hashToScalar:_y.hashToScalar,hash:bs});hX=ly({name:"FROST-secp256k1-SHA256-TR-v1",Point:Ut,hashToScalar:_y.hashToScalar,hash:bs,parsePublicKey(e){if(e.length===32)return Sp(bi(e));if(e.length===33)return Ut.fromBytes(e);throw new Error(`expected x-only or compressed public key, got length=${e.length}`)},adjustScalar(e){let t=Ut.BASE.multiply(e);return Ao(t.y)?e:Ut.Fn.neg(e)},adjustPoint:e=>Ao(e.y)?e:e.negate(),challenge(e,t,r){return by(of(e),of(t),r)},adjustNonces:fX,adjustGroupCommitmentShare:(e,t)=>Ao(e.y)?t:t.negate(),adjustPublic:wy,adjustSecret:kA,adjustTx:{encode:e=>e.subarray(1),decode:e=>kt(Uint8Array.of(2),e)},adjustDKG:e=>{let t=new Uint8Array(0);return{public:lX(e.public,t),secret:cX(e.secret,e.public,t)}}})});var vn=k((v2e,NA)=>{"use strict";v();var RA=fr(),{secp256k1:dX}=(g0(),lo(p0)),m0=dX.Point,xp=m0.Fn.ORDER;function pX(e){return BigInt("0x"+(e.toString(16)||"0"))}function Sy(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new RA(t,16)}function Ep(e){if(e==null)throw new Error("Invalid Point");if(typeof e=="bigint")return e;if(typeof e=="number")return BigInt(e);if(typeof e=="string")return BigInt(e.indexOf("0x")===0?e:"0x"+e);if(typeof e.toString=="function")return pX(e);throw new Error("Invalid Point")}function v0(e){var t=Object.create(Ft.prototype);return t._p=e,t}function BA(e,t){var r=Ep(t).toString(16).padStart(64,"0");return m0.fromHex((e?"03":"02")+r)}function MA(e,t){var r;try{r=BA((t&1n)===1n,e)}catch{throw new Error("Point does not lie on the curve")}if(r.toAffine().y!==t)throw new Error("Invalid y value for curve.")}function Ft(e,t,r){if(!(this instanceof Ft))return new Ft(e,t,r);var i,n;try{i=Ep(e),n=Ep(t)}catch{throw new Error("Invalid Point")}MA(i,n);try{this._p=m0.fromAffine({x:i,y:n})}catch{throw new Error("Invalid Point")}return this}Ft.fromX=function(t,r){try{var i=v0(BA(t,r))}catch{throw new Error("Invalid X")}return i.validate(),i};Ft.getG=function(){return v0(m0.BASE)};Ft.getN=function(){return Sy(xp)};Ft.prototype.getX=function(){return Sy(this._p.toAffine().x)};Ft.prototype.getY=function(){return Sy(this._p.toAffine().y)};Object.defineProperty(Ft.prototype,"x",{configurable:!0,enumerable:!0,get:function(){return this.getX()}});Object.defineProperty(Ft.prototype,"y",{configurable:!0,enumerable:!0,get:function(){return this.getY()}});Ft.prototype.mul=function(t){var r=(Ep(t)%xp+xp)%xp;return r===0n||this._p.is0()?v0(m0.ZERO):v0(this._p.multiply(r))};Ft.prototype.add=function(t){return v0(this._p.add(t._p))};Ft.prototype.mulAdd=function(t,r,i){return this.mul(t).add(r.mul(i))};Ft.prototype.eq=function(t){return this._p.equals(t._p)};Ft.prototype.isInfinity=function(){return this._p.is0()};Ft.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var t=this._p.toAffine();return MA(t.x,t.y),this};Ft.pointToCompressed=function(t){var r=t.getX().toBuffer({size:32}),i=t.getY().toBuffer({size:32}),n,o=i[i.length-1]%2;return o?n=h.Buffer.from([3]):n=h.Buffer.from([2]),h.Buffer.concat([n,r])};Ft.pointFromCompressed=function(e){if(e.length!==33)throw new Error("invalid buffer length");var t=e[0],r;if(t===3)r=!0;else if(t===2)r=!1;else throw new Error("invalid value of compressed prefix");var i=RA.fromBuffer(e.slice(1,33));return Ft.fromX(r,i)};Ft.prototype.toBuffer=function(){return Ft.pointToCompressed(this)};Ft.prototype.toHex=function(){return this.toBuffer().toString("hex")};Ft.fromBuffer=function(e){return Ft.pointFromCompressed(e)};Ft.fromHex=function(e){return Ft.fromBuffer(h.Buffer.from(e,"hex"))};NA.exports=Ft});var pi=k((y2e,LA)=>{"use strict";v();var DA=xt(),gX=Bt(),CA=function(t){return DA.isString(t)?/^[0-9a-fA-F]+$/.test(t):!1};LA.exports={isValidJSON:function(t){var r;if(!DA.isString(t))return!1;try{r=JSON.parse(t)}catch{return!1}return typeof r=="object"},isHexa:CA,isHexaString:CA,defineImmutable:function(t,r){return Object.keys(r).forEach(function(i){Object.defineProperty(t,i,{configurable:!1,enumerable:!0,value:r[i]})}),t},isNaturalNumber:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&t>=0},integerAsBuffer:function(t){gX.checkArgumentType(t,"number","integer");let r=h.Buffer.allocUnsafe(4);return r.writeUInt32BE(t,0),r}}});var Vr=k((_2e,UA)=>{"use strict";v();var af=fr(),vX=xt(),_i=Bt(),mX=pi(),mt=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof af)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};mt.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=typeof e.i<"u"?e.i:this.i,this.compressed=typeof e.compressed<"u"?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this};mt.fromCompact=function(e){_i.checkArgument(h.Buffer.isBuffer(e),"Argument is expected to be a Buffer");var t=new mt,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i=i+4);var n=e.slice(1,33),o=e.slice(33,65);return _i.checkArgument(i===0||i===1||i===2||i===3,new Error("i must be 0, 1, 2, or 3")),_i.checkArgument(n.length===32,new Error("r must be 32 bytes")),_i.checkArgument(o.length===32,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=af.fromBuffer(n),t.s=af.fromBuffer(o),t};mt.fromDER=mt.fromBuffer=function(e,t){var r=mt.parseDER(e,t),i=new mt;return i.r=r.r,i.s=r.s,i};mt.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=mt.fromDER(r,!1);return i.nhashtype=t,i};mt.fromString=function(e){var t=h.Buffer.from(e,"hex");return mt.fromDER(t)};function qA(e,t){_i.checkArgument(t.length>0,new Error("Length of "+e+" is zero")),_i.checkArgument(!(t[0]&128),new Error("Value of "+e+" is negative")),_i.checkArgument(!(t.length>1&&t[0]===0&&!(t[1]&128)),new Error("Value of "+e+" is excessively padded"))}mt.parseDER=function(e,t){_i.checkArgument(h.Buffer.isBuffer(e),new Error("DER formatted signature should be a buffer")),vX.isUndefined(t)&&(t=!0);var r=e[0];_i.checkArgument(r===48,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;_i.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i<n?i:n;var o=e[2];_i.checkArgument(o===2,new Error("Integer byte for r should be 0x02"));var a=e[3],s=e.slice(4,4+a),u=af.fromBuffer(s),c=e[4]===0;_i.checkArgument(a===s.length,new Error("Length of r incorrect"));var l=e[4+a+0];_i.checkArgument(l===2,new Error("Integer byte for s should be 0x02"));var m=e[4+a+1],w=e.slice(4+a+2,4+a+2+m),E=af.fromBuffer(w),P=e[4+a+2]===0;_i.checkArgument(m===w.length,new Error("Length of s incorrect"));var M=4+a+2+m;_i.checkArgument(i===M-2,new Error("Length of signature incorrect")),t&&(qA("r",s),qA("s",w));var D={header:r,length:i,rheader:o,rlength:a,rneg:c,rbuf:s,r:u,sheader:l,slength:m,sneg:P,sbuf:w,s:E};return D};mt.prototype.toCompact=function(e,t){if(e=typeof e=="number"?e:this.i,t=typeof t=="boolean"?t:this.compressed,!(e===0||e===1||e===2||e===3))throw new Error("i must be equal to 0, 1, 2, or 3");var r=e+27+4;t===!1&&(r=r-4);var i=h.Buffer.from([r]),n=this.r.toBuffer({size:32}),o=this.s.toBuffer({size:32});return h.Buffer.concat([i,n,o])};mt.prototype.toBuffer=mt.prototype.toDER=function(){var e=this.r.toBuffer(),t=this.s.toBuffer(),r=!!(e[0]&128),i=!!(t[0]&128),n=r?h.Buffer.concat([h.Buffer.from([0]),e]):e,o=i?h.Buffer.concat([h.Buffer.from([0]),t]):t,a=n.length,s=o.length,u=2+a+2+s,c=2,l=2,m=48,w=h.Buffer.concat([h.Buffer.from([m,u,c,a]),n,h.Buffer.from([l,s]),o]);return w};mt.prototype.toString=function(){var e=this.toDER();return e.toString("hex")};mt.isTxDER=function(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(e[2]!==2||t===0||i[0]&128||t>1&&i[0]===0&&!(i[1]&128))return!1;var n=e.slice(6+t);return!(e[6+t-2]!==2||r===0||n[0]&128||r>1&&n[0]===0&&!(n[1]&128))};mt.prototype.hasLowS=function(){return!(this.s.lt(new af(1))||this.s.gt(new af("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))};mt.prototype.hasDefinedHashtype=function(){if(!mX.isNaturalNumber(this.nhashtype))return!1;var e=this.nhashtype&31;return!(e<mt.SIGHASH_ALL||e>mt.SIGHASH_SINGLE)};mt.prototype.toTxFormat=function(){var e=this.toDER(),t=h.Buffer.alloc(1);return t.writeUInt8(this.nhashtype,0),h.Buffer.concat([e,t])};mt.SIGHASH_ALL=1;mt.SIGHASH_NONE=2;mt.SIGHASH_SINGLE=3;mt.SIGHASH_FORKID=64;mt.SIGHASH_ANYONECANPAY=128;mt.prototype.isCanonical=function(){var e=vn(),t=e.getN().shrn(1);return this.s.lte(t)};mt.prototype.toCanonical=function(){if(this.isCanonical())return new mt({r:this.r,s:this.s,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype});var e=vn(),t=e.getN(),r=t.sub(this.s);return new mt({r:this.r,s:r,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype})};mt.prototype.validate=function(){if(!this.r||!this.s)throw new Error("Signature missing r or s component");if(this.r.isZero())throw new Error("Signature r component is zero");if(this.s.isZero())throw new Error("Signature s component is zero");var e=vn(),t=e.getN();if(this.r.gte(t))throw new Error("Signature r component >= curve order");if(this.s.gte(t))throw new Error("Signature s component >= curve order");if(this.r.isNeg())throw new Error("Signature r component is negative");if(this.s.isNeg())throw new Error("Signature s component is negative");return!0};mt.prototype.isValid=function(){try{return this.validate(),!0}catch{return!1}};mt.prototype.applySecurityPatches=function(){var e=vn(),t=e.getN(),r=t.shrn(1);if(this.r.isZero()||this.s.isZero())throw new Error("Invalid signature: zero r or s");if(this.r.gte(t)||this.s.gte(t))throw new Error("Invalid signature: out of range");if(this.s.gt(r))throw new Error("Invalid signature: non-canonical (high) s");return this};UA.exports=mt});var jn=k(Ht=>{"use strict";v();var yX=Rn(),bX=Ot();Ht.inherits=bX;function _X(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function wX(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=o&63|128):_X(e,n)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(n=0;n<e.length;n++)r[n]=e[n]|0;return r}Ht.toArray=wX;function SX(e){for(var t="",r=0;r<e.length;r++)t+=HA(e[r].toString(16));return t}Ht.toHex=SX;function FA(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Ht.htonl=FA;function xX(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];t==="little"&&(n=FA(n)),r+=jA(n.toString(16))}return r}Ht.toHex32=xX;function HA(e){return e.length===1?"0"+e:e}Ht.zero2=HA;function jA(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}Ht.zero8=jA;function EX(e,t,r,i){var n=r-t;yX(n%4===0);for(var o=new Array(n/4),a=0,s=t;a<o.length;a++,s+=4){var u;i==="big"?u=e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:u=e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o}Ht.join32=EX;function OX(e,t){for(var r=new Array(e.length*4),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];t==="big"?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o&255):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=o&255)}return r}Ht.split32=OX;function IX(e,t){return e>>>t|e<<32-t}Ht.rotr32=IX;function AX(e,t){return e<<t|e>>>32-t}Ht.rotl32=AX;function PX(e,t){return e+t>>>0}Ht.sum32=PX;function TX(e,t,r){return e+t+r>>>0}Ht.sum32_3=TX;function kX(e,t,r,i){return e+t+r+i>>>0}Ht.sum32_4=kX;function RX(e,t,r,i,n){return e+t+r+i+n>>>0}Ht.sum32_5=RX;function BX(e,t,r,i){var n=e[t],o=e[t+1],a=i+o>>>0,s=(a<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=a}Ht.sum64=BX;function MX(e,t,r,i){var n=t+i>>>0,o=(n<t?1:0)+e+r;return o>>>0}Ht.sum64_hi=MX;function NX(e,t,r,i){var n=t+i;return n>>>0}Ht.sum64_lo=NX;function CX(e,t,r,i,n,o,a,s){var u=0,c=t;c=c+i>>>0,u+=c<t?1:0,c=c+o>>>0,u+=c<o?1:0,c=c+s>>>0,u+=c<s?1:0;var l=e+r+n+a+u;return l>>>0}Ht.sum64_4_hi=CX;function DX(e,t,r,i,n,o,a,s){var u=t+i+o+s;return u>>>0}Ht.sum64_4_lo=DX;function LX(e,t,r,i,n,o,a,s,u,c){var l=0,m=t;m=m+i>>>0,l+=m<t?1:0,m=m+o>>>0,l+=m<o?1:0,m=m+s>>>0,l+=m<s?1:0,m=m+c>>>0,l+=m<c?1:0;var w=e+r+n+a+u+l;return w>>>0}Ht.sum64_5_hi=LX;function qX(e,t,r,i,n,o,a,s,u,c){var l=t+i+o+s+c;return l>>>0}Ht.sum64_5_lo=qX;function UX(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}Ht.rotr64_hi=UX;function FX(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Ht.rotr64_lo=FX;function HX(e,t,r){return e>>>r}Ht.shr64_hi=HX;function jX(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Ht.shr64_lo=jX});var Yc=k(KA=>{"use strict";v();var zA=jn(),zX=Rn();function Op(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}KA.BlockHash=Op;Op.prototype.update=function(t,r){if(t=zA.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var i=t.length%this._delta8;this.pending=t.slice(t.length-i,t.length),this.pending.length===0&&(this.pending=null),t=zA.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this};Op.prototype.digest=function(t){return this.update(this._pad()),zX(this.pending===null),this._digest(t)};Op.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,i=r-(t+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var o=1;o<i;o++)n[o]=0;if(t<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=t&255}else for(n[o++]=t&255,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,a=8;a<this.padLength;a++)n[o++]=0;return n}});var xy=k(Pa=>{"use strict";v();var KX=jn(),Po=KX.rotr32;function VX(e,t,r,i){if(e===0)return VA(t,r,i);if(e===1||e===3)return ZA(t,r,i);if(e===2)return GA(t,r,i)}Pa.ft_1=VX;function VA(e,t,r){return e&t^~e&r}Pa.ch32=VA;function GA(e,t,r){return e&t^e&r^t&r}Pa.maj32=GA;function ZA(e,t,r){return e^t^r}Pa.p32=ZA;function GX(e){return Po(e,2)^Po(e,13)^Po(e,22)}Pa.s0_256=GX;function ZX(e){return Po(e,6)^Po(e,11)^Po(e,25)}Pa.s1_256=ZX;function WX(e){return Po(e,7)^Po(e,18)^e>>>3}Pa.g0_256=WX;function YX(e){return Po(e,17)^Po(e,19)^e>>>10}Pa.g1_256=YX});var $A=k((P2e,YA)=>{"use strict";v();var $c=jn(),$X=Yc(),XX=xy(),Ey=$c.rotl32,y0=$c.sum32,JX=$c.sum32_5,QX=XX.ft_1,WA=$X.BlockHash,eJ=[1518500249,1859775393,2400959708,3395469782];function To(){if(!(this instanceof To))return new To;WA.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}$c.inherits(To,WA);YA.exports=To;To.blockSize=512;To.outSize=160;To.hmacStrength=80;To.padLength=64;To.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=Ey(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var o=this.h[0],a=this.h[1],s=this.h[2],u=this.h[3],c=this.h[4];for(n=0;n<i.length;n++){var l=~~(n/20),m=JX(Ey(o,5),QX(l,a,s,u),c,i[n],eJ[l]);c=u,u=s,s=Ey(a,30),a=o,o=m}this.h[0]=y0(this.h[0],o),this.h[1]=y0(this.h[1],a),this.h[2]=y0(this.h[2],s),this.h[3]=y0(this.h[3],u),this.h[4]=y0(this.h[4],c)};To.prototype._digest=function(t){return t==="hex"?$c.toHex32(this.h,"big"):$c.split32(this.h,"big")}});var Oy=k((k2e,JA)=>{"use strict";v();var Xc=jn(),tJ=Yc(),Jc=xy(),rJ=Rn(),zn=Xc.sum32,iJ=Xc.sum32_4,nJ=Xc.sum32_5,oJ=Jc.ch32,aJ=Jc.maj32,sJ=Jc.s0_256,uJ=Jc.s1_256,fJ=Jc.g0_256,cJ=Jc.g1_256,XA=tJ.BlockHash,lJ=[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];function ko(){if(!(this instanceof ko))return new ko;XA.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=lJ,this.W=new Array(64)}Xc.inherits(ko,XA);JA.exports=ko;ko.blockSize=512;ko.outSize=256;ko.hmacStrength=192;ko.padLength=64;ko.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=iJ(cJ(i[n-2]),i[n-7],fJ(i[n-15]),i[n-16]);var o=this.h[0],a=this.h[1],s=this.h[2],u=this.h[3],c=this.h[4],l=this.h[5],m=this.h[6],w=this.h[7];for(rJ(this.k.length===i.length),n=0;n<i.length;n++){var E=nJ(w,uJ(c),oJ(c,l,m),this.k[n],i[n]),P=zn(sJ(o),aJ(o,a,s));w=m,m=l,l=c,c=zn(u,E),u=s,s=a,a=o,o=zn(E,P)}this.h[0]=zn(this.h[0],o),this.h[1]=zn(this.h[1],a),this.h[2]=zn(this.h[2],s),this.h[3]=zn(this.h[3],u),this.h[4]=zn(this.h[4],c),this.h[5]=zn(this.h[5],l),this.h[6]=zn(this.h[6],m),this.h[7]=zn(this.h[7],w)};ko.prototype._digest=function(t){return t==="hex"?Xc.toHex32(this.h,"big"):Xc.split32(this.h,"big")}});var tP=k((B2e,eP)=>{"use strict";v();var Iy=jn(),QA=Oy();function Ta(){if(!(this instanceof Ta))return new Ta;QA.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Iy.inherits(Ta,QA);eP.exports=Ta;Ta.blockSize=512;Ta.outSize=224;Ta.hmacStrength=192;Ta.padLength=64;Ta.prototype._digest=function(t){return t==="hex"?Iy.toHex32(this.h.slice(0,7),"big"):Iy.split32(this.h.slice(0,7),"big")}});var Ty=k((N2e,oP)=>{"use strict";v();var Ri=jn(),hJ=Yc(),dJ=Rn(),Ro=Ri.rotr64_hi,Bo=Ri.rotr64_lo,rP=Ri.shr64_hi,iP=Ri.shr64_lo,_s=Ri.sum64,Ay=Ri.sum64_hi,Py=Ri.sum64_lo,pJ=Ri.sum64_4_hi,gJ=Ri.sum64_4_lo,vJ=Ri.sum64_5_hi,mJ=Ri.sum64_5_lo,nP=hJ.BlockHash,yJ=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Kn(){if(!(this instanceof Kn))return new Kn;nP.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=yJ,this.W=new Array(160)}Ri.inherits(Kn,nP);oP.exports=Kn;Kn.blockSize=1024;Kn.outSize=512;Kn.hmacStrength=192;Kn.padLength=128;Kn.prototype._prepareBlock=function(t,r){for(var i=this.W,n=0;n<32;n++)i[n]=t[r+n];for(;n<i.length;n+=2){var o=TJ(i[n-4],i[n-3]),a=kJ(i[n-4],i[n-3]),s=i[n-14],u=i[n-13],c=AJ(i[n-30],i[n-29]),l=PJ(i[n-30],i[n-29]),m=i[n-32],w=i[n-31];i[n]=pJ(o,a,s,u,c,l,m,w),i[n+1]=gJ(o,a,s,u,c,l,m,w)}};Kn.prototype._update=function(t,r){this._prepareBlock(t,r);var i=this.W,n=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],m=this.h[7],w=this.h[8],E=this.h[9],P=this.h[10],M=this.h[11],D=this.h[12],L=this.h[13],U=this.h[14],K=this.h[15];dJ(this.k.length===i.length);for(var N=0;N<i.length;N+=2){var C=U,F=K,H=OJ(w,E),z=IJ(w,E),G=bJ(w,E,P,M,D,L),B=_J(w,E,P,M,D,L),g=this.k[N],O=this.k[N+1],y=i[N],f=i[N+1],d=vJ(C,F,H,z,G,B,g,O,y,f),_=mJ(C,F,H,z,G,B,g,O,y,f);C=xJ(n,o),F=EJ(n,o),H=wJ(n,o,a,s,u,c),z=SJ(n,o,a,s,u,c);var x=Ay(C,F,H,z),b=Py(C,F,H,z);U=D,K=L,D=P,L=M,P=w,M=E,w=Ay(l,m,d,_),E=Py(m,m,d,_),l=u,m=c,u=a,c=s,a=n,s=o,n=Ay(d,_,x,b),o=Py(d,_,x,b)}_s(this.h,0,n,o),_s(this.h,2,a,s),_s(this.h,4,u,c),_s(this.h,6,l,m),_s(this.h,8,w,E),_s(this.h,10,P,M),_s(this.h,12,D,L),_s(this.h,14,U,K)};Kn.prototype._digest=function(t){return t==="hex"?Ri.toHex32(this.h,"big"):Ri.split32(this.h,"big")};function bJ(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function _J(e,t,r,i,n,o){var a=t&i^~t&o;return a<0&&(a+=4294967296),a}function wJ(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function SJ(e,t,r,i,n,o){var a=t&i^t&o^i&o;return a<0&&(a+=4294967296),a}function xJ(e,t){var r=Ro(e,t,28),i=Ro(t,e,2),n=Ro(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function EJ(e,t){var r=Bo(e,t,28),i=Bo(t,e,2),n=Bo(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function OJ(e,t){var r=Ro(e,t,14),i=Ro(e,t,18),n=Ro(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function IJ(e,t){var r=Bo(e,t,14),i=Bo(e,t,18),n=Bo(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function AJ(e,t){var r=Ro(e,t,1),i=Ro(e,t,8),n=rP(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function PJ(e,t){var r=Bo(e,t,1),i=Bo(e,t,8),n=iP(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function TJ(e,t){var r=Ro(e,t,19),i=Ro(t,e,29),n=rP(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}function kJ(e,t){var r=Bo(e,t,19),i=Bo(t,e,29),n=iP(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}});var uP=k((D2e,sP)=>{"use strict";v();var ky=jn(),aP=Ty();function ka(){if(!(this instanceof ka))return new ka;aP.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ky.inherits(ka,aP);sP.exports=ka;ka.blockSize=1024;ka.outSize=384;ka.hmacStrength=192;ka.padLength=128;ka.prototype._digest=function(t){return t==="hex"?ky.toHex32(this.h.slice(0,12),"big"):ky.split32(this.h.slice(0,12),"big")}});var fP=k(Qc=>{"use strict";v();Qc.sha1=$A();Qc.sha224=tP();Qc.sha256=Oy();Qc.sha384=uP();Qc.sha512=Ty()});var gP=k(pP=>{"use strict";v();var sf=jn(),RJ=Yc(),Ip=sf.rotl32,cP=sf.sum32,b0=sf.sum32_3,lP=sf.sum32_4,dP=RJ.BlockHash;function Mo(){if(!(this instanceof Mo))return new Mo;dP.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}sf.inherits(Mo,dP);pP.ripemd160=Mo;Mo.blockSize=512;Mo.outSize=160;Mo.hmacStrength=192;Mo.padLength=64;Mo.prototype._update=function(t,r){for(var i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=i,c=n,l=o,m=a,w=s,E=0;E<80;E++){var P=cP(Ip(lP(i,hP(E,n,o,a),t[NJ[E]+r],BJ(E)),DJ[E]),s);i=s,s=a,a=Ip(o,10),o=n,n=P,P=cP(Ip(lP(u,hP(79-E,c,l,m),t[CJ[E]+r],MJ(E)),LJ[E]),w),u=w,w=m,m=Ip(l,10),l=c,c=P}P=b0(this.h[1],o,m),this.h[1]=b0(this.h[2],a,w),this.h[2]=b0(this.h[3],s,u),this.h[3]=b0(this.h[4],i,c),this.h[4]=b0(this.h[0],n,l),this.h[0]=P};Mo.prototype._digest=function(t){return t==="hex"?sf.toHex32(this.h,"little"):sf.split32(this.h,"little")};function hP(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function BJ(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function MJ(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var NJ=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],CJ=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],DJ=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],LJ=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var mP=k((j2e,vP)=>{"use strict";v();var qJ=jn(),UJ=Rn();function el(e,t,r){if(!(this instanceof el))return new el(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(qJ.toArray(t,r))}vP.exports=el;el.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),UJ(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};el.prototype.update=function(t,r){return this.inner.update(t,r),this};el.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var bP=k(yP=>{v();var ri=yP;ri.utils=jn();ri.common=Yc();ri.sha=fP();ri.ripemd=gP();ri.hmac=mP();ri.sha1=ri.sha.sha1;ri.sha256=ri.sha.sha256;ri.sha224=ri.sha.sha224;ri.sha384=ri.sha.sha384;ri.sha512=ri.sha.sha512;ri.ripemd160=ri.ripemd.ripemd160});var wP=k((G2e,_P)=>{"use strict";v();var Ap=bP(),Ra=Bt(),Sr=_P.exports;Sr.sha1=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.sha1().update(e).digest("hex"),"hex")};Sr.sha1.blocksize=512;Sr.sha256=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.sha256().update(e).digest("hex"),"hex")};Sr.sha256.blocksize=512;Sr.sha256sha256=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),Sr.sha256(Sr.sha256(e))};Sr.ripemd160=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.ripemd160().update(e).digest("hex"),"hex")};Sr.sha256ripemd160=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),Sr.ripemd160(Sr.sha256(e))};Sr.sha512=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Ap.sha512().update(e).digest("hex"),"hex")};Sr.sha512.blocksize=1024;Sr.hmac=function(e,t,r){Ra.checkArgument(h.Buffer.isBuffer(t)),Ra.checkArgument(h.Buffer.isBuffer(r)),Ra.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=h.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=h.Buffer.alloc(i);o.fill(92);var a=h.Buffer.alloc(i);a.fill(54);for(var s=h.Buffer.alloc(i),u=h.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(h.Buffer.concat([s,e(h.Buffer.concat([u,t]))]))};Sr.sha256hmac=function(e,t){return Sr.hmac(Sr.sha256,e,t)};Sr.sha512hmac=function(e,t){return Sr.hmac(Sr.sha512,e,t)}});var xP=k((W2e,SP)=>{"use strict";v();var Pp=_r(),Ba=Bt(),xr=SP.exports;xr.sha1=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("sha1").update(e).digest()};xr.sha1.blocksize=512;xr.sha256=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("sha256").update(e).digest()};xr.sha256.blocksize=512;xr.sha256sha256=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),xr.sha256(xr.sha256(e))};xr.ripemd160=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("ripemd160").update(e).digest()};xr.sha256ripemd160=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),xr.ripemd160(xr.sha256(e))};xr.sha512=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Pp.createHash("sha512").update(e).digest()};xr.sha512.blocksize=1024;xr.hmac=function(e,t,r){Ba.checkArgument(h.Buffer.isBuffer(t)),Ba.checkArgument(h.Buffer.isBuffer(r)),Ba.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=h.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=h.Buffer.alloc(i);o.fill(92);var a=h.Buffer.alloc(i);a.fill(54);for(var s=h.Buffer.alloc(i),u=h.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(h.Buffer.concat([s,e(h.Buffer.concat([u,t]))]))};xr.sha256hmac=function(e,t){return xr.hmac(xr.sha256,e,t)};xr.sha512hmac=function(e,t){return xr.hmac(xr.sha512,e,t)}});var cr=k(($2e,Ry)=>{v();A.default.browser?Ry.exports=wP():Ry.exports=xP()});var Ss=k((J2e,IP)=>{"use strict";v();var Ma=xt(),_0=pi(),uf=[],w0={};function EP(){}EP.prototype.toString=function(){return this.name};function S0(e,t){if(~uf.indexOf(e))return e;if(t){Ma.isArray(t)||(t=[t]);for(var r=0;r<uf.length;r++){var i=uf[r],n=Ma.pick(i,t),o=Ma.values(n);if(~o.indexOf(e))return i}return}return w0[e]}function My(e){for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r)&31);return t}function x0(e){var t=new EP;_0.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey});var r=e.indexBy||Object.keys(e);return e.cashAddrPrefix&&Ma.extend(t,{cashAddrPrefix:e.cashAddrPrefix,cashAddrPrefixArray:My(e.cashAddrPrefix)}),e.networkMagic&&Ma.extend(t,{networkMagic:_0.integerAsBuffer(e.networkMagic)}),e.port&&Ma.extend(t,{port:e.port}),e.dnsSeeds&&Ma.extend(t,{dnsSeeds:e.dnsSeeds}),uf.push(t),FJ(t,r),t}function FJ(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=e[i];!Ma.isUndefined(n)&&!Ma.isObject(n)&&(w0[n]=e)}}function HJ(e,t){for(var r=0;r<t.length;r++){var i=t[r];w0[i]===e&&delete w0[i]}}function jJ(e){for(var t=0;t<uf.length;t++)uf[t]===e&&uf.splice(t,1);HJ(e,Object.keys(w0))}var Tp={livenet:3823236072,testnet:4108710900,regtest:3669344250,stn:4224632057},OP=["seed.bitcoinsv.org","seed.bitcoinunlimited.info"],ws={PORT:18333,NETWORK_MAGIC:Tp.testnet,DNS_SEEDS:OP,PREFIX:"testnet",CASHADDRPREFIX:"bchtest"},Na={PORT:18444,NETWORK_MAGIC:Tp.regtest,DNS_SEEDS:[],PREFIX:"regtest",CASHADDRPREFIX:"bchreg"},Ca={PORT:9333,NETWORK_MAGIC:Tp.stn,DNS_SEEDS:["stn-seed.bitcoinsv.io"],PREFIX:"stn",CASHADDRPREFIX:"bsvstn"},zJ={name:"livenet",alias:"mainnet",prefix:"bitcoin",cashAddrPrefix:"bitcoincash",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:Tp.livenet,port:8333,dnsSeeds:OP},KJ={name:"testnet",prefix:ws.PREFIX,cashAddrPrefix:ws.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:ws.NETWORK_MAGIC},VJ={name:"regtest",prefix:Na.PREFIX,cashAddrPrefix:Na.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Na.NETWORK_MAGIC,port:Na.PORT,dnsSeeds:[],indexBy:["port","name","cashAddrPrefix","networkMagic"]},GJ={name:"stn",prefix:Ca.PREFIX,cashAddrPrefix:Ca.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Ca.NETWORK_MAGIC,indexBy:["port","name","cashAddrPrefix","networkMagic"]};x0(KJ);x0(GJ);x0(VJ);x0(zJ);var By=S0("livenet"),ZJ=S0("regtest"),No=S0("testnet"),WJ=S0("stn");Object.defineProperty(No,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.PORT:this.stnEnabled?Ca.PORT:ws.PORT}});Object.defineProperty(No,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?_0.integerAsBuffer(Na.NETWORK_MAGIC):this.stnEnabled?_0.integerAsBuffer(Ca.NETWORK_MAGIC):_0.integerAsBuffer(ws.NETWORK_MAGIC)}});Object.defineProperty(No,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.DNS_SEEDS:this.stnEnabled?Ca.DNS_SEEDS:ws.DNS_SEEDS}});Object.defineProperty(No,"cashAddrPrefix",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.CASHADDRPREFIX:this.stnEnabled?Ca.CASHADDRPREFIX:ws.CASHADDRPREFIX}});Object.defineProperty(No,"cashAddrPrefixArray",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?My(Na.CASHADDRPREFIX):this.stnEnabled?Ca.cashAddrPrefixToArray(Ca.CASHADDRPREFIX):My(ws.CASHADDRPREFIX)}});function YJ(){No.regtestEnabled=!0}function $J(){No.regtestEnabled=!1}function XJ(){No.stnEnabled=!0}function JJ(){No.stnEnabled=!1}IP.exports={add:x0,remove:jJ,defaultNetwork:By,livenet:By,mainnet:By,testnet:No,regtest:ZJ,stn:WJ,get:S0,enableRegtest:YJ,disableRegtest:$J,enableStn:XJ,disableStn:JJ}});var E0=k((epe,TP)=>{"use strict";v();var Ny=xt(),AP=Y2(),PP=Kt(),QJ="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),Gr=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};Gr.validCharacters=function(t){return PP.Buffer.isBuffer(t)&&(t=t.toString()),Ny.every(Ny.map(t,function(r){return Ny.includes(QJ,r)}))};Gr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Gr.encode=function(e){if(!PP.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return AP.encode(e)};Gr.decode=function(e){if(typeof e!="string")throw new Error("Input should be a string");return h.Buffer.from(AP.decode(e))};Gr.prototype.fromBuffer=function(e){return this.buf=e,this};Gr.fromBuffer=function(e){return new Gr().fromBuffer(e)};Gr.fromHex=function(e){return Gr.fromBuffer(h.Buffer.from(e,"hex"))};Gr.prototype.fromString=function(e){var t=Gr.decode(e);return this.buf=t,this};Gr.fromString=function(e){return new Gr().fromString(e)};Gr.prototype.toBuffer=function(){return this.buf};Gr.prototype.toHex=function(){return this.toBuffer().toString("hex")};Gr.prototype.toString=function(){return Gr.encode(this.buf)};TP.exports=Gr});var tl=k((rpe,MP)=>{"use strict";v();var kP=xt(),kp=E0(),RP=Kt(),BP=cr().sha256sha256,lr=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};lr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};lr.validChecksum=function(t,r){return kP.isString(t)&&(t=RP.Buffer.from(kp.decode(t))),kP.isString(r)&&(r=RP.Buffer.from(kp.decode(r))),r||(r=t.slice(-4),t=t.slice(0,-4)),lr.checksum(t).toString("hex")===r.toString("hex")};lr.decode=function(e){if(typeof e!="string")throw new Error("Input must be a string");var t=h.Buffer.from(kp.decode(e));if(t.length<4)throw new Error("Input string too short");var r=t.slice(0,-4),i=t.slice(-4),n=BP(r),o=n.slice(0,4);if(i.toString("hex")!==o.toString("hex"))throw new Error("Checksum mismatch");return r};lr.checksum=function(e){return BP(e).slice(0,4)};lr.encode=function(e){if(!h.Buffer.isBuffer(e))throw new Error("Input must be a buffer");var t=h.Buffer.alloc(e.length+4),r=lr.checksum(e);return e.copy(t),r.copy(t,e.length),kp.encode(t)};lr.prototype.fromBuffer=function(e){return this.buf=e,this};lr.fromBuffer=function(e){return new lr().fromBuffer(e)};lr.fromHex=function(e){return lr.fromBuffer(h.Buffer.from(e,"hex"))};lr.prototype.fromString=function(e){var t=lr.decode(e);return this.buf=t,this};lr.fromString=function(e){var t=lr.decode(e);return new lr(t)};lr.prototype.toBuffer=function(){return this.buf};lr.prototype.toHex=function(){return this.toBuffer().toString("hex")};lr.prototype.toString=function(){return lr.encode(this.buf)};MP.exports=lr});var Da=k((npe,CP)=>{"use strict";v();var O0=xt(),NP=Bt(),rl=fr(),gr=function e(t){if(!(this instanceof e))return new e(t);if(!O0.isUndefined(t))if(h.Buffer.isBuffer(t))this.set({buf:t});else if(O0.isString(t)){var r=h.Buffer.from(t,"hex");if(r.length*2!==t.length)throw new TypeError("Invalid hex string");this.set({buf:r})}else if(O0.isObject(t)){var i=t;this.set(i)}else throw new TypeError("Unrecognized argument for BufferReader")};gr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this};gr.prototype.eof=function(){return this.pos>=this.buf.length};gr.prototype.finished=gr.prototype.eof;gr.prototype.read=function(e){NP.checkArgument(!O0.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t};gr.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e};gr.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e};gr.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e};gr.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e};gr.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=rl.fromBuffer(e);return this.pos=this.pos+8,t};gr.prototype.readUInt64LEBN=function(){var e=this.buf.readUInt32LE(this.pos),t=this.buf.readUInt32LE(this.pos+4),r=t*4294967296+e,i;if(r<=9007199254740991)i=new rl(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);i=new rl(n,10,"le")}return this.pos=this.pos+8,i};gr.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN(),r=t.toNumber();if(r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarintBN");default:return e}};gr.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return NP.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t};gr.prototype.readVarintBuf=function(){var e=this.buf.readUInt8(this.pos);switch(e){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}};gr.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new rl(this.readUInt16LE());case 254:return new rl(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new rl(e)}};gr.prototype.reverse=function(){for(var e=h.Buffer.alloc(this.buf.length),t=0;t<e.length;t++)e[t]=this.buf[this.buf.length-1-t];return this.buf=e,this};gr.prototype.readReverse=function(e){O0.isUndefined(e)&&(e=this.buf.length);var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,h.Buffer.from(t).reverse()};CP.exports=gr});var Ly=k((ape,UP)=>{"use strict";v();function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function DP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,tQ(i.key),i)}}function eQ(e,t,r){return t&&DP(e.prototype,t),r&&DP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tQ(e){var t=rQ(e,"string");return xs(t)==="symbol"?t:String(t)}function rQ(e,t){if(xs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(xs(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dy(e,t)}function Dy(e,t){return Dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},Dy(e,t)}function oQ(e){var t=uQ();return function(){var i=Rp(e),n;if(t){var o=Rp(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return aQ(this,n)}}function aQ(e,t){if(t&&(xs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sQ(e)}function sQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rp(e){return Rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rp(e)}var qP={},il,Cy;function I0(e,t,r){r||(r=Error);function i(o,a,s){return typeof t=="string"?t:t(o,a,s)}var n=(function(o){nQ(s,o);var a=oQ(s);function s(u,c,l){var m;return iQ(this,s),m=a.call(this,i(u,c,l)),m.code=e,m}return eQ(s)})(r);qP[e]=n}function LP(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function fQ(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function cQ(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function lQ(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}I0("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError);I0("ERR_INVALID_ARG_TYPE",function(e,t,r){il===void 0&&(il=Es()),il(typeof e=="string","'name' must be a string");var i;typeof t=="string"&&fQ(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(cQ(e," argument"))n="The ".concat(e," ").concat(i," ").concat(LP(t,"type"));else{var o=lQ(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(i," ").concat(LP(t,"type"))}return n+=". Received type ".concat(xs(r)),n},TypeError);I0("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";Cy===void 0&&(Cy=rn());var i=Cy.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(i)},TypeError,RangeError);I0("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return r&&r.constructor&&r.constructor.name?i="instance of ".concat(r.constructor.name):i="type ".concat(xs(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError);I0("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];il===void 0&&(il=Es()),il(t.length>0,"At least one arg needs to be specified");var i="The ",n=t.length;switch(t=t.map(function(o){return'"'.concat(o,'"')}),n){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,n-1).join(", "),i+=", and ".concat(t[n-1]," arguments");break}return"".concat(i," must be specified")},TypeError);UP.exports.codes=qP});var YP=k((upe,WP)=>{"use strict";v();function FP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function HP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(r),!0).forEach(function(i){hQ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FP(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function hQ(e,t,r){return t=VP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,VP(i.key),i)}}function pQ(e,t,r){return t&&jP(e.prototype,t),r&&jP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function VP(e){var t=gQ(e,"string");return Bi(t)==="symbol"?t:String(t)}function gQ(e,t){if(Bi(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(Bi(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&k0(e,t)}function mQ(e){var t=ZP();return function(){var i=R0(e),n;if(t){var o=R0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return GP(this,n)}}function GP(e,t){if(t&&(Bi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qy(e)}function qy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uy(e){var t=typeof Map=="function"?new Map:void 0;return Uy=function(i){if(i===null||!yQ(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(i))return t.get(i);t.set(i,n)}function n(){return Bp(i,arguments,R0(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k0(n,i)},Uy(e)}function Bp(e,t,r){return ZP()?Bp=Reflect.construct.bind():Bp=function(n,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(n,s),c=new u;return a&&k0(c,a.prototype),c},Bp.apply(null,arguments)}function ZP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yQ(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function k0(e,t){return k0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},k0(e,t)}function R0(e){return R0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},R0(e)}function Bi(e){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bi(e)}var bQ=rn(),Fy=bQ.inspect,_Q=Ly(),wQ=_Q.codes.ERR_INVALID_ARG_TYPE;function zP(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function SQ(e,t){if(t=Math.floor(t),e.length==0||t==0)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,r-e.length),e}var Vn="",A0="",P0="",ii="",ff={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},xQ=10;function KP(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(i){r[i]=e[i]}),Object.defineProperty(r,"message",{value:e.message}),r}function T0(e){return Fy(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function EQ(e,t,r){var i="",n="",o=0,a="",s=!1,u=T0(e),c=u.split(`
|
|
20
20
|
`),l=T0(t).split(`
|
|
21
21
|
`),m=0,w="";if(r==="strictEqual"&&Bi(e)==="object"&&Bi(t)==="object"&&e!==null&&t!==null&&(r="strictEqualObject"),c.length===1&&l.length===1&&c[0]!==l[0]){var E=c[0].length+l[0].length;if(E<=xQ){if((Bi(e)!=="object"||e===null)&&(Bi(t)!=="object"||t===null)&&(e!==0||t!==0))return"".concat(ff[r],`
|
|
22
22
|
|
|
@@ -72,7 +72,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
72
72
|
`))}throw i}};function xk(e,t,r,i,n){if(!Vp(t))throw new nl("regexp","RegExp",t);var o=n==="match";if(typeof e!="string"||Gp(t,e)!==o){if(r instanceof Error)throw r;var a=!r;r=r||(typeof e!="string"?'The "string" argument must be of type string. Received type '+"".concat(Gn(e)," (").concat(Kp(e),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(Kp(t),`. Input:
|
|
73
73
|
|
|
74
74
|
`).concat(Kp(e),`
|
|
75
|
-
`));var s=new As({actual:e,expected:t,message:r,operator:n,stackStartFn:i});throw s.generatedMessage=a,s}}Gt.match=function e(t,r,i){xk(t,r,i,e,"match")};Gt.doesNotMatch=function e(t,r,i){xk(t,r,i,e,"doesNotMatch")};function Ek(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];vk.apply(void 0,[Ek,t.length].concat(t))}Gt.strict=Dee(Ek,Gt,{equal:Gt.strictEqual,deepEqual:Gt.deepStrictEqual,notEqual:Gt.notStrictEqual,notDeepEqual:Gt.notDeepStrictEqual});Gt.strict.strict=Gt.strict});var Wn=k((Kpe,Ak)=>{"use strict";v();var Ik=Es(),vr=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};vr.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};vr.prototype.toBuffer=function(){return this.concat()};vr.prototype.concat=function(){return h.Buffer.concat(this.bufs,this.bufLen)};vr.prototype.write=function(e){return Ik(h.Buffer.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};vr.prototype.writeReverse=function(e){return Ik(h.Buffer.isBuffer(e)),this.bufs.push(h.Buffer.from(e).reverse()),this.bufLen+=e.length,this};vr.prototype.writeUInt8=function(e){var t=h.Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};vr.prototype.writeUInt16BE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};vr.prototype.writeUInt16LE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};vr.prototype.writeUInt32BE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};vr.prototype.writeInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};vr.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};vr.prototype.writeVarintNum=function(e){var t=vr.varintBufNum(e);return this.write(t),this};vr.prototype.writeVarintBN=function(e){var t=vr.varintBufBN(e);return this.write(t),this};vr.varintBufNum=function(e){var t;return e<253?(t=h.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=h.Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};vr.varintBufBN=function(e){var t,r=e.toNumber();if(r<253)t=h.Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new vr;i.writeUInt8(255),i.writeUInt64LEBN(e),t=i.concat()}return t};Ak.exports=vr});var Yp=k((Gpe,Pk)=>{"use strict";v();var ol=xt(),U0=Bt(),qee=pi();function Et(e){if(!(this instanceof Et))return new Et(e);var t;if(ol.isNumber(e))t=e;else if(ol.isString(e))t=Et.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return qee.defineImmutable(this,{num:t}),this}Et.fromBuffer=function(e){return U0.checkArgument(h.Buffer.isBuffer(e)),new Et(+("0x"+e.toString("hex")))};Et.fromNumber=function(e){return U0.checkArgument(ol.isNumber(e)),new Et(e)};Et.fromString=function(e){U0.checkArgument(ol.isString(e));var t=Et.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new Et(t)};Et.prototype.toHex=function(){return this.num.toString(16)};Et.prototype.toBuffer=function(){return h.Buffer.from(this.toHex(),"hex")};Et.prototype.toNumber=function(){return this.num};Et.prototype.toString=function(){var e=Et.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};Et.smallInt=function(e){return U0.checkArgument(ol.isNumber(e),"Invalid Argument: n should be number"),U0.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?Et("OP_0"):new Et(Et.map.OP_1+e-1)};Et.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_SUBSTR:179,OP_LEFT:180,OP_RIGHT:181,OP_NOP4:182,OP_NOP5:183,OP_NOP6:184,OP_NOP7:185,OP_NOP8:186,OP_NOP9:187,OP_NOP10:188,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};Et.reverseMap=[];for(e4 in Et.map)Et.reverseMap[Et.map[e4]]=e4;var e4;ol.extend(Et,Et.map);Et.isSmallIntOp=function(e){return e instanceof Et&&(e=e.toNumber()),e===Et.map.OP_0||e>=Et.map.OP_1&&e<=Et.map.OP_16};Et.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};Pk.exports=Et});var i4=k((Wpe,Rk)=>{"use strict";v();var Yn=hf(),Uee=Da(),Fee=Wn(),t4=cr(),he=Yp(),lf=$n(),cf=Vr(),Tk=Ss(),er=Bt(),yt=xt(),r4=hn(),kk=Kt(),Hee=pi(),Q=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],h.Buffer.isBuffer(t))return e.fromBuffer(t);if(t instanceof Yn)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(yt.isString(t))return e.fromString(t);yt.isObject(t)&&yt.isArray(t.chunks)&&this.set(t)};Q.prototype.set=function(e){return er.checkArgument(yt.isObject(e)),er.checkArgument(yt.isArray(e.chunks)),this.chunks=e.chunks,this};Q.fromBuffer=function(e){var t=new Q;t.chunks=[];for(var r=new Uee(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<he.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===he.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(a){throw a instanceof RangeError?new r4.Script.InvalidBuffer(e.toString("hex")):a}return t};Q.prototype.toBuffer=function(){for(var e=new Fee,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<he.OP_PUSHDATA1?e.write(r.buf):i===he.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===he.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):i===he.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};Q.fromASM=function(e){var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(n==="0")a=0,t.chunks.push({opcodenum:a}),i=i+1;else if(n==="-1")a=he.OP_1NEGATE,t.chunks.push({opcodenum:a}),i=i+1;else if(yt.isUndefined(a)){var s=h.Buffer.from(r[i],"hex");if(s.toString("hex")!==r[i])throw new Error("invalid hex string in script");var u=s.length;u>=0&&u<he.OP_PUSHDATA1?a=u:u<Math.pow(2,8)?a=he.OP_PUSHDATA1:u<Math.pow(2,16)?a=he.OP_PUSHDATA2:u<Math.pow(2,32)&&(a=he.OP_PUSHDATA4),t.chunks.push({buf:s,len:s.length,opcodenum:a}),i=i+1}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.fromHex=function(e){return new Q(kk.Buffer.from(e,"hex"))};Q.fromString=function(e){if(Hee.isHexa(e)||e.length===0)return new Q(kk.Buffer.from(e,"hex"));var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(yt.isUndefined(a))if(a=parseInt(n),a>0&&a<he.OP_PUSHDATA1)t.chunks.push({buf:h.Buffer.from(r[i+1].slice(2),"hex"),len:a,opcodenum:a}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(a===he.OP_PUSHDATA1||a===he.OP_PUSHDATA2||a===he.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:h.Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:a}),i=i+3}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)!i&&(r===he.OP_PUSHDATA1||r===he.OP_PUSHDATA2||r===he.OP_PUSHDATA4)&&(n=n+" "+he(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof he.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+he(r).toString():n=n+" "+he(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};Q.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};Q.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};Q.prototype.toHex=function(){return this.toBuffer().toString("hex")};Q.prototype.inspect=function(){return"<Script: "+this.toString()+">"};Q.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashOutPrefix=function(){return!!(this.chunks.length>=5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};Q.prototype.getPublicKey=function(){return er.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};Q.prototype.getPublicKeyHash=function(){return er.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf};Q.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===he.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return lf.isValid(e)}return!1};Q.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};Q.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===he.OP_HASH160&&e[1]===20&&e[e.length-1]===he.OP_EQUAL};Q.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=Q.fromBuffer(t)}catch(n){if(n instanceof r4.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==Q.types.UNKNOWN};Q.prototype.isMultisigOut=function(){return this.chunks.length>3&&he.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)})&&he.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===he.OP_CHECKMULTISIG};Q.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)&&cf.isTxDER(e.buf)})};Q.prototype.isDataOut=function(){var e=this.chunks.length>=1&&this.chunks[0].opcodenum===he.OP_RETURN;if(!e)return!1;var t=this.chunks.slice(1),r=new Q({chunks:t});return r.isPushOnly()};Q.prototype.isSafeDataOut=function(){if(this.chunks.length<2||this.chunks[0].opcodenum!==he.OP_FALSE)return!1;var e=this.chunks.slice(1),t=new Q({chunks:e});return t.isDataOut()};Q.prototype.getData=function(){if(this.isSafeDataOut()){var e=this.chunks.slice(2),t=e.map(r=>r.buf);return t}if(this.isDataOut()||this.isScriptHashOut())return yt.isUndefined(this.chunks[1])?h.Buffer.alloc(0):h.Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return h.Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};Q.prototype.isPushOnly=function(){return yt.every(this.chunks,function(e){return e.opcodenum<=he.OP_16||e.opcodenum===he.OP_PUSHDATA1||e.opcodenum===he.OP_PUSHDATA2||e.opcodenum===he.OP_PUSHDATA4})};Q.types={};Q.types.UNKNOWN="Unknown";Q.types.PUBKEY_OUT="Pay to public key";Q.types.PUBKEY_IN="Spend from public key";Q.types.PUBKEYHASH_OUT="Pay to public key hash";Q.types.PUBKEYHASH_IN="Spend from public key hash";Q.types.SCRIPTHASH_OUT="Pay to script hash";Q.types.SCRIPTHASH_IN="Spend from script hash";Q.types.MULTISIG_OUT="Pay to multisig";Q.types.MULTISIG_IN="Spend from multisig";Q.types.DATA_OUT="Data push";Q.types.SAFE_DATA_OUT="Safe data push";Q.OP_RETURN_STANDARD_SIZE=220;Q.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!==Q.types.UNKNOWN?e:this.classifyInput()};Q.outputIdentifiers={};Q.outputIdentifiers.PUBKEY_OUT=Q.prototype.isPublicKeyOut;Q.outputIdentifiers.PUBKEYHASH_OUT=Q.prototype.isPublicKeyHashOut;Q.outputIdentifiers.MULTISIG_OUT=Q.prototype.isMultisigOut;Q.outputIdentifiers.SCRIPTHASH_OUT=Q.prototype.isScriptHashOut;Q.outputIdentifiers.DATA_OUT=Q.prototype.isDataOut;Q.outputIdentifiers.SAFE_DATA_OUT=Q.prototype.isSafeDataOut;Q.prototype.classifyOutput=function(){for(var e in Q.outputIdentifiers)if(Q.outputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.inputIdentifiers={};Q.inputIdentifiers.PUBKEY_IN=Q.prototype.isPublicKeyIn;Q.inputIdentifiers.PUBKEYHASH_IN=Q.prototype.isPublicKeyHashIn;Q.inputIdentifiers.MULTISIG_IN=Q.prototype.isMultisigIn;Q.inputIdentifiers.SCRIPTHASH_IN=Q.prototype.isScriptHashIn;Q.prototype.classifyInput=function(){for(var e in Q.inputIdentifiers)if(Q.inputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.prototype.isStandard=function(){return this.classify()!==Q.types.UNKNOWN};Q.prototype.prepend=function(e){return this._addByType(e,!0),this};Q.prototype.equals=function(e){if(er.checkState(e instanceof Q,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(h.Buffer.isBuffer(this.chunks[t].buf)&&!h.Buffer.isBuffer(e.chunks[t].buf)||h.Buffer.isBuffer(this.chunks[t].buf)&&!this.chunks[t].buf.equals(e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};Q.prototype.add=function(e){return this._addByType(e,!1),this};Q.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof he)this._addOpcode(e,t);else if(h.Buffer.isBuffer(e))this._addBuffer(e,t);else if(e instanceof Q)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};Q.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};Q.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof he?r=e.toNumber():r=he(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};Q.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<he.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=he.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=he.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=he.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};Q.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==he.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};Q.buildMultisigOut=function(e,t,r){er.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new Q;i.add(he.smallInt(t)),e=yt.map(e,lf);var n=e;r.noSorting||(n=e.map(s=>s.toString("hex")).sort().map(s=>new lf(s)));for(var o=0;o<n.length;o++){var a=n[o];i.add(a.toBuffer())}return i.add(he.smallInt(e.length)),i.add(he.OP_CHECKMULTISIG),i};Q.buildMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n};Q.buildP2SHMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n.add((i.cachedMultisig||Q.buildMultisigOut(e,t,i)).toBuffer()),n};Q.buildPublicKeyHashOut=function(e){er.checkArgument(!yt.isUndefined(e)),er.checkArgument(e instanceof lf||e instanceof Yn||yt.isString(e)),e instanceof lf?e=e.toAddress():yt.isString(e)&&(e=new Yn(e));var t=new Q;return t.add(he.OP_DUP).add(he.OP_HASH160).add(e.hashBuffer).add(he.OP_EQUALVERIFY).add(he.OP_CHECKSIG),t._network=e.network,t};Q.buildPublicKeyOut=function(e){er.checkArgument(e instanceof lf);var t=new Q;return t.add(e.toBuffer()).add(he.OP_CHECKSIG),t};Q.buildDataOut=function(e,t){er.checkArgument(yt.isUndefined(e)||yt.isString(e)||yt.isArray(e)||h.Buffer.isBuffer(e));var r=e;yt.isArray(r)||(r=[e]);var i=new Q;i.add(he.OP_RETURN);for(let n of r)er.checkArgument(yt.isUndefined(n)||yt.isString(n)||h.Buffer.isBuffer(n)),yt.isString(n)&&(n=h.Buffer.from(n,t)),yt.isUndefined(n)||i.add(n);return i};Q.buildSafeDataOut=function(e,t){var r=Q.buildDataOut(e,t),i=new Q;return i.add(he.OP_FALSE),i.add(r),i};Q.buildScriptHashOut=function(e){er.checkArgument(e instanceof Q||e instanceof Yn&&e.isPayToScriptHash());var t=new Q;return t.add(he.OP_HASH160).add(e instanceof Yn?e.hashBuffer:t4.sha256ripemd160(e.toBuffer())).add(he.OP_EQUAL),t._network=e._network||e.network,t};Q.buildPublicKeyIn=function(e,t){er.checkArgument(e instanceof cf||h.Buffer.isBuffer(e)),er.checkArgument(yt.isUndefined(t)||yt.isNumber(t)),e instanceof cf&&(e=e.toBuffer());var r=new Q;return r.add(h.Buffer.concat([e,h.Buffer.from([(t||cf.SIGHASH_ALL)&255])])),r};Q.buildPublicKeyHashIn=function(e,t,r){er.checkArgument(t instanceof cf||h.Buffer.isBuffer(t)),er.checkArgument(yt.isUndefined(r)||yt.isNumber(r)),t instanceof cf&&(t=t.toBuffer());var i=new Q().add(h.Buffer.concat([t,h.Buffer.from([(r||cf.SIGHASH_ALL)&255])])).add(new lf(e).toBuffer());return i};Q.empty=function(){return new Q};Q.prototype.toScriptHashOut=function(){return Q.buildScriptHashOut(this)};Q.fromAddress=function(e){if(e=Yn(e),e.isPayToScriptHash())return Q.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return Q.buildPublicKeyHashOut(e);throw new r4.Script.UnrecognizedAddress(e)};Q.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};Q.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToPublicKeyHash;else return!1;return e};Q.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=t4.sha256ripemd160(this.chunks[1].buf),e.type=Yn.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=t4.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Yn.PayToScriptHash;else return!1;return e};Q.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=Tk.get(e)||this._network||Tk.defaultNetwork,new Yn(t)):!1};Q.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=Q({chunks:[this.chunks[i]]}),o=n.toBuffer(),a=o.toString("hex");r===a&&this.chunks.splice(i,1)}return this};Q.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===he.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===he.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===he.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===he.OP_PUSHDATA1:r.length<=65535?i===he.OP_PUSHDATA2:!0:!0};Q.prototype._decodeOP_N=function(e){if(e===he.OP_0)return 0;if(e>=he.OP_1&&e<=he.OP_16)return e-(he.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))};Q.prototype.getSignatureOperationsCount=function(e){e=yt.isUndefined(e)?!0:e;var t=this,r=0,i=he.OP_INVALIDOPCODE;return yt.each(t.chunks,function(o){var a=o.opcodenum;a===he.OP_CHECKSIG||a===he.OP_CHECKSIGVERIFY?r++:(a===he.OP_CHECKMULTISIG||a===he.OP_CHECKMULTISIGVERIFY)&&(e&&i>=he.OP_1&&i<=he.OP_16?r+=t._decodeOP_N(i):r+=20),i=a}),r};Rk.exports=Q});var n4=k(($pe,Mk)=>{v();var jee=Object.prototype.toString;Mk.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return Zee(t)?"generatorfunction":"function";if(zee(t))return"array";if($ee(t))return"buffer";if(Yee(t))return"arguments";if(Vee(t))return"date";if(Kee(t))return"error";if(Gee(t))return"regexp";switch(Bk(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(Wee(t))return"generator";switch(r=jee.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Bk(e){return typeof e.constructor=="function"?e.constructor.name:null}function zee(e){return Array.isArray?Array.isArray(e):e instanceof Array}function Kee(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Vee(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Gee(e){return e instanceof RegExp?!0:typeof e.flags=="string"&&typeof e.ignoreCase=="boolean"&&typeof e.multiline=="boolean"&&typeof e.global=="boolean"}function Zee(e,t){return Bk(e)==="GeneratorFunction"}function Wee(e){return typeof e.throw=="function"&&typeof e.return=="function"&&typeof e.next=="function"}function Yee(e){try{if(typeof e.length=="number"&&typeof e.callee=="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function $ee(e){return e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var Dk=k((Jpe,Ck)=>{"use strict";v();var Nk=Symbol.prototype.valueOf,Xee=n4();function Jee(e,t){switch(Xee(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return rte(e);case"symbol":return ite(e);case"arraybuffer":return ete(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return tte(e);case"regexp":return Qee(e);case"error":return Object.create(e);default:return e}}function Qee(e){let t=e.flags!==void 0?e.flags:/\w+$/.exec(e)||void 0,r=new e.constructor(e.source,t);return r.lastIndex=e.lastIndex,r}function ete(e){let t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function tte(e,t){return new e.constructor(e.buffer,e.byteOffset,e.length)}function rte(e){let t=e.length,r=h.Buffer.allocUnsafe?h.Buffer.allocUnsafe(t):h.Buffer.from(t);return e.copy(r),r}function ite(e){return Nk?Object(Nk.call(e)):{}}Ck.exports=Jee});var qk=k((e6e,Lk)=>{"use strict";v();Lk.exports=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}});var Hk=k((r6e,Fk)=>{"use strict";v();var nte=qk();function Uk(e){return nte(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}Fk.exports=function(t){var r,i;return!(Uk(t)===!1||(r=t.constructor,typeof r!="function")||(i=r.prototype,Uk(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var zk=k((n6e,jk)=>{"use strict";v();var ote=Dk(),ate=n4(),ste=Hk();function o4(e,t){switch(ate(e)){case"object":return ute(e,t);case"array":return fte(e,t);default:return ote(e)}}function ute(e,t){if(typeof t=="function")return t(e);if(t||ste(e)){let r=new e.constructor;for(let i in e)r[i]=o4(e[i],t);return r}return e}function fte(e,t){let r=new e.constructor(e.length);for(let i=0;i<e.length;i++)r[i]=o4(e[i],t);return r}jk.exports=o4});var al=k((a6e,Gk)=>{"use strict";v();var Kk=Wn(),Vk=Da(),cte=fr(),Xn=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof cte){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};Xn.prototype.set=function(e){return this.buf=e.buf||this.buf,this};Xn.prototype.fromString=function(e){return this.set({buf:h.Buffer.from(e,"hex")}),this};Xn.prototype.toString=function(){return this.buf.toString("hex")};Xn.prototype.fromBuffer=function(e){return this.buf=e,this};Xn.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};Xn.prototype.fromBN=function(e){return this.buf=Kk().writeVarintBN(e).concat(),this};Xn.prototype.fromNumber=function(e){return this.buf=Kk().writeVarintNum(e).concat(),this};Xn.prototype.toBuffer=function(){return this.buf};Xn.prototype.toBN=function(){return Vk(this.buf).readVarintBN()};Xn.prototype.toNumber=function(){return Vk(this.buf).readVarintNum()};Gk.exports=Xn});var La=k((u6e,Wk)=>{"use strict";v();var $p=xt(),a4=fr(),Zk=Kt(),Xp=pi(),lte=Wn(),hte=al(),s4=bn(),u4=Bt(),dte=hn(),pte=9007199254740991;function Zr(e){if(!(this instanceof Zr))return new Zr(e);if($p.isObject(e))if(this.satoshis=e.satoshis,h.Buffer.isBuffer(e.script))this._scriptBuffer=e.script;else{var t;$p.isString(e.script)&&Xp.isHexa(e.script)?t=Zk.Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(Zr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(Zr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof a4?(this._satoshisBN=e,this._satoshis=e.toNumber()):$p.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=a4.fromNumber(this._satoshis)):(u4.checkArgument(Xp.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=a4.fromNumber(e),this._satoshis=e),u4.checkState(Xp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.invalidSatoshis=function(){return this._satoshis>pte?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};Object.defineProperty(Zr.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(e){this._satoshisBN=e,this._satoshis=e.toNumber(),u4.checkState(Xp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.toObject=Zr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};Zr.fromObject=function(e){return new Zr(e)};Zr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=s4.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof dte.Script.InvalidBuffer)this._script=null;else throw t}};Zr.prototype.setScript=function(e){if(e instanceof s4)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if($p.isString(e))this._script=s4.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(h.Buffer.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};Zr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};Zr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=Zk.Buffer.from([]),new Zr(t)};Zr.prototype.toBufferWriter=function(e){e||(e=new lte),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};Zr.prototype.getSize=function(){var e=this.script.toBuffer().length,t=hte(e).toBuffer().length;return 8+t+e};Wk.exports=Zr});var sl=k((c6e,Jk)=>{"use strict";v();var Ps=xt(),gte=Bt(),F0=hn(),vte=Wn(),f4=Kt(),$k=pi(),Jp=bn(),mte=qa(),Yk=La(),Qp=4294967295,yte=Qp-2,Xk=Qp,bte=Qp-1;function jt(e){if(!(this instanceof jt))return new jt(e);if(e)return this._fromObject(e)}jt.MAXINT=Qp;jt.DEFAULT_SEQNUMBER=Xk;jt.DEFAULT_LOCKTIME_SEQNUMBER=bte;jt.DEFAULT_RBF_SEQNUMBER=yte;jt.BASE_SIZE=40;Object.defineProperty(jt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new Jp(this._scriptBuffer),this._script._isInput=!0),this._script)}});jt.fromObject=function(e){gte.checkArgument(Ps.isObject(e));var t=new jt;return t._fromObject(e)};jt.prototype._fromObject=function(e){var t;if(Ps.isString(e.prevTxId)&&$k.isHexa(e.prevTxId)?t=f4.Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.output=e.output?e.output instanceof Yk?e.output:new Yk(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=Ps.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=Ps.isUndefined(e.sequenceNumber)?Ps.isUndefined(e.seqnum)?Xk:e.seqnum:e.sequenceNumber,Ps.isUndefined(e.script)&&Ps.isUndefined(e.scriptBuffer))throw new F0.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};jt.prototype.toObject=jt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};jt.fromBufferReader=function(e){var t=new jt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};jt.prototype.toBufferWriter=function(e){e||(e=new vte),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};jt.prototype.setScript=function(e){if(this._script=null,e instanceof Jp)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(e===null)this._script=Jp.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if($k.isHexa(e))this._scriptBuffer=f4.Buffer.from(e,"hex");else if(Ps.isString(e))this._script=new Jp(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(h.Buffer.isBuffer(e))this._scriptBuffer=f4.Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};jt.prototype.getSignatures=function(){throw new F0.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};jt.prototype.isFullySigned=function(){throw new F0.AbstractMethodInvoked("Input#isFullySigned")};jt.prototype.isFinal=function(){return this.sequenceNumber===jt.MAXINT};jt.prototype.addSignature=function(){throw new F0.AbstractMethodInvoked("Input#addSignature")};jt.prototype.clearSignatures=function(){throw new F0.AbstractMethodInvoked("Input#clearSignatures")};jt.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,mte.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};jt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};jt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};Jk.exports=jt});var fl=k((h6e,tR)=>{"use strict";v();var ul=xt(),_n=Bt(),_te=Ot(),Qk=pi(),eR=$n(),wte=hn(),H0=Vr();function Jn(e){if(!(this instanceof Jn))return new Jn(e);if(e instanceof Jn)return e;if(ul.isObject(e))return this._fromObject(e);throw new wte.InvalidArgument("TransactionSignatures must be instantiated from an object")}_te(Jn,H0);Jn.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new eR(e.publicKey),this.prevTxId=h.Buffer.isBuffer(e.prevTxId)?e.prevTxId:h.Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof H0?e.signature:h.Buffer.isBuffer(e.signature)?H0.fromBuffer(e.signature):H0.fromString(e.signature),this.sigtype=e.sigtype,this};Jn.prototype._checkObjectArgs=function(e){_n.checkArgument(eR(e.publicKey),"publicKey"),_n.checkArgument(!ul.isUndefined(e.inputIndex),"inputIndex"),_n.checkArgument(!ul.isUndefined(e.outputIndex),"outputIndex"),_n.checkState(ul.isNumber(e.inputIndex),"inputIndex must be a number"),_n.checkState(ul.isNumber(e.outputIndex),"outputIndex must be a number"),_n.checkArgument(e.signature,"signature"),_n.checkArgument(e.prevTxId,"prevTxId"),_n.checkState(e.signature instanceof H0||h.Buffer.isBuffer(e.signature)||Qk.isHexa(e.signature),"signature must be a buffer or hexa value"),_n.checkState(h.Buffer.isBuffer(e.prevTxId)||Qk.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),_n.checkArgument(e.sigtype,"sigtype"),_n.checkState(ul.isNumber(e.sigtype),"sigtype must be a number")};Jn.prototype.toObject=Jn.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};Jn.fromObject=function(e){return _n.checkArgument(e),new Jn(e)};tR.exports=Jn});var aR=k((p6e,oR)=>{"use strict";v();var Ste=Ot(),iR=Bt(),c4=sl(),xte=La(),Ete=qa(),nR=bn(),rR=Vr(),Ote=fl();function Ua(){c4.apply(this,arguments)}Ste(Ua,c4);Ua.prototype.getSignatures=function(e,t,r,i){iR.checkState(this.output instanceof xte),i=i||rR.SIGHASH_ALL|rR.SIGHASH_FORKID;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new Ote({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:Ete.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Ua.prototype.addSignature=function(e,t){return iR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(nR.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};Ua.prototype.clearSignatures=function(){return this.setScript(nR.empty()),this};Ua.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};Ua.SCRIPT_MAX_SIZE=74;Ua.prototype._estimateSize=function(){return c4.BASE_SIZE+Ua.SCRIPT_MAX_SIZE};oR.exports=Ua});var lR=k((v6e,cR)=>{"use strict";v();var Ite=Ot(),uR=Bt(),Ate=cr(),l4=sl(),Pte=La(),Tte=qa(),fR=bn(),sR=Vr(),kte=fl();function Fa(){l4.apply(this,arguments)}Ite(Fa,l4);Fa.prototype.getSignatures=function(e,t,r,i,n){uR.checkState(this.output instanceof Pte),n=n||Ate.sha256ripemd160(t.publicKey.toBuffer()),i=i||sR.SIGHASH_ALL|sR.SIGHASH_FORKID;var o=this.output.script.chunks[2]&&this.output.script.chunks[2].buf;return o&&n.equals(o)?[new kte({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:Tte.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Fa.prototype.addSignature=function(e,t){return uR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(fR.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};Fa.prototype.clearSignatures=function(){return this.setScript(fR.empty()),this};Fa.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()};Fa.SCRIPT_MAX_SIZE=108;Fa.prototype._estimateSize=function(){return l4.BASE_SIZE+Fa.SCRIPT_MAX_SIZE};cR.exports=Fa});var pR=k((y6e,dR)=>{"use strict";v();var Qn=xt(),Rte=Ot(),t6=sl(),Bte=La(),j0=Bt(),hR=bn(),e6=Vr(),h4=qa(),d4=fl(),Mte=$n(),Nte=al();function Br(e,t,r,i){t6.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new Mte(o)),j0.checkState(hR.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},Qn.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}Rte(Br,t6);Br.prototype.toObject=function(){var e=t6.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=Qn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Br.prototype._deserializeSignatures=function(e){return Qn.map(e,function(t){if(t)return new d4(t)})};Br.prototype._serializeSignatures=function(){return Qn.map(this.signatures,function(e){if(e)return e.toObject()})};Br.prototype.getSignatures=function(e,t,r,i){j0.checkState(this.output instanceof Bte),i=i||e6.SIGHASH_ALL|e6.SIGHASH_FORKID;var n=this,o=[];return Qn.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new d4({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:h4.sign(e,t,i,r,n.output.script,n.output.satoshisBN),sigtype:i}))}),o};Br.prototype.addSignature=function(e,t){return j0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),j0.checkArgument(!Qn.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),j0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Br.prototype._updateScript=function(){return this.setScript(hR.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Br.prototype._createSignatures=function(){return Qn.map(Qn.filter(this.signatures,function(e){return!Qn.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Br.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Br.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Br.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Br.prototype.countSignatures=function(){return Qn.reduce(this.signatures,function(e,t){return e+!!t},0)};Br.prototype.publicKeysWithoutSignature=function(){var e=this;return Qn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Br.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,h4.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};Br.normalizeSignatures=function(e,t,r,i,n){return n.map(function(o){var a=null;return i=i.filter(function(s){if(a)return!0;var u=new d4({signature:e6.fromTxFormat(s),publicKey:o,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:e6.SIGHASH_ALL});u.signature.nhashtype=u.sigtype;var c=h4.verify(e,u.signature,u.publicKey,u.inputIndex,t.output.script);return c?(a=u,!1):!0}),a||null})};Br.SIGNATURE_SIZE=73;Br.prototype._estimateSize=function(){var e=1+this.threshold*Br.SIGNATURE_SIZE;return t6.BASE_SIZE+Nte(e).toBuffer().length+e};dR.exports=Br});var bR=k((_6e,yR)=>{"use strict";v();var eo=xt(),Cte=Ot(),r6=sl(),Dte=La(),z0=Bt(),p4=bn(),gR=Vr(),vR=qa(),mR=fl(),Lte=$n(),qte=al();function Er(e,t,r,i){r6.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new Lte(o)),this.redeemScript=p4.buildMultisigOut(this.publicKeys,r),z0.checkState(p4.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},eo.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}Cte(Er,r6);Er.prototype.toObject=function(){var e=r6.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=eo.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Er.prototype._deserializeSignatures=function(e){return eo.map(e,function(t){if(t)return new mR(t)})};Er.prototype._serializeSignatures=function(){return eo.map(this.signatures,function(e){if(e)return e.toObject()})};Er.prototype.getSignatures=function(e,t,r,i){z0.checkState(this.output instanceof Dte),i=i||gR.SIGHASH_ALL|gR.SIGHASH_FORKID;var n=this,o=[];return eo.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new mR({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:vR.sign(e,t,i,r,n.redeemScript,n.output.satoshisBN),sigtype:i}))}),o};Er.prototype.addSignature=function(e,t){return z0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),z0.checkArgument(!eo.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),z0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Er.prototype._updateScript=function(){return this.setScript(p4.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this};Er.prototype._createSignatures=function(){return eo.map(eo.filter(this.signatures,function(e){return!eo.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Er.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Er.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Er.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Er.prototype.countSignatures=function(){return eo.reduce(this.signatures,function(e,t){return e+!!t},0)};Er.prototype.publicKeysWithoutSignature=function(){var e=this;return eo.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Er.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,vR.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript,this.output.satoshisBN)};Er.SIGNATURE_SIZE=73;Er.PUBKEY_SIZE=34;Er.prototype._estimateSize=function(){var e=this.publicKeys.length*Er.PUBKEY_SIZE,t=this.threshold*Er.SIGNATURE_SIZE,r=3+e,i=r<=75?1:r<=255?2:3,n=t+1+i+r;return r6.BASE_SIZE+qte(n).toBuffer().length+n};yR.exports=Er});var i6=k((S6e,cl)=>{v();cl.exports=sl();cl.exports.PublicKey=aR();cl.exports.PublicKeyHash=lR();cl.exports.MultiSig=pR();cl.exports.MultiSigScriptHash=bR()});var qa=k((E6e,ER)=>{"use strict";v();var Ute=Kt(),Hi=Vr(),g4=bn(),Fte=La(),Hte=Da(),K0=Wn(),_R=fr(),n6=cr(),wR=a6(),v4=Bt(),m4=o6(),Ts=xt(),SR=h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),jte="ffffffffffffffff",zte=m4.SCRIPT_ENABLE_SIGHASH_FORKID,Kte=function(e,t,r,i,n){var o=e.inputs[r];v4.checkArgument(n instanceof _R,"For ForkId=0 signatures, satoshis or complete input must be provided");function a(M){var D=new K0;Ts.each(M.inputs,function(K){D.writeReverse(K.prevTxId),D.writeUInt32LE(K.outputIndex)});var L=D.toBuffer(),U=n6.sha256sha256(L);return U}function s(M){var D=new K0;Ts.each(M.inputs,function(K){D.writeUInt32LE(K.sequenceNumber)});var L=D.toBuffer(),U=n6.sha256sha256(L);return U}function u(M,D){var L=new K0;Ts.isUndefined(D)?Ts.each(M.outputs,function(N){N.toBufferWriter(L)}):M.outputs[D].toBufferWriter(L);var U=L.toBuffer(),K=n6.sha256sha256(U);return K}var c=h.Buffer.alloc(32),l=h.Buffer.alloc(32),m=h.Buffer.alloc(32);t&Hi.SIGHASH_ANYONECANPAY||(c=a(e)),!(t&Hi.SIGHASH_ANYONECANPAY)&&(t&31)!==Hi.SIGHASH_SINGLE&&(t&31)!==Hi.SIGHASH_NONE&&(l=s(e)),(t&31)!==Hi.SIGHASH_SINGLE&&(t&31)!==Hi.SIGHASH_NONE?m=u(e):(t&31)===Hi.SIGHASH_SINGLE&&r<e.outputs.length&&(m=u(e,r));var w=new K0;w.writeInt32LE(e.version),w.write(c),w.write(l),w.writeReverse(o.prevTxId),w.writeUInt32LE(o.outputIndex),w.writeVarintNum(i.toBuffer().length),w.write(i.toBuffer()),w.writeUInt64LEBN(n);var E=o.sequenceNumber;w.writeUInt32LE(E),w.write(m),w.writeUInt32LE(e.nLockTime),w.writeUInt32LE(t>>>0);var P=w.toBuffer();return P},xR=function(t,r,i,n,o,a){var s=b4(),u=i6();Ts.isUndefined(a)&&(a=zte);var c=s.shallowCopy(t);if(n=new g4(n),a&m4.SCRIPT_ENABLE_REPLAY_PROTECTION){var l=r>>8,m=16711680|l^57005;r=m<<8|r&255}if(r&Hi.SIGHASH_FORKID&&a&m4.SCRIPT_ENABLE_SIGHASH_FORKID)return Kte(c,r,i,n,o);n.removeCodeseparators();var w;for(w=0;w<c.inputs.length;w++)c.inputs[w]=new u(c.inputs[w]).setScript(g4.empty());if(c.inputs[i]=new u(c.inputs[i]).setScript(n),(r&31)===Hi.SIGHASH_NONE||(r&31)===Hi.SIGHASH_SINGLE)for(w=0;w<c.inputs.length;w++)w!==i&&(c.inputs[w].sequenceNumber=0);if((r&31)===Hi.SIGHASH_NONE)c.outputs=[];else if((r&31)===Hi.SIGHASH_SINGLE){if(i>=c.outputs.length)return SR;for(c.outputs.length=i+1,w=0;w<i;w++)c.outputs[w]=new Fte({satoshis:_R.fromBuffer(Ute.Buffer.from(jte,"hex")),script:g4.empty()})}r&Hi.SIGHASH_ANYONECANPAY&&(c.inputs=[c.inputs[i]]);var E=new K0().write(c.toBuffer()).writeInt32LE(r).toBuffer();return E},y4=function(t,r,i,n,o,a){var s=xR(t,r,i,n,o,a);if(s.compare(SR)===0)return s;var u=n6.sha256sha256(s);return u=new Hte(u).readReverse(),u};function Vte(e,t,r,i,n,o,a){var s=y4(e,r,i,n,o,a),u=wR.sign(s,t,"little").set({nhashtype:r});return u}function Gte(e,t,r,i,n,o,a){v4.checkArgument(!Ts.isUndefined(e)),v4.checkArgument(!Ts.isUndefined(t)&&!Ts.isUndefined(t.nhashtype));var s=y4(e,t.nhashtype,i,n,o,a);return wR.verify(s,t,r,"little")}ER.exports={sighashPreimage:xR,sighash:y4,sign:Vte,verify:Gte}});var _4=k((I6e,IR)=>{"use strict";v();var Ha=xt(),s6=Bt(),OR=pi(),Zte=bn(),Wte=hf();function ja(e){if(!(this instanceof ja))return new ja(e);s6.checkArgument(Ha.isObject(e),"Must provide an object from where to extract data");var t=e.address?new Wte(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!OR.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=Ha.isUndefined(e.vout)?e.outputIndex:e.vout;if(!Ha.isNumber(i))throw new Error("Invalid outputIndex, received "+i);s6.checkArgument(!Ha.isUndefined(e.scriptPubKey)||!Ha.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new Zte(e.scriptPubKey||e.script);s6.checkArgument(!Ha.isUndefined(e.amount)||!Ha.isUndefined(e.satoshis),"Must provide an amount for the output");var o=Ha.isUndefined(e.amount)?e.satoshis:Math.round(e.amount*1e8);s6.checkArgument(Ha.isNumber(o),"Amount must be a number"),OR.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}ja.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};ja.prototype.toString=function(){return this.txId+":"+this.outputIndex};ja.fromObject=function(e){return new ja(e)};ja.prototype.toObject=ja.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:Number.parseFloat((this.satoshis/1e8).toFixed(8))}};IR.exports=ja});var b4=k((P6e,NR)=>{"use strict";v();var Ee=xt(),Wr=Bt(),Yte=Kt(),Nr=hn(),PR=pi(),TR=Da(),$te=Wn(),AR=al(),kR=cr(),f6=Vr(),RR=qa(),Xte=hf(),BR=_4(),Mr=i6(),Jte=Mr.PublicKeyHash,Qte=Mr.PublicKey,ere=Mr.MultiSigScriptHash,tre=Mr.MultiSig,to=La(),Co=bn(),rre=V0(),u6=fr(),ire=o6(),nre=ire.SCRIPT_ENABLE_SIGHASH_FORKID;function fe(e){if(!(this instanceof fe))return new fe(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof fe)return fe.shallowCopy(e);if(PR.isHexa(e))this.fromString(e);else if(h.Buffer.isBuffer(e))this.fromBuffer(e);else if(Ee.isObject(e))this.fromObject(e);else throw new Nr.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var ore=1,are=0,sre=1e6;fe.DUST_AMOUNT=546;fe.FEE_SECURITY_MARGIN=150;fe.MAX_MONEY=21e6*1e8;fe.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;fe.NLOCKTIME_MAX_VALUE=4294967295;fe.FEE_PER_KB=500;fe.CHANGE_OUTPUT_MAX_SIZE=62;fe.shallowCopy=function(e){var t=new fe(e.toBuffer());return t};var MR={configurable:!1,enumerable:!0,get:function(){return this._hash=new TR(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(fe.prototype,"hash",MR);Object.defineProperty(fe.prototype,"id",MR);var w4={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(fe.prototype,"inputAmount",w4);w4.get=function(){return this._getOutputAmount()};Object.defineProperty(fe.prototype,"outputAmount",w4);fe.prototype._getHash=function(){return kR.sha256sha256(this.toBuffer())};fe.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};fe.prototype.uncheckedSerialize=fe.prototype.toString=function(){return this.toBuffer().toString("hex")};fe.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bsv.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()};fe.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};fe.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Nr.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Nr.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};fe.prototype._hasFeeError=function(e,t){if(!Ee.isUndefined(this._fee)&&this._fee!==t)return new Nr.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(fe.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Nr.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Nr.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}};fe.prototype._missingChange=function(){return!this._changeScript};fe.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<fe.DUST_AMOUNT&&!r.script.isDataOut()&&!r.script.isSafeDataOut())return new Nr.Transaction.DustOutputs}};fe.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Nr.Transaction.MissingSignatures};fe.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};fe.prototype.toBuffer=function(){var e=new $te;return this.toBufferWriter(e).toBuffer()};fe.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),Ee.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),Ee.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e};fe.prototype.fromBuffer=function(e){var t=new TR(e);return this.fromBufferReader(t)};fe.prototype.fromBufferReader=function(e){Wr.checkArgument(!e.finished(),"No transaction data received");var t,r,i;for(this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t<r;t++){var n=Mr.fromBufferReader(e);this.inputs.push(n)}for(i=e.readVarintNum(),t=0;t<i;t++)this.outputs.push(to.fromBufferReader(e));return this.nLockTime=e.readUInt32LE(),this};fe.prototype.toObject=fe.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),Ee.isUndefined(this._changeIndex)||(i.changeIndex=this._changeIndex),Ee.isUndefined(this._fee)||(i.fee=this._fee),i};fe.prototype.fromObject=function(t){Wr.checkArgument(Ee.isObject(t)||t instanceof fe);var r=this,i;return t instanceof fe?i=i.toObject():i=t,Ee.each(i.inputs,function(n){if(!n.output||!n.output.script){r.uncheckedAddInput(new Mr(n));return}var o=new Co(n.output.script),a;if(o.isPublicKeyHashOut())a=new Mr.PublicKeyHash(n);else if(o.isScriptHashOut()&&n.publicKeys&&n.threshold)a=new Mr.MultiSigScriptHash(n,n.publicKeys,n.threshold,n.signatures);else if(o.isPublicKeyOut())a=new Mr.PublicKey(n);else throw new Nr.Transaction.Input.UnsupportedScript(n.output.script);r.addInput(a)}),Ee.each(i.outputs,function(n){r.addOutput(new to(n))}),i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new Co(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};fe.prototype._checkConsistency=function(e){Ee.isUndefined(this._changeIndex)||(Wr.checkState(this._changeScript,"Change script is expected."),Wr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),Wr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&Wr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};fe.prototype.lockUntilDate=function(e){if(Wr.checkArgument(e),Ee.isNumber(e)&&e<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.LockTimeTooEarly;Ee.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.lockUntilBlockHeight=function(e){if(Wr.checkArgument(Ee.isNumber(e)),e>=fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.BlockHeightTooHigh;if(e<0)throw new Nr.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};fe.prototype.fromString=function(e){this.fromBuffer(Yte.Buffer.from(e,"hex"))};fe.prototype._newTransaction=function(){this.version=ore,this.nLockTime=are};fe.prototype.from=function(e,t,r){if(Ee.isArray(e)){var i=this;return Ee.each(e,function(o){i.from(o,t,r)}),this}var n=Ee.some(this.inputs,function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex});return n?this:(t&&r?this._fromMultisigUtxo(e,t,r):this._fromNonP2SH(e),this)};fe.prototype._fromNonP2SH=function(e){var t;e=new BR(e),e.script.isPublicKeyHashOutPrefix()?t=Jte:e.script.isPublicKeyOut()?t=Qte:t=Mr,this.addInput(new t({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()}))};fe.prototype._fromMultisigUtxo=function(e,t,r){Wr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");var i;if(e=new BR(e),e.script.isMultisigOut())i=tre;else if(e.script.isScriptHashOut())i=ere;else throw new Nr.Transaction.Input.UnsupportedScript(e.script.toString());this.addInput(new i({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()},t,r))};fe.prototype.addInput=function(e,t,r){if(Wr.checkArgumentType(e,Mr,"input"),!e.output&&(Ee.isUndefined(t)||Ee.isUndefined(r)))throw new Nr.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&!Ee.isUndefined(r)&&(t=t instanceof Co?t:new Co(t),Wr.checkArgumentType(r,"number","satoshis"),e.output=new to({script:t,satoshis:r})),this.uncheckedAddInput(e)};fe.prototype.uncheckedAddInput=function(e){return Wr.checkArgumentType(e,Mr,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};fe.prototype.hasAllUtxoInfo=function(){return Ee.every(this.inputs.map(function(e){return!!e.output}))};fe.prototype.fee=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};fe.prototype.feePerKb=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};fe.prototype.change=function(e){return Wr.checkArgument(e,"address is required"),this._changeScript=Co.fromAddress(e),this._updateChangeOutput(),this};fe.prototype.getChangeOutput=function(){return Ee.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]};fe.prototype.to=function(e,t){if(Ee.isArray(e)){var r=this;return Ee.each(e,function(i){r.to(i.address,i.satoshis)}),this}return Wr.checkArgument(PR.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new to({script:Co(new Xte(e)),satoshis:t})),this};fe.prototype.addData=function(e){return this.addOutput(new to({script:Co.buildDataOut(e),satoshis:0})),this};fe.prototype.addSafeData=function(e){return this.addOutput(new to({script:Co.buildSafeDataOut(e),satoshis:0})),this};fe.prototype.addOutput=function(e){return Wr.checkArgumentType(e,to,"output"),this._addOutput(e),this._updateChangeOutput(),this};fe.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};fe.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};fe.prototype._getOutputAmount=function(){if(Ee.isUndefined(this._outputAmount)){var e=this;this._outputAmount=0,Ee.each(this.outputs,function(t){e._outputAmount+=t.satoshis})}return this._outputAmount};fe.prototype._getInputAmount=function(){if(Ee.isUndefined(this._inputAmount)){var e=this;this._inputAmount=0,Ee.each(this.inputs,function(t){if(Ee.isUndefined(t.output))throw new Nr.Transaction.Input.MissingPreviousOutput;e._inputAmount+=t.output.satoshis})}return this._inputAmount};fe.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),Ee.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex),this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:0}));var e=this._getUnspentValue(),t=this.getFee(),r=e-t;this._removeOutput(this._changeIndex),this._changeIndex=void 0,r>=fe.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:r})))}};fe.prototype.getFee=function(){return this.isCoinbase()?0:Ee.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee};fe.prototype._estimateFee=function(){var e=this._estimateSize();return Math.ceil(e/1e3*(this._feePerKb||fe.FEE_PER_KB))};fe.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};fe.prototype._clearSignatures=function(){Ee.each(this.inputs,function(e){e.clearSignatures!==Mr.prototype.clearSignatures&&e.clearSignatures()})};fe.prototype._estimateSize=function(){var e=8;return e+=AR(this.inputs.length).toBuffer().length,e+=AR(this.outputs.length).toBuffer().length,Ee.each(this.inputs,function(t){e+=t._estimateSize()}),Ee.each(this.outputs,function(t){e+=t.getSize()}),e};fe.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=Ee.without(this.outputs,t),this._outputAmount=void 0};fe.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};fe.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.prevTxId.compare(i.prevTxId)||r.outputIndex-i.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.satoshis-i.satoshis||r.script.toBuffer().compare(i.script.toBuffer())}),t}),this};fe.prototype.shuffleOutputs=function(){return this.sortOutputs(Ee.shuffle)};fe.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};fe.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};fe.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||Ee.difference(this.outputs,e).length!==0;if(t)throw new Nr.Transaction.InvalidSorting;if(!Ee.isUndefined(this._changeIndex)){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};fe.prototype.removeInput=function(e,t){var r;if(!t&&Ee.isNumber(e)?r=e:r=Ee.findIndex(this.inputs,function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Nr.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=Ee.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};fe.prototype.sign=function(e,t){Wr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return Ee.isArray(e)?(Ee.each(e,function(i){r.sign(i,t)}),this):(Ee.each(this.getSignatures(e,t),function(i){r.applySignature(i)}),this)};fe.prototype.getSignatures=function(e,t){e=new rre(e),t=t||f6.SIGHASH_ALL|f6.SIGHASH_FORKID;var r=this,i=[],n=kR.sha256ripemd160(e.publicKey.toBuffer());return Ee.each(this.inputs,function(a,s){Ee.each(a.getSignatures(r,e,s,t,n),function(u){i.push(u)})}),i};fe.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this};fe.prototype.isFullySigned=function(){return Ee.each(this.inputs,function(e){if(e.isFullySigned===Mr.prototype.isFullySigned)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),Ee.every(Ee.map(this.inputs,function(e){return e.isFullySigned()}))};fe.prototype.isValidSignature=function(e){var t=this;if(this.inputs[e.inputIndex].isValidSignature===Mr.prototype.isValidSignature)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(t,e)};fe.prototype.verifySignature=function(e,t,r,i,n,o){return RR.verify(this,e,t,r,i,n,o)};fe.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new u6(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new u6(fe.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new u6(fe.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>sre)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(!Ee.isUndefined(i[o]))return"transaction input "+t+" duplicate input";i[o]=!0}var a=this.isCoinbase();if(a){var s=this.inputs[0]._scriptBuffer;if(s.length<2||s.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};fe.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};fe.prototype.sighash=function(e,t,r,i,n){t=t||f6.SIGHASH_ALL|f6.SIGHASH_FORKID;var o=this.inputs[e];if(!o)throw new Error("Input index "+e+" does not exist");return!r&&o.output&&(r=o.output.script),!i&&o.output&&(i=new u6(o.output.satoshis)),n=n||nre,RR.sighash(this,t,e,r,i,n)};NR.exports=fe});var ks=k((k6e,df)=>{v();df.exports=b4();df.exports.Input=i6();df.exports.Output=La();df.exports.UnspentOutput=_4();df.exports.Signature=fl();df.exports.Sighash=qa()});var o6=k((B6e,DR)=>{"use strict";v();var c6=xt(),Z0=i4(),V=Yp(),Pe=fr(),G0=cr(),pf=Vr(),S4=$n(),CR=zk(),oe=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};oe.prototype.verify=function(e,t,r,i,n,o){var a=ks();if(c6.isUndefined(r)&&(r=new a),c6.isUndefined(i)&&(i=0),c6.isUndefined(n)&&(n=0),n&oe.SCRIPT_ENABLE_SIGHASH_FORKID&&(n|=oe.SCRIPT_VERIFY_STRICTENC,!o))throw new Error("internal error - need satoshisBN to verify FORKID transactions");this.set({script:e,tx:r,nin:i,flags:n,satoshisBN:o});var s;if((n&oe.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;n&oe.SCRIPT_VERIFY_P2SH&&(s=this.stack.slice());var u=this.stack;if(this.initialize(),this.set({script:t,stack:u,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var c=this.stack[this.stack.length-1];if(!oe.castToBool(c))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(n&oe.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(s.length===0)throw new Error("internal error - stack copy empty");var l=s[s.length-1],m=Z0.fromBuffer(l);if(s.pop(),this.initialize(),this.set({script:m,stack:s,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(s.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!oe.castToBool(s[s.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if((n&oe.SCRIPT_VERIFY_CLEANSTACK)!==0){if((n&oe.SCRIPT_VERIFY_P2SH)===0)throw new Error("internal error - CLEANSTACK without P2SH");if(s.length!==1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0};DR.exports=oe;oe.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0};oe.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin<"u"?e.nin:this.nin,this.satoshisBN=e.satoshisBN||this.satoshisBN,this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc<"u"?e.pc:this.pc,this.pbegincodehash=typeof e.pbegincodehash<"u"?e.pbegincodehash:this.pbegincodehash,this.nOpCount=typeof e.nOpCount<"u"?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags<"u"?e.flags:this.flags};oe.true=h.Buffer.from([1]);oe.false=h.Buffer.from([]);oe.MAX_SCRIPT_ELEMENT_SIZE=520;oe.MAXIMUM_ELEMENT_SIZE=4;oe.MAX_OPS_PER_SCRIPT=201;oe.LOCKTIME_THRESHOLD=5e8;oe.LOCKTIME_THRESHOLD_BN=new Pe(oe.LOCKTIME_THRESHOLD);oe.useGenesisLimits=function(e){return e=e||2147483647,oe.MAX_SCRIPT_ELEMENT_SIZE=e,oe.MAXIMUM_ELEMENT_SIZE=e,oe.MAX_OPS_PER_SCRIPT=e,oe};oe.SCRIPT_VERIFY_NONE=0;oe.SCRIPT_VERIFY_P2SH=1;oe.SCRIPT_VERIFY_STRICTENC=2;oe.SCRIPT_VERIFY_DERSIG=4;oe.SCRIPT_VERIFY_LOW_S=8;oe.SCRIPT_VERIFY_NULLDUMMY=16;oe.SCRIPT_VERIFY_SIGPUSHONLY=32;oe.SCRIPT_VERIFY_MINIMALDATA=64;oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;oe.SCRIPT_VERIFY_CLEANSTACK=256;oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;oe.SCRIPT_VERIFY_MINIMALIF=8192;oe.SCRIPT_VERIFY_NULLFAIL=16384;oe.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768;oe.SCRIPT_ENABLE_SIGHASH_FORKID=65536;oe.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;oe.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18;oe.SCRIPT_ENABLE_MAGNETIC_OPCODES=1<<19;oe.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;oe.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;oe.SEQUENCE_LOCKTIME_MASK=65535;oe.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};oe.prototype.checkSignatureEncoding=function(e){var t;if(e.length===0)return!0;if((this.flags&(oe.SCRIPT_VERIFY_DERSIG|oe.SCRIPT_VERIFY_LOW_S|oe.SCRIPT_VERIFY_STRICTENC))!==0&&!pf.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if((this.flags&oe.SCRIPT_VERIFY_LOW_S)!==0){if(t=pf.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if((this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0){if(t=pf.fromTxFormat(e),!t.hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nhashtype&pf.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nhashtype&pf.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0};oe.prototype.checkPubkeyEncoding=function(e){return(this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0&&!S4.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):!0};oe._isMinimallyEncoded=function(e,t){return t=t||oe.MAXIMUM_ELEMENT_SIZE,!(e.length>t||e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))};oe._minimallyEncode=function(e){if(e.length===0)return e;var t=e[e.length-1];if(t&127)return e;if(e.length===1)return h.Buffer.from("");if(e[e.length-2]&128)return e;for(var r=e.length-1;r>0;r--)if(e[r-1]!==0)return e[r-1]&128?e[r++]=t:e[r-1]|=t,e.slice(0,r);return h.Buffer.from("")};oe.prototype.evaluate=function(){if(this.script.toBuffer().length>1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let t={pc:this.pc,opcode:V.fromNumber(this.script.chunks[this.pc].opcodenum)};var e=this.step();if(!e)return!1;this._callbackStep(t)}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(t){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};oe.prototype._callbackStep=function(e){if(typeof this.stepListener=="function")try{this.stepListener(e,CR(this.stack,!0),CR(this.altstack,!0))}catch(t){console.log(`Error in Step callback:${t}`)}};oe.prototype.checkLockTime=function(e){return!(!(this.tx.nLockTime<oe.LOCKTIME_THRESHOLD&&e.lt(oe.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=oe.LOCKTIME_THRESHOLD&&e.gte(oe.LOCKTIME_THRESHOLD_BN))||e.gt(new Pe(this.tx.nLockTime))||this.tx.inputs[this.nin].isFinal())};oe.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2||t&oe.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=oe.SEQUENCE_LOCKTIME_TYPE_FLAG|oe.SEQUENCE_LOCKTIME_MASK,i=new Pe(t&r),n=e.and(r),o=new Pe(oe.SEQUENCE_LOCKTIME_TYPE_FLAG);return!(!(i.lt(o)&&n.lt(o)||i.gte(o)&&n.gte(o))||n.gt(i))};function ure(e,t){let r=e;for(;r.length<t;)r=h.Buffer.concat([h.Buffer.from([0]),r]);return r}oe.prototype.step=function(){var e=this;function t(se){return e.stack[e.stack.length+se]}function r(se){switch(se){case V.OP_2MUL:case V.OP_2DIV:return!0;case V.OP_INVERT:case V.OP_MUL:case V.OP_LSHIFT:case V.OP_RSHIFT:if((e.flags&oe.SCRIPT_ENABLE_MAGNETIC_OPCODES)===0)return!0;break;case V.OP_DIV:case V.OP_MOD:case V.OP_SPLIT:case V.OP_CAT:case V.OP_AND:case V.OP_OR:case V.OP_XOR:case V.OP_BIN2NUM:case V.OP_NUM2BIN:return!1;default:break}return!1}var i=(this.flags&oe.SCRIPT_VERIFY_MINIMALDATA)!==0,n=this.vfExec.indexOf(!1)===-1,o,a,s,u,c,l,m,w,E,P,M,D,L,U,K,N,C,F=this.script.chunks[this.pc];this.pc++;var H=F.opcodenum;if(c6.isUndefined(H))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(F.buf&&F.buf.length>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(H>V.OP_16&&++this.nOpCount>oe.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(r(H))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(n&&H>=0&&H<=V.OP_PUSHDATA4){if(i&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!F.buf)this.stack.push(oe.false);else{if(F.len!==F.buf.length)throw new Error(`Length of push value not equal to length of data (${F.len},${F.buf.length})`);this.stack.push(F.buf)}}else if(n||V.OP_IF<=H&&H<=V.OP_ENDIF)switch(H){case V.OP_1NEGATE:case V.OP_1:case V.OP_2:case V.OP_3:case V.OP_4:case V.OP_5:case V.OP_6:case V.OP_7:case V.OP_8:case V.OP_9:case V.OP_10:case V.OP_11:case V.OP_12:case V.OP_13:case V.OP_14:case V.OP_15:case V.OP_16:c=H-(V.OP_1-1),o=new Pe(c).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_NOP:break;case V.OP_NOP2:case V.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var z=Pe.fromScriptNumBuffer(this.stack[this.stack.length-1],i,5);if(z.lt(new Pe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(z))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP3:case V.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var G=Pe.fromScriptNumBuffer(t(-1),i,5);if(G.lt(new Pe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((G&oe.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(G))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP1:case V.OP_NOP4:case V.OP_NOP5:case V.OP_NOP6:case V.OP_NOP7:case V.OP_NOP8:case V.OP_NOP9:case V.OP_NOP10:if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case V.OP_IF:case V.OP_NOTIF:if(N=!1,n){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(o=t(-1),this.flags&oe.SCRIPT_VERIFY_MINIMALIF){if(o.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(o.length===1&&o[0]!==1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}N=oe.castToBool(o),H===V.OP_NOTIF&&(N=!N),this.stack.pop()}this.vfExec.push(N);break;case V.OP_ELSE:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case V.OP_ENDIF:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case V.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),N=oe.castToBool(o),N)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1;break;case V.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case V.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case V.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case V.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case V.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3),s=t(-2);var B=t(-1);this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s)),this.stack.push(h.Buffer.from(B));break;case V.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-4),s=t(-3),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-6,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-4,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1),N=oe.castToBool(o),N&&this.stack.push(h.Buffer.from(o));break;case V.OP_DEPTH:o=new Pe(this.stack.length).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case V.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-1)));break;case V.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case V.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-2)));break;case V.OP_PICK:case V.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),w=Pe.fromScriptNumBuffer(o,i),c=w.toNumber(),this.stack.pop(),c<0||c>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-c-1),H===V.OP_ROLL&&this.stack.splice(this.stack.length-c-1,1),this.stack.push(h.Buffer.from(o));break;case V.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-3),m=t(-2);var g=t(-1);this.stack[this.stack.length-3]=m,this.stack[this.stack.length-2]=g,this.stack[this.stack.length-1]=l;break;case V.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-2),m=t(-1),this.stack[this.stack.length-2]=m,this.stack[this.stack.length-1]=l;break;case V.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,h.Buffer.from(t(-1)));break;case V.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;w=new Pe(t(-1).length),this.stack.push(w.toScriptNumBuffer());break;case V.OP_AND:case V.OP_OR:case V.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length!==s.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(H){case V.OP_AND:for(let se=0;se<a.length;se++)a[se]&=s[se];break;case V.OP_OR:for(let se=0;se<a.length;se++)a[se]|=s[se];break;case V.OP_XOR:for(let se=0;se<a.length;se++)a[se]^=s[se];break;default:break}this.stack.pop();break;case V.OP_INVERT:this.stack.length<1&&(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION"),o=t(-1);for(let se=0;se<o.length;se++)o[se]=~o[se];break;case V.OP_LSHIFT:case V.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),a.length===0)this.stack.pop();else{if(E=new Pe(a),P=Pe.fromScriptNumBuffer(t(-1),i),c=P.toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop();let se;H===V.OP_LSHIFT&&(se=E.ushln(c)),H===V.OP_RSHIFT&&(se=E.ushrn(c));let ue=ure(h.Buffer.from(se.toArray().slice(a.length*-1)),a.length);this.stack.push(ue)}break;case V.OP_EQUAL:case V.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1);var O=a.toString("hex")===s.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(O?oe.true:oe.false),H===V.OP_EQUALVERIFY)if(O)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;break;case V.OP_1ADD:case V.OP_1SUB:case V.OP_NEGATE:case V.OP_ABS:case V.OP_NOT:case V.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(o=t(-1),w=Pe.fromScriptNumBuffer(o,i),H){case V.OP_1ADD:w=w.add(Pe.One);break;case V.OP_1SUB:w=w.sub(Pe.One);break;case V.OP_NEGATE:w=w.neg();break;case V.OP_ABS:w.cmp(Pe.Zero)<0&&(w=w.neg());break;case V.OP_NOT:w=new Pe((w.cmp(Pe.Zero)===0)+0);break;case V.OP_0NOTEQUAL:w=new Pe((w.cmp(Pe.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(w.toScriptNumBuffer());break;case V.OP_ADD:case V.OP_SUB:case V.OP_MUL:case V.OP_MOD:case V.OP_DIV:case V.OP_BOOLAND:case V.OP_BOOLOR:case V.OP_NUMEQUAL:case V.OP_NUMEQUALVERIFY:case V.OP_NUMNOTEQUAL:case V.OP_LESSTHAN:case V.OP_GREATERTHAN:case V.OP_LESSTHANOREQUAL:case V.OP_GREATERTHANOREQUAL:case V.OP_MIN:case V.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(E=Pe.fromScriptNumBuffer(t(-2),i,oe.MAXIMUM_ELEMENT_SIZE),P=Pe.fromScriptNumBuffer(t(-1),i,oe.MAXIMUM_ELEMENT_SIZE),w=new Pe(0),H){case V.OP_ADD:w=E.add(P);break;case V.OP_SUB:w=E.sub(P);break;case V.OP_MUL:w=E.mul(P);break;case V.OP_DIV:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.div(P);break;case V.OP_MOD:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.mod(P);break;case V.OP_BOOLAND:w=new Pe((E.cmp(Pe.Zero)!==0&&P.cmp(Pe.Zero)!==0)+0);break;case V.OP_BOOLOR:w=new Pe((E.cmp(Pe.Zero)!==0||P.cmp(Pe.Zero)!==0)+0);break;case V.OP_NUMEQUAL:w=new Pe((E.cmp(P)===0)+0);break;case V.OP_NUMEQUALVERIFY:w=new Pe((E.cmp(P)===0)+0);break;case V.OP_NUMNOTEQUAL:w=new Pe((E.cmp(P)!==0)+0);break;case V.OP_LESSTHAN:w=new Pe((E.cmp(P)<0)+0);break;case V.OP_GREATERTHAN:w=new Pe((E.cmp(P)>0)+0);break;case V.OP_LESSTHANOREQUAL:w=new Pe((E.cmp(P)<=0)+0);break;case V.OP_GREATERTHANOREQUAL:w=new Pe((E.cmp(P)>=0)+0);break;case V.OP_MIN:w=E.cmp(P)<0?E:P;break;case V.OP_MAX:w=E.cmp(P)>0?E:P;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(w.toScriptNumBuffer()),H===V.OP_NUMEQUALVERIFY)if(oe.castToBool(t(-1)))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;break;case V.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;E=Pe.fromScriptNumBuffer(t(-3),i,oe.MAXIMUM_ELEMENT_SIZE),P=Pe.fromScriptNumBuffer(t(-2),i,oe.MAXIMUM_ELEMENT_SIZE);var y=Pe.fromScriptNumBuffer(t(-1),i,oe.MAXIMUM_ELEMENT_SIZE);N=P.cmp(E)<=0&&E.cmp(y)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(N?oe.true:oe.false);break;case V.OP_RIPEMD160:case V.OP_SHA1:case V.OP_SHA256:case V.OP_HASH160:case V.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1);var f;H===V.OP_RIPEMD160?f=G0.ripemd160(o):H===V.OP_SHA1?f=G0.sha1(o):H===V.OP_SHA256?f=G0.sha256(o):H===V.OP_HASH160?f=G0.sha256ripemd160(o):H===V.OP_HASH256&&(f=G0.sha256sha256(o)),this.stack.pop(),this.stack.push(f);break;case V.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case V.OP_CHECKSIG:case V.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(M=t(-2),D=t(-1),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;L=new Z0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});var d=new Z0().add(M);L.findAndDelete(d);try{U=pf.fromTxFormat(M),K=S4.fromBuffer(D,!1),C=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{C=!1}if(!C&&this.flags&oe.SCRIPT_VERIFY_NULLFAIL&&M.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(C?oe.true:oe.false),H===V.OP_CHECKSIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;break;case V.OP_CHECKMULTISIG:case V.OP_CHECKMULTISIGVERIFY:var _=1;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var x=Pe.fromScriptNumBuffer(t(-_),i).toNumber();if(x<0||x>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=x,this.nOpCount>oe.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var b=++_;_+=x;var p=x+2;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var I=Pe.fromScriptNumBuffer(t(-_),i).toNumber();if(I<0||I>x)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var T=++_;if(_+=I,this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;L=new Z0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var S=0;S<I;S++)M=t(-T-S),L.findAndDelete(new Z0().add(M));for(C=!0;C&&I>0;){if(M=t(-T),D=t(-b),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;var R;try{U=pf.fromTxFormat(M),K=S4.fromBuffer(D,!1),R=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{R=!1}R&&(T++,I--),b++,x--,I>x&&(C=!1)}for(;_-- >1;){if(!C&&this.flags&oe.SCRIPT_VERIFY_NULLFAIL&&!p&&t(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;p>0&&p--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&oe.SCRIPT_VERIFY_NULLDUMMY&&t(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(C?oe.true:oe.false),H===V.OP_CHECKMULTISIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;break;case V.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length+s.length>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=h.Buffer.concat([a,s]),this.stack.pop();break;case V.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2);var Y=Pe.fromScriptNumBuffer(t(-1),i).toNumber();if(Y<0||Y>a.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var X=h.Buffer.from(a);this.stack[this.stack.length-2]=X.slice(0,Y),this.stack[this.stack.length-1]=X.slice(Y);break;case V.OP_LEFT:case V.OP_RIGHT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),c=Pe.fromScriptNumBuffer(t(-1),i).toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;c>a.length&&(c=a.length),this.stack.pop(),H===V.OP_LEFT?this.stack[this.stack.length-1]=h.Buffer.from(a).slice(0,c):this.stack[this.stack.length-1]=h.Buffer.from(a).slice(a.length-c);break;case V.OP_SUBSTR:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3);var ie=Pe.fromScriptNumBuffer(t(-1),i).toNumber(),ce=Pe.fromScriptNumBuffer(t(-2),i).toNumber();if(ce<0||ie<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;ce>a.length&&(ce=a.length),ce+ie>a.length&&(ie=a.length-ce),this.stack.pop(),this.stack.pop(),this.stack[this.stack.length-1]=h.Buffer.from(a).slice(ce,ce+ie);break;case V.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var pe=Pe.fromScriptNumBuffer(t(-1),i).toNumber();if(pe>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var q=t(-1);if(q=oe._minimallyEncode(q),q.length>pe)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(q.length===pe){this.stack[this.stack.length-1]=q;break}var W=0;q.length>0&&(W=q[q.length-1]&128,q[q.length-1]&=127);var $=h.Buffer.alloc(pe);q.copy($,0);for(var ee=q.length-1;ee++<pe-2;)$[ee]=0;$[ee]=W,this.stack[this.stack.length-1]=$;break;case V.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-1),s=oe._minimallyEncode(a),this.stack[this.stack.length-1]=s,!oe._isMinimallyEncoded(s))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}});var bn=k((N6e,x4)=>{v();x4.exports=i4();x4.exports.Interpreter=o6()});var hf=k((D6e,FR)=>{"use strict";v();var E4=xt(),za=Bt(),fre=hn(),LR=tl(),wn=Ss(),qR=cr(),UR=pi(),O4=$n();function me(e,t,r){if(!(this instanceof me))return new me(e,t,r);if(E4.isArray(e)&&E4.isNumber(t))return me.createMultisig(e,t,r);if(e instanceof me)return e;if(za.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!wn.get(t))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==me.PayToPublicKeyHash&&r!==me.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||wn.get(t)||wn.defaultNetwork,i.type=i.type||r||me.PayToPublicKeyHash,UR.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}me.prototype._classifyArguments=function(e,t,r){if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===20)return me._transformHash(e);if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===21)return me._transformBuffer(e,t,r);if(e instanceof O4)return me._transformPublicKey(e);if(e instanceof W0)return me._transformScript(e,t);if(typeof e=="string")return me._transformString(e,t,r);if(E4.isObject(e))return me._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};me.PayToPublicKeyHash="pubkeyhash";me.PayToScriptHash="scripthash";me._transformHash=function(e){var t={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t};me._transformObject=function(e){return za.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),za.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?h.Buffer.from(e.hash,"hex"):e.hashBuffer,network:wn.get(e.network)||wn.defaultNetwork,type:e.type}};me._classifyFromVersion=function(e){var t={},r=wn.get(e[0],"pubkeyhash"),i=wn.get(e[0],"scripthash");return r?(t.network=r,t.type=me.PayToPublicKeyHash):i&&(t.network=i,t.type=me.PayToScriptHash),t};me._transformBuffer=function(e,t,r){var i={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==21)throw new TypeError("Address buffers must be exactly 21 bytes.");var n=wn.get(t),o=me._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n!==o.network)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=o.network,i.type=o.type,i};me._transformPublicKey=function(e){var t={};if(!(e instanceof O4))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=qR.sha256ripemd160(e.toBuffer()),t.type=me.PayToPublicKeyHash,t};me._transformScript=function(e,t){za.checkArgument(e instanceof W0,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new fre.Script.CantDeriveAddress(e);return r};me.createMultisig=function(e,t,r){return r=r||e[0].network||wn.defaultNetwork,me.payingTo(W0.buildMultisigOut(e,t),r)};me._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length<27)throw new Error("Invalid Address string provided");e=e.trim();var i=wn.get(t);if(t&&!i)throw new TypeError("Unknown network");var n=LR.decode(e);return me._transformBuffer(n,t,r)};me.fromPublicKey=function(e,t){var r=me._transformPublicKey(e);return t=t||wn.defaultNetwork,new me(r.hashBuffer,t,r.type)};me.fromPrivateKey=function(e,t){let r=O4.fromPrivateKey(e);return t=t||e.network||wn.defaultNetwork,me.fromPublicKey(r,t)};me.fromPublicKeyHash=function(e,t){var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToPublicKeyHash)};me.fromScriptHash=function(e,t){za.checkArgument(e,"hash parameter is required");var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToScriptHash)};me.payingTo=function(e,t){return za.checkArgument(e,"script is required"),za.checkArgument(e instanceof W0,"script must be instance of Script"),me.fromScriptHash(qR.sha256ripemd160(e.toBuffer()),t)};me.fromScript=function(e,t){za.checkArgument(e instanceof W0,"script must be a Script instance");var r=me._transformScript(e,t);return new me(r.hashBuffer,t,r.type)};me.fromBuffer=function(e,t,r){var i=me._transformBuffer(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromHex=function(e,t,r){return me.fromBuffer(h.Buffer.from(e,"hex"),t,r)};me.fromString=function(e,t,r){var i=me._transformString(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromObject=function(t){za.checkState(UR.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=h.Buffer.from(t.hash,"hex");return new me(r,t.network,t.type)};me.getValidationError=function(e,t,r){var i;try{new me(e,t,r)}catch(n){i=n}return i};me.isValid=function(e,t,r){return!me.getValidationError(e,t,r)};me.prototype.isPayToPublicKeyHash=function(){return this.type===me.PayToPublicKeyHash};me.prototype.isPayToScriptHash=function(){return this.type===me.PayToScriptHash};me.prototype.toBuffer=function(){var e=h.Buffer.from([this.network[this.type]]),t=h.Buffer.concat([e,this.hashBuffer]);return t};me.prototype.toHex=function(){return this.toBuffer().toString("hex")};me.prototype.toObject=me.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};me.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};me.prototype.toString=function(){return LR.encode(this.toBuffer())};FR.exports=me;var W0=bn()});var V0=k((q6e,VR)=>{"use strict";v();var l6=xt(),cre=hf(),HR=tl(),gf=fr(),jR=pi(),Ka=Ss(),zR=vn(),lre=$n(),hre=ds(),KR=Bt();function Me(e,t){if(!(this instanceof Me))return new Me(e,t);if(e instanceof Me)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new gf(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(zR.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return jR.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}Me.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?Ka.get(t):Ka.defaultNetwork};if(l6.isUndefined(e)||l6.isNull(e))r.bn=Me._getRandomBN();else if(e instanceof gf)r.bn=e;else if(e instanceof h.Buffer||e instanceof Uint8Array)r=Me._transformBuffer(e,t);else if(e.bn&&e.network)r=Me._transformObject(e);else if(!t&&Ka.get(e))r.bn=Me._getRandomBN(),r.network=Ka.get(e);else if(typeof e=="string")jR.isHexa(e)?r.bn=new gf(h.Buffer.from(e,"hex")):r=Me._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};Me._getRandomBN=function(){var e,t;do{var r=hre.getRandomBuffer(32);t=gf.fromBuffer(r),e=t.lt(zR.getN())}while(!e);return t};Me._transformBuffer=function(e,t){var r={};if(e.length===32)return Me._transformBNBuffer(e,t);if(r.network=Ka.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==Ka.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=gf.fromBuffer(e.slice(1,33)),r};Me._transformBNBuffer=function(e,t){var r={};return r.network=Ka.get(t)||Ka.defaultNetwork,r.bn=gf.fromBuffer(e),r.compressed=!1,r};Me._transformWIF=function(e,t){return Me._transformBuffer(HR.decode(e),t)};Me.fromBuffer=function(e,t){return new Me(e,t)};Me.fromHex=function(e,t){return Me.fromBuffer(h.Buffer.from(e,"hex"),t)};Me._transformObject=function(e){var t=new gf(e.bn,"hex"),r=Ka.get(e.network);return{bn:t,network:r,compressed:e.compressed}};Me.fromString=Me.fromWIF=function(e){return KR.checkArgument(l6.isString(e),"First argument is expected to be a string."),new Me(e)};Me.fromObject=Me.fromJSON=function(e){return KR.checkArgument(l6.isObject(e),"First argument is expected to be an object."),new Me(e)};Me.fromRandom=function(e){var t=Me._getRandomBN();return new Me(t,e)};Me.getValidationError=function(e,t){var r;try{new Me(e,t)}catch(i){r=i}return r};Me.isValid=function(e,t){return e?!Me.getValidationError(e,t):!1};Me.prototype.toString=function(){return this.toWIF()};Me.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),h.Buffer.from([1])]):r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),HR.encode(r)};Me.prototype.toBigNumber=function(){return this.bn};Me.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};Me.prototype.toHex=function(){return this.toBuffer().toString("hex")};Me.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=lre.fromPrivateKey(this)),this._pubkey};Me.prototype.toAddress=function(e){var t=this.toPublicKey();return cre.fromPublicKey(t,e||this.network)};Me.prototype.toObject=Me.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};Me.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toHex()+", network: "+this.network+e+">"};VR.exports=Me});var $n=k((F6e,ZR)=>{"use strict";v();var ll=fr(),hl=vn(),dre=cr(),pre=pi(),GR=Ss(),I4=xt(),vf=Bt();function Se(e,t){if(!(this instanceof Se))return new Se(e,t);if(vf.checkArgument(e,"First argument is required, please include public key data."),e instanceof Se)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),pre.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||GR.defaultNetwork}),this}Se.prototype._classifyArgs=function(e,t){var r={compressed:I4.isUndefined(t.compressed)||t.compressed};if(e instanceof hl)r.point=e;else if(e.x&&e.y)r=Se._transformObject(e);else if(typeof e=="string")r=Se._transformDER(h.Buffer.from(e,"hex"));else if(Se._isBuffer(e))r=Se._transformDER(e);else if(Se._isPrivateKey(e))r=Se._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=I4.isUndefined(t.network)?void 0:GR.get(t.network)),r};Se._isPrivateKey=function(e){var t=V0();return e instanceof t};Se._isBuffer=function(e){return e instanceof h.Buffer||e instanceof Uint8Array};Se._transformPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=hl.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};Se._transformDER=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r={};t=I4.isUndefined(t)?!0:t;var i,n,o,a;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),a=e.slice(33,65),o.length!==32||a.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new ll(o),n=new ll(a),r.point=new hl(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new ll(o),r=Se._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new ll(o),r=Se._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};Se._transformX=function(e,t){vf.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=hl.fromX(e,t),r};Se._transformObject=function(e){var t=new ll(e.x,"hex"),r=new ll(e.y,"hex"),i=new hl(t,r);return new Se(i,{compressed:e.compressed})};Se.fromPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t=Se._transformPrivateKey(e);return new Se(t.point,{compressed:t.compressed,network:t.network})};Se.fromDER=Se.fromBuffer=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r=Se._transformDER(e,t);return new Se(r.point,{compressed:r.compressed})};Se.fromPoint=function(e,t){return vf.checkArgument(e instanceof hl,"First argument must be an instance of Point."),new Se(e,{compressed:t})};Se.fromHex=Se.fromString=function(e,t){var r=h.Buffer.from(e,t||"hex"),i=Se._transformDER(r);return new Se(i.point,{compressed:i.compressed})};Se.fromX=function(e,t){var r=Se._transformX(e,t);return new Se(r.point,{compressed:r.compressed})};Se.getValidationError=function(e){var t;try{new Se(e)}catch(r){t=r}return t};Se.isValid=function(e){return!Se.getValidationError(e)};Se.prototype.toObject=Se.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};Se.prototype.toBuffer=Se.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=h.Buffer.from([3]):n=h.Buffer.from([2]),h.Buffer.concat([n,r])}else return n=h.Buffer.from([4]),h.Buffer.concat([n,r,i])};Se.prototype._getID=function(){return dre.sha256ripemd160(this.toBuffer())};Se.prototype.toAddress=function(e){var t=hf();return t.fromPublicKey(this,e||this.network)};Se.prototype.toString=Se.prototype.toHex=function(){return this.toDER().toString("hex")};Se.prototype.inspect=function(){return"<PublicKey: "+this.toHex()+(this.compressed?"":", uncompressed")+">"};ZR.exports=Se});var a6=k((j6e,WR)=>{"use strict";v();var ji=fr(),Do=vn(),gre=Vr(),vre=$n(),mre=ds(),Rs=cr(),yre=xt(),A4=Bt(),zt=function e(t){if(!(this instanceof e))return new e(t);t&&this.set(t)};Object.defineProperty(zt.prototype,"k",{get:function(){return this._k},set:function(e){this._k=e,this._kFresh=!0},enumerable:!0,configurable:!0});zt.prototype.set=function(e){if(this.hashbuf=e.hashbuf||this.hashbuf,this.endian=e.endian||this.endian,this.privkey=e.privkey||this.privkey,this.pubkey=e.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),e.sig)if(h.Buffer.isBuffer(e.sig)){var t=Vr();this.sig=t.fromDER(e.sig)}else this.sig=e.sig;else this.sig=this.sig;return e.k&&(this.k=e.k),this.verified=e.verified||this.verified,this};zt.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()};zt.prototype.calci=function(){for(var e=0;e<4;e++){this.sig.i=e;var t;try{t=this.toPublicKey()}catch(r){console.error(r);continue}if(t.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")};zt.fromString=function(e){var t=JSON.parse(e);return new zt(t)};zt.prototype.randomK=function(){var e=Do.getN(),t;do t=ji.fromBuffer(mre.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(ji.Zero)));return this.k=t,this};zt.prototype.deterministicK=function(e){yre.isUndefined(e)&&(e=0);var t=h.Buffer.alloc(32);t.fill(1);var r=h.Buffer.alloc(32);r.fill(0);var i=this.privkey.bn.toBuffer({size:32}),n=this.endian==="little"?h.Buffer.from(this.hashbuf).reverse():this.hashbuf;r=Rs.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0]),i,n]),r),t=Rs.sha256hmac(t,r),r=Rs.sha256hmac(h.Buffer.concat([t,h.Buffer.from([1]),i,n]),r),t=Rs.sha256hmac(t,r),t=Rs.sha256hmac(t,r);for(var o=ji.fromBuffer(t),a=Do.getN(),s=0;s<e||!(o.lt(a)&&o.gt(ji.Zero));s++)r=Rs.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0])]),r),t=Rs.sha256hmac(t,r),t=Rs.sha256hmac(t,r),o=ji.fromBuffer(t);return this.k=o,this};zt.prototype.toPublicKey=function(){var e=this.sig.i;A4.checkArgument(e===0||e===1||e===2||e===3,new Error("i must be equal to 0, 1, 2, or 3"));var t=ji.fromBuffer(this.hashbuf),r=this.sig.r,i=this.sig.s,n=e&1,o=e>>1,a=Do.getN(),s=Do.getG(),u=o?r.add(a):r,c=Do.fromX(n,u),l=c.mul(a);if(!l.isInfinity())throw new Error("nR is not a valid curve point");var m=t.neg().umod(a),w=r.invm(a),E=c.mul(i).add(s.mul(m)).mul(w),P=vre.fromPoint(E,this.sig.compressed);return P};zt.prototype.sigError=function(){if(!h.Buffer.isBuffer(this.hashbuf)||this.hashbuf.length!==32)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s,r=Do.getN();try{if(e.lte(ji.Zero)||t.lte(ji.Zero)||e.gte(r)||t.gte(r))return"r and s not in range";var i=ji.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),n=t.invm(r),o=n.mul(i).umod(r),a=n.mul(e).umod(r),s=Do.getG().mulAdd(o,this.pubkey.point,a);return s.isInfinity()?"p is infinity":s.getX().umod(r).cmp(e)!==0?"Invalid signature":!1}catch(u){return"Signature security validation failed: "+u.message}};zt.toLowS=function(e){return e.gt(ji.fromBuffer(h.Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=Do.getN().sub(e)),e};zt.prototype._findSignature=function(e,t){var r=Do.getN(),i=Do.getG(),n=0,o,a,s,u;do(!this.k||!this._kFresh||n>0)&&this.deterministicK(n),n++,o=this.k,a=i.mul(o),s=a.x.umod(r),u=o.invm(r).mul(t.add(e.mul(s))).umod(r);while(s.cmp(ji.Zero)<=0||u.cmp(ji.Zero)<=0);return this._kFresh=!1,u=zt.toLowS(u),{s:u,r:s}};zt.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;A4.checkState(e&&t&&r,new Error("invalid parameters")),A4.checkState(h.Buffer.isBuffer(e)&&e.length===32,new Error("hashbuf must be a 32 byte buffer"));var i=ji.fromBuffer(e,this.endian?{endian:this.endian}:void 0),n=this._findSignature(r,i);return n.compressed=this.pubkey.compressed,this.sig=new gre(n),this};zt.prototype.signRandomK=function(){return this.randomK(),this.sign()};zt.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)};zt.prototype.verify=function(){return this.verified=!this.sigError(),this.verified};zt.prototype.verifyBool=function(){return this.verify()===!0};zt.sign=function(e,t,r){return zt().set({hashbuf:e,endian:r,privkey:t}).sign().sig};zt.signWithCalcI=function(e,t,r){return zt().set({hashbuf:e,endian:r,privkey:t}).sign().calci().sig};zt.signRandomK=function(e,t,r){return zt().set({hashbuf:e,endian:r,privkey:t}).signRandomK().sig};zt.verify=function(e,t,r,i){return zt().set({hashbuf:e,endian:i,sig:t,pubkey:r}).verify()};WR.exports=zt});var $R=k((P4,YR)=>{v();(function(e,t){"use strict";typeof define=="function"&&define.amd?define([],function(){return e.secrets=t()}):typeof P4=="object"?YR.exports=t(_r()):e.secrets=t(e.crypto)})(P4,function(e){"use strict";var t,r,i,n,o;function a(){t={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},r={},i=new Array(1024).join("0"),n=!0,o=["nodeCryptoRandomBytes","browserCryptoGetRandomValues","testRandom"]}function s(){return!!(r&&r.rng&&typeof r.rng=="function")}function u(N,C){var F;if(C===0||C===1)return N;if(C&&C>1024)throw new Error("Padding must be multiples of no larger than 1024 bits.");return C=C||r.bits,N&&(F=N.length%C),F?(i+N).slice(-(C-F+N.length)):N}function c(N){var C="",F,H;for(H=N.length-1;H>=0;H--){if(F=parseInt(N[H],16),isNaN(F))throw new Error("Invalid hex character.");C=u(F.toString(2),4)+C}return C}function l(N){var C="",F,H;for(N=u(N,4),H=N.length;H>=4;H-=4){if(F=parseInt(N.slice(H-4,H),2),isNaN(F))throw new Error("Invalid binary character.");C=F.toString(16)+C}return C}function m(){return!!(e&&typeof e=="object"&&(typeof e.getRandomValues=="function"||typeof e.getRandomValues=="object")&&(typeof Uint32Array=="function"||typeof Uint32Array=="object"))}function w(){return typeof e=="object"&&typeof e.randomBytes=="function"}function E(N){function C(G,B,g,O){var y=0,f,d="",_;for(B&&(f=B.length-1);y<f||d.length<G;)_=Math.abs(parseInt(B[y],g)),d=d+u(_.toString(2),O),y++;return d=d.substr(-G),(d.match(/0/g)||[]).length===d.length?null:d}function F(G){var B,g,O,y,f=null;for(O=16,y=4,g=Math.ceil(G/8);f===null;)B=e.randomBytes(g),f=C(G,B.toString("hex"),O,y);return f}function H(G){var B,g,O,y=null;for(g=10,O=32,B=Math.ceil(G/32);y===null;)y=C(G,e.getRandomValues(new Uint32Array(B)),g,O);return y}function z(G){var B,g,O,y,f,d=null;y=10,f=32,g=Math.ceil(G/32),O=123456789,B=new Uint32Array(g);for(var _=0;_<B.length;_++)B[_]=O;for(;d===null;)d=C(G,B,y,f);return d}if(N&&N==="testRandom")return r.typeCSPRNG=N,z;if(N&&N==="nodeCryptoRandomBytes")return r.typeCSPRNG=N,F;if(N&&N==="browserCryptoGetRandomValues")return r.typeCSPRNG=N,H;if(w())return r.typeCSPRNG="nodeCryptoRandomBytes",F;if(m())return r.typeCSPRNG="browserCryptoGetRandomValues",H}function P(N,C){var F=[],H;for(C&&(N=u(N,C)),H=N.length;H>r.bits;H-=r.bits)F.push(parseInt(N.slice(H-r.bits,H),2));return F.push(parseInt(N.slice(0,H),2)),F}function M(N,C){var F=r.logs[N],H=0,z;for(z=C.length-1;z>=0;z--)H!==0?H=r.exps[(F+r.logs[H])%r.maxShares]^C[z]:H=C[z];return H}function D(N,C,F){var H=0,z,G,B,g;for(B=0,z=C.length;B<z;B++)if(F[B]){for(G=r.logs[F[B]],g=0;g<z;g++)if(B!==g){if(N===C[g]){G=-1;break}G=(G+r.logs[N^C[g]]-r.logs[C[B]^C[g]]+r.maxShares)%r.maxShares}H=G===-1?H:H^r.exps[G]}return H}function L(N,C,F){var H=[],z=[N],G,B;for(G=1;G<F;G++)z[G]=parseInt(r.rng(r.bits),2);for(G=1,B=C+1;G<B;G++)H[G-1]={x:G,y:M(G,z)};return H}function U(N,C,F){var H,z,G,B,g;if(C=parseInt(C,r.radix),N=parseInt(N,10)||r.bits,H=N.toString(36).toUpperCase(),G=Math.pow(2,N)-1,B=G.toString(r.radix).length,z=u(C.toString(r.radix),B),typeof C!="number"||C%1!==0||C<1||C>G)throw new Error("Share id must be an integer between 1 and "+G+", inclusive.");return g=H+z+F,g}var K={init:function(N,C){var F=[],H=[],z=1,G,B;if(a(),N&&(typeof N!="number"||N%1!==0||N<t.minBits||N>t.maxBits))throw new Error("Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(C&&o.indexOf(C)===-1)throw new Error("Invalid RNG type argument : '"+C+"'");for(r.radix=t.radix,r.bits=N||t.bits,r.size=Math.pow(2,r.bits),r.maxShares=r.size-1,G=t.primitivePolynomials[r.bits],B=0;B<r.size;B++)H[B]=z,F[z]=B,z=z<<1,z>=r.size&&(z=z^G,z=z&r.maxShares);if(r.logs=F,r.exps=H,C&&this.setRNG(C),s()||this.setRNG(),!s()||!r.bits||!r.size||!r.maxShares||!r.logs||!r.exps||r.logs.length!==r.size||r.exps.length!==r.size)throw new Error("Initialization failed.")},combine:function(N,C){var F,H,z,G,B="",g,O,y,f=[],d=[];for(C=C||0,F=0,z=N.length;F<z;F++){if(O=this.extractShareComponents(N[F]),g===void 0)g=O.bits;else if(O.bits!==g)throw new Error("Mismatched shares: Different bit settings.");if(r.bits!==g&&this.init(g),f.indexOf(O.id)===-1)for(f.push(O.id),y=P(c(O.data)),H=0,G=y.length;H<G;H++)d[H]=d[H]||[],d[H][f.length-1]=y[H]}for(F=0,z=d.length;F<z;F++)B=u(D(C,f,d[F]).toString(2))+B;return l(C>=1?B:B.slice(B.indexOf("1")+1))},getConfig:function(){var N={};return N.radix=r.radix,N.bits=r.bits,N.maxShares=r.maxShares,N.hasCSPRNG=s(),N.typeCSPRNG=r.typeCSPRNG,N},extractShareComponents:function(N){var C,F,H,z,G={},B,g;if(C=parseInt(N.substr(0,1),36),C&&(typeof C!="number"||C%1!==0||C<t.minBits||C>t.maxBits))throw new Error("Invalid share : Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(z=Math.pow(2,C)-1,H=(Math.pow(2,C)-1).toString(r.radix).length,B="^([a-kA-K3-9]{1})([a-fA-F0-9]{"+H+"})([a-fA-F0-9]+)$",g=new RegExp(B).exec(N),g&&(F=parseInt(g[2],r.radix)),typeof F!="number"||F%1!==0||F<1||F>z)throw new Error("Invalid share : Share id must be an integer between 1 and "+r.maxShares+", inclusive.");if(g&&g[3])return G.bits=C,G.id=F,G.data=g[3],G;throw new Error("The share data provided is invalid : "+N)},setRNG:function(N){var C="Random number generator is invalid ",F=" Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.";if(N&&typeof N=="string"&&o.indexOf(N)===-1)throw new Error("Invalid RNG type argument : '"+N+"'");if(N||(N=E()),N&&typeof N=="string"&&(N=E(N)),n){if(N&&typeof N!="function")throw new Error(C+"(Not a function)."+F);if(N&&typeof N(r.bits)!="string")throw new Error(C+"(Output is not a string)."+F);if(N&&!parseInt(N(r.bits),2))throw new Error(C+"(Binary string output not parseable to an Integer)."+F);if(N&&N(r.bits).length>r.bits)throw new Error(C+"(Output length is greater than config.bits)."+F);if(N&&N(r.bits).length<r.bits)throw new Error(C+"(Output length is less than config.bits)."+F)}return r.rng=N,!0},str2hex:function(N,C){var F,H,z="",G,B,g,O;if(typeof N!="string")throw new Error("Input must be a character string.");if(C||(C=t.bytesPerChar),typeof C!="number"||C<1||C>t.maxBytesPerChar||C%1!==0)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,H=Math.pow(16,F)-1,g=0,O=N.length;g<O;g++){if(B=N[g].charCodeAt(),isNaN(B))throw new Error("Invalid character: "+N[g]);if(B>H)throw G=Math.ceil(Math.log(B+1)/Math.log(256)),new Error("Invalid character code ("+B+"). Maximum allowable is 256^bytes-1 ("+H+"). To convert this character, use at least "+G+" bytes.");z=u(B.toString(16),F)+z}return z},hex2str:function(N,C){var F,H="",z,G;if(typeof N!="string")throw new Error("Input must be a hexadecimal string.");if(C=C||t.bytesPerChar,typeof C!="number"||C%1!==0||C<1||C>t.maxBytesPerChar)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,N=u(N,F),z=0,G=N.length;z<G;z+=F)H=String.fromCharCode(parseInt(N.slice(z,z+F),16))+H;return H},random:function(N){if(typeof N!="number"||N%1!==0||N<2||N>65536)throw new Error("Number of bits must be an Integer between 1 and 65536.");return l(r.rng(N))},share:function(N,C,F,H){var z,G,B=new Array(C),g=new Array(C),O,y,f;if(H=H||128,typeof N!="string")throw new Error("Secret must be a string.");if(typeof C!="number"||C%1!==0||C<2)throw new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(C>r.maxShares)throw z=Math.ceil(Math.log(C+1)/Math.LN2),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To create "+C+" shares, use at least "+z+" bits.");if(typeof F!="number"||F%1!==0||F<2)throw new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(F>r.maxShares)throw z=Math.ceil(Math.log(F+1)/Math.LN2),new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To use a threshold of "+F+", use at least "+z+" bits.");if(F>C)throw new Error("Threshold number of shares was "+F+" but must be less than or equal to the "+C+" shares specified as the total to generate.");if(typeof H!="number"||H%1!==0||H<0||H>1024)throw new Error("Zero-pad length must be an integer between 0 and 1024 inclusive.");for(N="1"+c(N),N=P(N,H),O=0,f=N.length;O<f;O++)for(G=L(N[O],C,F),y=0;y<C;y++)B[y]=B[y]||G[y].x.toString(r.radix),g[y]=u(G[y].y.toString(2))+(g[y]||"");for(O=0;O<C;O++)B[O]=U(r.bits,B[O],l(g[O]));return B},newShare:function(N,C){var F,H;if(N&&typeof N=="string"&&(N=parseInt(N,r.radix)),H=N.toString(r.radix),N&&H&&C&&C[0])return F=this.extractShareComponents(C[0]),U(F.bits,H,this.combine(C,N));throw new Error("Invalid 'id' or 'shares' Array argument to newShare().")},_reset:a,_padLeft:u,_hex2bin:c,_bin2hex:l,_hasCryptoGetRandomValues:m,_hasCryptoRandomBytes:w,_getRNG:E,_isSetRNG:s,_splitNumStringToIntArray:P,_horner:M,_lagrange:D,_getShares:L,_constructPublicShareString:U};return K.init(),K})});var k4=k((V6e,eB)=>{"use strict";v();var gi=fr(),XR=ds(),JR=cr(),h6=null;function T4(){if(h6)return h6;var e=$R();return e.setRNG(function(t){for(var r=64,i=0;i<r;i++){for(var n=XR.getRandomBuffer(Math.ceil(t/8)),o="",a=0;a<n.length;a++)o+=("00000000"+n[a].toString(2)).slice(-8);if(o=o.slice(0,t),/1/.test(o))return o}throw new Error("shamir: CSPRNG returned all-zero draws "+r+" times in a row \u2014 refusing to hang on a degenerate/stubbed random source")}),h6=e,h6}var d6="ff",QR=2;function Or(e){return this instanceof Or?(this.options=e||{},this):new Or(e)}Or.split=function(e,t,r,i){if(i=i||{},e==null)throw new Error("Secret is required");if(t<2)throw new Error("Threshold must be at least 2");if(r<t)throw new Error("Number of shares must be at least threshold");if(t>255||r>255)throw new Error("Threshold and shares must be <= 255");for(var n=h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8"),o=d6+n.toString("hex"),a=T4().share(o,r,t),s=XR.getRandomBuffer(8).toString("hex"),u=i.checksum===!0,c=u?JR.sha256(n).slice(0,4).toString("hex"):null,l=[],m=0;m<a.length;m++)l.push({v:QR,id:m+1,threshold:t,shares:r,length:n.length,splitId:s,share:a[m],checksum:c});return l};Or.combine=function(e){if(!e||e.length===0)throw new Error("Shares array is required");if(e[0]&&Array.isArray(e[0].bytes)&&e[0].share===void 0)return Or._combineLegacy(e);var t=e[0].threshold,r=e[0].splitId;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var i=[],n=0;n<e.length;n++){var o=e[n];if(!o||typeof o.share!="string")throw new Error("Invalid share at index "+n);if(r!==void 0&&o.splitId!==r)throw new Error("Shares are from different splits (splitId mismatch)");if(o.threshold!==t)throw new Error("Shares have inconsistent threshold");i.push(o.share)}var a=T4().combine(i);if(a.slice(0,d6.length)!==d6)throw new Error("Reconstruction failed: invalid or insufficient shares");var s=h.Buffer.from(a.slice(d6.length),"hex"),u=e[0].checksum;if(u){var c=JR.sha256(s).slice(0,4).toString("hex");if(c!==u)throw new Error("Integrity check failed: shares are inconsistent or tampered")}return s};Or.verifyShare=function(e){try{return!e||typeof e!="object"?!1:Array.isArray(e.bytes)&&e.share===void 0?Or._verifyLegacyShare(e):e.v!==QR||typeof e.share!="string"||!/^[0-9a-fA-F]+$/.test(e.share)||typeof e.threshold!="number"||typeof e.shares!="number"||e.threshold<2||e.shares<e.threshold||e.shares>255||e.id<1||e.id>e.shares||e.checksum!==null&&e.checksum!==void 0&&!/^[0-9a-fA-F]{8}$/.test(e.checksum)?!1:(T4().extractShareComponents(e.share),!0)}catch{return!1}};Or.generateTestVectors=function(){var e="Hello, Bitcoin SV!",t=3,r=5,i=Or.split(e,t,r),n=Or.combine(i.slice(0,t));return{secret:e,threshold:t,totalShares:r,shares:i,reconstructed:n.toString("utf8"),valid:n.toString("utf8")===e}};var Bs=new gi(2147483647);Or._combineLegacy=function(e){var t=e[0].threshold,r=e[0].shares,i=e[0].length;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var n=0;n<e.length;n++){if(e[n].threshold!==t||e[n].shares!==r)throw new Error("Shares have inconsistent parameters");if(e[n].length!==i)throw new Error("Shares have different secret lengths")}for(var o=[],a=0;a<i;a++){for(var s=[],u=0;u<Math.min(e.length,t);u++)s.push(e[u].bytes[a]);o.push(Or._combineByteLegacy(s))}return h.Buffer.from(o)};Or._combineByteLegacy=function(e){for(var t=new gi(0),r=0;r<e.length;r++){for(var i=new gi(e[r].x),n=new gi(e[r].y,16),o=new gi(1),a=new gi(1),s=0;s<e.length;s++)if(r!==s){var u=new gi(e[s].x),c=new gi(0).sub(u);c.lt(new gi(0))&&(c=c.add(Bs)),o=o.mul(c).mod(Bs);var l=i.sub(u);l.lt(new gi(0))&&(l=l.add(Bs)),a=a.mul(l).mod(Bs)}var m=Or._modInverseLegacy(a,Bs),w=o.mul(m).mod(Bs);t=t.add(n.mul(w)).mod(Bs)}return t.mod(Bs).mod(new gi(256)).toNumber()};Or._modInverseLegacy=function(e,t){e.lt(new gi(0))&&(e=e.mod(t).add(t));var r=Or._extendedGCDLegacy(e,t);if(!r.gcd.eq(new gi(1)))throw new Error("Modular inverse does not exist");return r.x.mod(t).add(t).mod(t)};Or._extendedGCDLegacy=function(e,t){if(e.eq(new gi(0)))return{gcd:t,x:new gi(0),y:new gi(1)};var r=Or._extendedGCDLegacy(t.mod(e),e);return{gcd:r.gcd,x:r.y.sub(t.div(e).mul(r.x)),y:r.x}};Or._verifyLegacyShare=function(e){if(!e.id||!e.threshold||!e.shares||!e.bytes||typeof e.length!="number"||e.threshold<2||e.shares<e.threshold||!Array.isArray(e.bytes)||e.bytes.length!==e.length)return!1;for(var t=0;t<e.bytes.length;t++){var r=e.bytes[t];if(!r||!r.x||!r.y||r.x<1||r.x>e.shares||!/^[0-9a-fA-F]+$/.test(r.y))return!1}return!0};eB.exports=Or});var g6=k((Z6e,tB)=>{"use strict";v();var Lo=fr(),bre=vn(),_re=a6(),Y0=bre.getN(),p6=Y0.shrn(1);function wre(e,t,r){if(!h.Buffer.isBuffer(e)||e.length!==32)throw new Error("Invalid message hash: must be 32-byte buffer");if(!t)return!1;let i=t;if(h.Buffer.isBuffer(t))try{i=Vr().fromDER(t)}catch{return!1}if(!i||!i.r||!i.s)return!1;let n=Lo.isBN(i.r)?i.r:new Lo(i.r),o=Lo.isBN(i.s)?i.s:new Lo(i.s);if(n.isZero()||o.isZero()||n.gte(Y0)||o.gte(Y0)||o.gt(p6))return!1;let a=Vr(),s=new a({r:n,s:o});return _re.verify(e,s,r)}function Sre(e){if(!e)return!1;let t=e;if(h.Buffer.isBuffer(e))try{t=Vr().fromDER(e)}catch{return!1}return!t||!t.s?!1:(Lo.isBN(t.s)?t.s:new Lo(t.s)).lte(p6)}function xre(e){if(!e||!e.r||!e.s)throw new Error("Invalid signature object");let t=Lo.isBN(e.r)?e.r:new Lo(e.r),r=Lo.isBN(e.s)?e.s:new Lo(e.s),i=r;return r.gt(p6)&&(i=Y0.sub(r)),{r:t,s:i}}tB.exports={smartVerify:wre,isCanonical:Sre,canonicalize:xre,constants:{n:Y0,nh:p6}}});var v6=k((Y6e,nB)=>{"use strict";v();var Ere=fr(),{secp256k1:dl}=(g0(),lo(p0)),rB=dl.Point,Ore=rB.Fn.ORDER;function R4(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new Ere(t,16)}function B4(e){return h.Buffer.isBuffer(e)?Uint8Array.from(e):e instanceof Uint8Array?e:Uint8Array.from(h.Buffer.from(e,"hex"))}function M4(e){this._p=e}M4.prototype.eq=function(e){var t=e&&e._p?e._p:e;return this._p.equals(t)};var iB={curve:{n:R4(Ore)},keyFromPrivate:function(e,t){var r;h.Buffer.isBuffer(e)?r=e:e instanceof Uint8Array?r=h.Buffer.from(e):r=h.Buffer.from(e,t||"hex");var i=Uint8Array.from(r);return{_priv:i,getPublic:function(){return new M4(rB.fromBytes(dl.getPublicKey(i,!0)))}}},sign:function(e,t){var r=dl.sign(B4(e),t._priv,{lowS:!0,prehash:!1,format:"recovered"}),i=r[0],n=R4(BigInt("0x"+h.Buffer.from(r.subarray(1,33)).toString("hex"))),o=R4(BigInt("0x"+h.Buffer.from(r.subarray(33,65)).toString("hex")));return{r:n,s:o,recoveryParam:i}},verify:function(e,t,r){try{if(!t||typeof t!="object")return!1;var i=t.r,n=t.s;if(!i||!n||typeof i.cmp!="function"||typeof n.cmp!="function"||i.isZero()||n.isZero())return!1;var o=iB.curve.n;if(i.cmp(o)>=0||n.cmp(o)>=0)return!1;var a=h.Buffer.concat([i.toBuffer({size:32}),n.toBuffer({size:32})]),s=r._priv?dl.getPublicKey(r._priv,!0):r._p?r._p.toBytes(!0):r;return dl.verify(Uint8Array.from(a),B4(e),Uint8Array.from(s),{lowS:!1,prehash:!1})}catch{return!1}},recoverPubKey:function(e,t,r){var i=h.Buffer.concat([t.r.toBuffer({size:32}),t.s.toBuffer({size:32})]),n=dl.Signature.fromBytes(Uint8Array.from(i),"compact").addRecoveryBit(r);return new M4(n.recoverPublicKey(B4(e)))}};nB.exports=iB});var X0=k((X6e,sB)=>{"use strict";v();var m6=xt(),$0=fr(),y6=Da(),Ire=Wn(),Are=cr(),oB=Bt(),Pre=486604799,gt=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&oB.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};gt._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=gt._fromBufferReader(y6(t));else if(m6.isObject(t))r=gt._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};gt._fromObject=function(t){oB.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;m6.isString(t.prevHash)&&(r=h.Buffer.from(t.prevHash,"hex").reverse()),m6.isString(t.merkleRoot)&&(i=h.Buffer.from(t.merkleRoot,"hex").reverse());var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};gt.fromObject=function(t){var r=gt._fromObject(t);return new gt(r)};gt.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=y6(t);r.pos=gt.Constants.START_OF_HEADER;var i=gt._fromBufferReader(r);return new gt(i)};gt.fromBuffer=function(t){var r=gt._fromBufferReader(y6(t));return new gt(r)};gt.fromString=function(t){var r=h.Buffer.from(t,"hex");return gt.fromBuffer(r)};gt._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};gt.fromBufferReader=function(t){var r=gt._fromBufferReader(t);return new gt(r)};gt.prototype.toObject=gt.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:h.Buffer.from(this.prevHash).reverse().toString("hex"),merkleRoot:h.Buffer.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};gt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};gt.prototype.toString=function(){return this.toBuffer().toString("hex")};gt.prototype.toBufferWriter=function(t){return t||(t=new Ire),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};gt.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new $0(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new $0(2));return r};gt.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(Pre).mul(new $0(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};gt.prototype._getHash=function(){var t=this.toBuffer();return Are.sha256sha256(t)};var aB={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=y6(this._getHash()).readReverse().toString("hex")),this._id},set:m6.noop};Object.defineProperty(gt.prototype,"id",aB);Object.defineProperty(gt.prototype,"hash",aB);gt.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+gt.Constants.MAX_TIME_OFFSET)};gt.prototype.validProofOfWork=function(){var t=new $0(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};gt.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};gt.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new $0("10000000000000000000000000000000000000000000000000000000000000000","hex")};sB.exports=gt});var dB=k((Q6e,hB)=>{"use strict";v();var C4=xt(),fB=X0(),uB=fr(),D4=Da(),Tre=Wn(),kre=cr(),N4=ks(),cB=Bt();function at(e){return this instanceof at?(C4.extend(this,at._from(e)),this):new at(e)}at.MAX_BLOCK_SIZE=128e6;at._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=at._fromBufferReader(D4(t));else if(C4.isObject(t))r=at._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};at._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof N4?r.push(n):r.push(N4().fromObject(n))});var i={header:fB.fromObject(t.header),transactions:r};return i};at.fromObject=function(t){var r=at._fromObject(t);return new at(r)};at._fromBufferReader=function(t){var r={};cB.checkState(!t.finished(),"No block data received"),r.header=fB.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(N4().fromBufferReader(t));return r};at.fromBufferReader=function(t){cB.checkArgument(t,"br is required");var r=at._fromBufferReader(t);return new at(r)};at.fromBuffer=function(t){return at.fromBufferReader(new D4(t))};at.fromString=function(t){var r=h.Buffer.from(t,"hex");return at.fromBuffer(r)};at.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=D4(t);r.pos=at.Values.START_OF_BLOCK;var i=at._fromBufferReader(r);return new at(i)};at.prototype.toObject=at.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};at.prototype.toBuffer=function(){return this.toBufferWriter().concat()};at.prototype.toString=function(){return this.toBuffer().toString("hex")};at.prototype.toBufferWriter=function(t){t||(t=new Tre),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};at.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[at.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};at.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),a=h.Buffer.concat([t[r+n],t[r+o]]);t.push(kre.sha256sha256(a))}r+=i}return t};at.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};at.prototype.validMerkleRoot=function(){var t=new uB(this.header.merkleRoot.toString("hex"),"hex"),r=new uB(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};at.prototype._getHash=function(){return this.header._getHash()};var lB={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:C4.noop};Object.defineProperty(at.prototype,"id",lB);Object.defineProperty(at.prototype,"hash",lB);at.prototype.inspect=function(){return"<Block "+this.id+">"};at.Values={START_OF_BLOCK:8,NULL_HASH:h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};hB.exports=at});var U4=k((t5e,vB)=>{"use strict";v();var mf=xt(),q4=X0(),gB=Da(),Rre=Wn(),Bre=cr(),pB=ks(),L4=hn(),yf=Bt();function nr(e){if(!(this instanceof nr))return new nr(e);var t={};if(h.Buffer.isBuffer(e))t=nr._fromBufferReader(gB(e));else if(mf.isObject(e)){var r;e.header instanceof q4?r=e.header:r=q4.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return mf.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}nr.fromBuffer=function(t){return nr.fromBufferReader(gB(t))};nr.fromBufferReader=function(t){return new nr(nr._fromBufferReader(t))};nr.prototype.toBuffer=function(){return this.toBufferWriter().concat()};nr.prototype.toBufferWriter=function(t){t||(t=new Rre),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(h.Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};nr.prototype.toObject=nr.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};nr.prototype.validMerkleTree=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:i.equals(this.header.merkleRoot)};nr.prototype.filterdTxsHash=function(){throw new Error("filterdTxsHash has been deprecated. use filteredTxsHash.")};nr.prototype.filteredTxsHash=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new L4.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new L4.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new L4.MerkleBlock.InvalidMerkleTree;return i};nr.prototype._traverseMerkleTree=function(t,r,i,n){if(i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0,n=n||!1,i.flagBitsUsed>this.flags.length*8)return null;var o=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!o){if(i.hashesUsed>=this.hashes.length)return null;var a=this.hashes[i.hashesUsed++];return t===0&&o&&i.txs.push(a),h.Buffer.from(a,"hex")}else{var s=this._traverseMerkleTree(t-1,r*2,i),u=s;return r*2+1<this._calcTreeWidth(t-1)&&(u=this._traverseMerkleTree(t-1,r*2+1,i)),n?i.txs:Bre.sha256sha256(h.Buffer.concat([s,u]))}};nr.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};nr.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};nr.prototype.hasTransaction=function(t){yf.checkArgument(!mf.isUndefined(t),"tx cannot be undefined"),yf.checkArgument(t instanceof pB||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof pB&&(r=h.Buffer.from(t.id,"hex").reverse().toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};nr._fromBufferReader=function(t){yf.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=q4.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};nr.fromObject=function(t){return new nr(t)};vB.exports=nr});var mB=k((i5e,b6)=>{v();b6.exports=dB();b6.exports.BlockHeader=X0();b6.exports.MerkleBlock=U4()});var OB=k((o5e,EB)=>{"use strict";v();var wB=Te(),yB=wB.crypto.Hash,bB=/^[0-9a-fA-F]{64}$/;function SB(e){return h.Buffer.from(e).reverse()}function _B(e){return SB(h.Buffer.from(e,"hex"))}function xB(e){return SB(e).toString("hex")}function F4(e,t,r){if(!bB.test(String(e)))throw new Error("txid must be 32-byte hex");if(!Number.isInteger(t)||t<0)throw new Error("index must be a non-negative integer");r=r||[];for(var i=_B(e),n=t,o=0;o<r.length;o++){var a=r[o],s;if(a==="*"||a===""||a==null)s=i;else{if(!bB.test(String(a)))throw new Error("proof node "+o+' must be 32-byte hex or "*"');s=_B(a)}i=n&1?yB.sha256sha256(h.Buffer.concat([s,i])):yB.sha256sha256(h.Buffer.concat([i,s])),n=Math.floor(n/2)}return xB(i)}function Mre(e){if(!e||!e.merkleRoot)throw new Error("proof.merkleRoot is required");var t=F4(e.txid,e.index,e.nodes);return t.toLowerCase()===String(e.merkleRoot).toLowerCase()}function Nre(e){var t=e.header;if((h.Buffer.isBuffer(t)||typeof t=="string")&&(t=wB.BlockHeader.fromBuffer(h.Buffer.isBuffer(t)?t:h.Buffer.from(t,"hex"))),!t||!t.merkleRoot)throw new Error("a valid block header is required");var r=xB(t.merkleRoot),i=F4(e.txid,e.index,e.nodes),n=i.toLowerCase()===r.toLowerCase(),o=e.requirePow!==!1,a=t.validProofOfWork();return{valid:n&&(!o||a),rootMatches:n,powValid:a,merkleRoot:i,blockHash:t.id}}EB.exports={merkleRootFromBranch:F4,verifyMerkleProof:Mre,verifyTxInclusion:Nre}});var PB=k((s5e,AB)=>{"use strict";v();var IB=Te();function Cre(e){return h.Buffer.from(e).reverse()}function Dre(e){if(e&&typeof e.validProofOfWork=="function")return e;if(h.Buffer.isBuffer(e))return IB.BlockHeader.fromBuffer(e);if(typeof e=="string")return IB.BlockHeader.fromBuffer(h.Buffer.from(e,"hex"));throw new Error("each header must be a BlockHeader, an 80-byte Buffer, or hex")}function Lre(e,t){if(t=t||{},!Array.isArray(e)||e.length===0)throw new Error("headers must be a non-empty array");for(var r=e.map(Dre),i=t.requirePow!==!1,n=0,o=0;o<r.length;o++){if(i&&!r[o].validProofOfWork())return{valid:!1,reason:"invalid proof-of-work at index "+o,count:r.length};if(n+=r[o].getDifficulty(),o>0){var a=Cre(r[o].prevHash).toString("hex").toLowerCase()===r[o-1].id.toLowerCase();if(!a)return{valid:!1,reason:"broken link at index "+o,count:r.length}}}var s=r[0].id,u=r[r.length-1].id;if(t.trustedHash){var c=String(t.trustedHash).toLowerCase();if(c!==u.toLowerCase()&&c!==s.toLowerCase())return{valid:!1,reason:"chain is not anchored at the trusted hash",count:r.length,anchorHash:s,tipHash:u}}return{valid:!0,count:r.length,anchorHash:s,tipHash:u,work:n}}AB.exports={verifyHeaderChain:Lre}});var kB=k((f5e,TB)=>{"use strict";v();var H4=OB(),qre=PB();TB.exports={merkleRootFromBranch:H4.merkleRootFromBranch,verifyMerkleProof:H4.verifyMerkleProof,verifyTxInclusion:H4.verifyTxInclusion,verifyHeaderChain:qre.verifyHeaderChain}});var z4=k((l5e,DB)=>{"use strict";v();var Ir=xt(),RB=Bt(),BB=fr(),Ure=E0(),_6=tl(),MB=cr(),w6=K4(),bf=Ss(),j4=vn(),NB=$n(),CB=hn(),J0=CB,ro=CB.HDPublicKey,S6=Es(),Ms=pi();function ne(e){if(e instanceof ne)return e;if(!(this instanceof ne))return new ne(e);if(e)if(Ir.isString(e)||h.Buffer.isBuffer(e)){var t=ne.getSerializedError(e);if(t){if(h.Buffer.isBuffer(e)&&!ne.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof ro.ArgumentIsPrivateExtended)return new w6(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(Ir.isObject(e))return e instanceof w6?this._buildFromPrivate(e):this._buildFromObject(e);throw new ro.UnrecognizedArgument(e)}else throw new ro.MustSupplyArgument}ne.fromHDPrivateKey=function(e){return new ne(e)};ne.isValidPath=function(e){if(Ir.isString(e)){var t=w6._getDerivationIndexes(e);return t!==null&&Ir.every(t,ne.isValidPath)}return Ir.isNumber(e)?e>=0&&e<ne.Hardened:!1};ne.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};ne.prototype.deriveChild=function(e,t){if(Ir.isNumber(e))return this._deriveWithNumber(e,t);if(Ir.isString(e))return this._deriveFromString(e);throw new ro.InvalidDerivationArgument(e)};ne.prototype._deriveWithNumber=function(e,t){if(e>=ne.Hardened||t)throw new ro.InvalidIndexCantDeriveHardened;if(e<0)throw new ro.InvalidPath(e);var r=Ms.integerAsBuffer(e),i=h.Buffer.concat([this.publicKey.toBuffer(),r]),n=MB.sha512hmac(i,this._buffers.chainCode),o=BB.fromBuffer(n.slice(0,32),{size:32}),a=n.slice(32,64),s;try{s=NB.fromPoint(j4.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var u=new ne({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:a,publicKey:s});return u};ne.prototype._deriveFromString=function(e){if(Ir.includes(e,"'"))throw new ro.InvalidIndexCantDeriveHardened;if(!ne.isValidPath(e))throw new ro.InvalidPath(e);var t=w6._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};ne.isValidSerialized=function(e,t){return Ir.isNull(ne.getSerializedError(e,t))};ne.getSerializedError=function(e,t){if(!(Ir.isString(e)||h.Buffer.isBuffer(e)))return new ro.UnrecognizedArgument("expected buffer or string");if(!Ure.validCharacters(e))return new J0.InvalidB58Char("(unknown)",e);try{e=_6.decode(e)}catch{return new J0.InvalidB58Checksum(e)}if(e.length!==ne.DataSize)return new ro.InvalidLength(e);if(!Ir.isUndefined(t)){var r=ne._validateNetwork(e,t);if(r)return r}var i=e.readUInt32BE(0);return i===bf.livenet.xprivkey||i===bf.testnet.xprivkey?new ro.ArgumentIsPrivateExtended:null};ne._validateNetwork=function(e,t){var r=bf.get(t);if(!r)return new J0.InvalidNetworkArgument(t);var i=e.slice(ne.VersionStart,ne.VersionEnd);return i.readUInt32BE(0)!==r.xpubkey?new J0.InvalidNetwork(i):null};ne.prototype._buildFromPrivate=function(e){var t=Ir.clone(e._buffers),r=j4.getG().mul(BB.fromBuffer(t.privateKey));return t.publicKey=j4.pointToCompressed(r),t.version=Ms.integerAsBuffer(bf.get(t.version.readUInt32BE(0)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};ne.prototype._buildFromObject=function(e){var t={version:e.network?Ms.integerAsBuffer(bf.get(e.network).xpubkey):e.version,depth:Ir.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:Ir.isNumber(e.parentFingerPrint)?Ms.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Ir.isNumber(e.childIndex)?Ms.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Ir.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:Ir.isString(e.publicKey)?h.Buffer.from(e.publicKey,"hex"):h.Buffer.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:Ir.isNumber(e.checksum)?Ms.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};ne.prototype._buildFromSerialized=function(e){var t=_6.decode(e),r={version:t.slice(ne.VersionStart,ne.VersionEnd),depth:t.slice(ne.DepthStart,ne.DepthEnd),parentFingerPrint:t.slice(ne.ParentFingerPrintStart,ne.ParentFingerPrintEnd),childIndex:t.slice(ne.ChildIndexStart,ne.ChildIndexEnd),chainCode:t.slice(ne.ChainCodeStart,ne.ChainCodeEnd),publicKey:t.slice(ne.PublicKeyStart,ne.PublicKeyEnd),checksum:t.slice(ne.ChecksumStart,ne.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};ne.prototype._buildFromBuffers=function(e){ne._validateBufferArguments(e),Ms.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=h.Buffer.concat(t),i=_6.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new J0.InvalidB58Checksum(r,i);var n=bf.get(e.version.readUInt32BE(0)),o;o=_6.encode(h.Buffer.concat(t)),e.xpubkey=h.Buffer.from(o);var a=new NB(e.publicKey,{network:n}),s=ne.ParentFingerPrintSize,u=MB.sha256ripemd160(a.toBuffer()).slice(0,s);return Ms.defineImmutable(this,{xpubkey:o,network:n,depth:e.depth[0],publicKey:a,fingerPrint:u}),this};ne._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];S6(h.Buffer.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),S6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",ne.VersionSize),t("depth",ne.DepthSize),t("parentFingerPrint",ne.ParentFingerPrintSize),t("childIndex",ne.ChildIndexSize),t("chainCode",ne.ChainCodeSize),t("publicKey",ne.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",ne.CheckSumSize)};ne.fromString=function(e){return RB.checkArgument(Ir.isString(e),"No valid string was provided"),new ne(e)};ne.fromObject=function(e){return RB.checkArgument(Ir.isObject(e),"No valid argument was provided"),new ne(e)};ne.prototype.toString=function(){return this.xpubkey};ne.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};ne.prototype.toObject=ne.prototype.toJSON=function(){return{network:bf.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}};ne.fromBuffer=function(e){return new ne(e)};ne.fromHex=function(e){return ne.fromBuffer(h.Buffer.from(e,"hex"))};ne.prototype.toBuffer=function(){return h.Buffer.from(this._buffers.xpubkey)};ne.prototype.toHex=function(){return this.toBuffer().toString("hex")};ne.Hardened=2147483648;ne.RootElementAlias=["m","M"];ne.VersionSize=4;ne.DepthSize=1;ne.ParentFingerPrintSize=4;ne.ChildIndexSize=4;ne.ChainCodeSize=32;ne.PublicKeySize=33;ne.CheckSumSize=4;ne.DataSize=78;ne.SerializedByteSize=82;ne.VersionStart=0;ne.VersionEnd=ne.VersionStart+ne.VersionSize;ne.DepthStart=ne.VersionEnd;ne.DepthEnd=ne.DepthStart+ne.DepthSize;ne.ParentFingerPrintStart=ne.DepthEnd;ne.ParentFingerPrintEnd=ne.ParentFingerPrintStart+ne.ParentFingerPrintSize;ne.ChildIndexStart=ne.ParentFingerPrintEnd;ne.ChildIndexEnd=ne.ChildIndexStart+ne.ChildIndexSize;ne.ChainCodeStart=ne.ChildIndexEnd;ne.ChainCodeEnd=ne.ChainCodeStart+ne.ChainCodeSize;ne.PublicKeyStart=ne.ChainCodeEnd;ne.PublicKeyEnd=ne.PublicKeyStart+ne.PublicKeySize;ne.ChecksumStart=ne.PublicKeyEnd;ne.ChecksumEnd=ne.ChecksumStart+ne.CheckSumSize;S6(ne.PublicKeyEnd===ne.DataSize);S6(ne.ChecksumEnd===ne.SerializedByteSize);DB.exports=ne});var K4=k((d5e,HB)=>{"use strict";v();var x6=Es(),e1=Kt(),mr=xt(),qB=Bt(),UB=fr(),Fre=E0(),Q0=tl(),V4=cr(),_f=Ss(),Hre=vn(),FB=V0(),jre=ds(),pl=hn(),Uo=pl.HDPrivateKey,qo=pi(),zre=128,LB=1/8,Kre=512;function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(!e)return this._generateRandomly();if(_f.get(e))return this._generateRandomly(e);if(mr.isString(e)||h.Buffer.isBuffer(e))if(J.isValidSerialized(e))this._buildFromSerialized(e);else if(qo.isValidJSON(e))this._buildFromJSON(e);else if(h.Buffer.isBuffer(e)&&J.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw J.getSerializedError(e);else if(mr.isObject(e))this._buildFromObject(e);else throw new Uo.UnrecognizedArgument(e)}J.fromRandom=function(e){return new J(e)};J.isValidPath=function(e,t){if(mr.isString(e)){var r=J._getDerivationIndexes(e);return r!==null&&mr.every(r,J.isValidPath)}return mr.isNumber(e)?(e<J.Hardened&&t===!0&&(e+=J.Hardened),e>=0&&e<J.MaxIndex):!1};J._getDerivationIndexes=function(e){var t=e.split("/");if(mr.includes(J.RootElementAlias,e))return[];if(!mr.includes(J.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=J.Hardened),o});return mr.some(r,isNaN)?null:r};J.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};J.prototype.deriveChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t);if(mr.isString(e))return this._deriveFromString(e);throw new Uo.InvalidDerivationArgument(e)};J.prototype.deriveNonCompliantChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t,!0);if(mr.isString(e))return this._deriveFromString(e,!0);throw new Uo.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t,r){if(!J.isValidPath(e,t))throw new Uo.InvalidPath(e);t=e>=J.Hardened?!0:t,e<J.Hardened&&t===!0&&(e+=J.Hardened);var i=qo.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=h.Buffer.concat([e1.Buffer.from([0]),o,i])}else if(t){var a=this.privateKey.bn.toBuffer({size:32});x6(a.length===32,"length of private key buffer is expected to be 32 bytes"),n=h.Buffer.concat([e1.Buffer.from([0]),a,i])}else n=h.Buffer.concat([this.publicKey.toBuffer(),i]);var s=V4.sha512hmac(n,this._buffers.chainCode),u=UB.fromBuffer(s.slice(0,32),{size:32}),c=s.slice(32,64),l=u.add(this.privateKey.toBigNumber()).umod(Hre.getN()).toBuffer({size:32});if(!FB.isValid(l))return this._deriveWithNumber(e+1,null,r);var m=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:c,privateKey:l});return m};J.prototype._deriveFromString=function(e,t){if(!J.isValidPath(e))throw new Uo.InvalidPath(e);var r=J._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};J.isValidSerialized=function(e,t){return!J.getSerializedError(e,t)};J.getSerializedError=function(e,t){if(!(mr.isString(e)||h.Buffer.isBuffer(e)))return new Uo.UnrecognizedArgument("Expected string or buffer");if(!Fre.validCharacters(e))return new pl.InvalidB58Char("(unknown)",e);try{e=Q0.decode(e)}catch{return new pl.InvalidB58Checksum(e)}if(e.length!==J.DataLength)return new Uo.InvalidLength(e);if(!mr.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}return null};J._validateNetwork=function(e,t){var r=_f.get(t);if(!r)return new pl.InvalidNetworkArgument(t);var i=e.slice(0,4);return i.readUInt32BE(0)!==r.xprivkey?new pl.InvalidNetwork(i):null};J.fromString=function(e){return qB.checkArgument(mr.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return qB.checkArgument(mr.isObject(e),"No valid argument was provided"),new J(e)};J.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};J.prototype._buildFromObject=function(e){var t={version:e.network?qo.integerAsBuffer(_f.get(e.network).xprivkey):e.version,depth:mr.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:mr.isNumber(e.parentFingerPrint)?qo.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:mr.isNumber(e.childIndex)?qo.integerAsBuffer(e.childIndex):e.childIndex,chainCode:mr.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:mr.isString(e.privateKey)&&qo.isHexa(e.privateKey)?h.Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:qo.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=Q0.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),privateKey:t.slice(J.PrivateKeyStart,J.PrivateKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};J.prototype._generateRandomly=function(e){return J.fromSeed(jre.getRandomBuffer(64),e)};J.fromSeed=function(e,t){if(qo.isHexaString(e)&&(e=h.Buffer.from(e,"hex")),!h.Buffer.isBuffer(e))throw new Uo.InvalidEntropyArgument(e);if(e.length<zre*LB)throw new Uo.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>Kre*LB)throw new Uo.InvalidEntropyArgument.TooMuchEntropy(e);var r=V4.sha512hmac(e,e1.Buffer.from("Bitcoin seed"));return new J({network:_f.get(t)||_f.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};J.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=z4();this._hdPublicKey=new e(this)}};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),qo.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,h.Buffer.alloc(1),e.privateKey],r=e1.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=Q0.checksum(r);else if(e.checksum.toString()!==Q0.checksum(r).toString())throw new pl.InvalidB58Checksum(r);var i=_f.get(e.version.readUInt32BE(0)),n;n=Q0.encode(e1.Buffer.concat(t)),e.xprivkey=h.Buffer.from(n);var o=new FB(UB.fromBuffer(e.privateKey),i),a=o.toPublicKey(),s=J.ParentFingerPrintSize,u=V4.sha256ripemd160(a.toBuffer()).slice(0,s);return qo.defineImmutable(this,{xprivkey:n,network:i,depth:e.depth[0],privateKey:o,publicKey:a,fingerPrint:u}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];x6(h.Buffer.isBuffer(n),r+" argument is not a buffer"),x6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("privateKey",J.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.prototype.toString=function(){return this.xprivkey};J.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:_f.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}};J.fromBuffer=function(e){return new J(e.toString())};J.fromHex=function(e){return J.fromBuffer(h.Buffer.from(e,"hex"))};J.prototype.toBuffer=function(){return h.Buffer.from(this.toString())};J.prototype.toHex=function(){return this.toBuffer().toString("hex")};J.DefaultDepth=0;J.DefaultFingerprint=0;J.DefaultChildIndex=0;J.Hardened=2147483648;J.MaxIndex=2*J.Hardened;J.RootElementAlias=["m","M","m'","M'"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PrivateKeySize=32;J.CheckSumSize=4;J.DataLength=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PrivateKeyStart=J.ChainCodeEnd+1;J.PrivateKeyEnd=J.PrivateKeyStart+J.PrivateKeySize;J.ChecksumStart=J.PrivateKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;x6(J.ChecksumEnd===J.SerializedByteSize);HB.exports=J});var GB=k((g5e,VB)=>{"use strict";v();var Fo=Te(),E6=Fo.deps._,Vre=Fo.PrivateKey,Gre=Fo.PublicKey,jB=Fo.Address,zB=Fo.encoding.BufferWriter,G4=Fo.crypto.ECDSA,KB=Fo.crypto.Signature,Zre=Fo.crypto.Hash.sha256sha256,Wre=Fo.util.js,gl=Fo.util.preconditions,or=function e(t){return this instanceof e?(gl.checkArgument(E6.isString(t)||h.Buffer.isBuffer(t),"First argument should be a string or Buffer"),E6.isString(t)&&(this.messageBuffer=h.Buffer.from(t)),h.Buffer.isBuffer(t)&&(this.messageBuffer=t),this):new e(t)};or.sign=function(e,t){return new or(e).sign(t)};or.verify=function(e,t,r){return new or(e).verify(t,r)};or.MAGIC_BYTES=h.Buffer.from(`Bitcoin Signed Message:
|
|
75
|
+
`));var s=new As({actual:e,expected:t,message:r,operator:n,stackStartFn:i});throw s.generatedMessage=a,s}}Gt.match=function e(t,r,i){xk(t,r,i,e,"match")};Gt.doesNotMatch=function e(t,r,i){xk(t,r,i,e,"doesNotMatch")};function Ek(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];vk.apply(void 0,[Ek,t.length].concat(t))}Gt.strict=Dee(Ek,Gt,{equal:Gt.strictEqual,deepEqual:Gt.deepStrictEqual,notEqual:Gt.notStrictEqual,notDeepEqual:Gt.notDeepStrictEqual});Gt.strict.strict=Gt.strict});var Wn=k((Kpe,Ak)=>{"use strict";v();var Ik=Es(),vr=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};vr.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};vr.prototype.toBuffer=function(){return this.concat()};vr.prototype.concat=function(){return h.Buffer.concat(this.bufs,this.bufLen)};vr.prototype.write=function(e){return Ik(h.Buffer.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};vr.prototype.writeReverse=function(e){return Ik(h.Buffer.isBuffer(e)),this.bufs.push(h.Buffer.from(e).reverse()),this.bufLen+=e.length,this};vr.prototype.writeUInt8=function(e){var t=h.Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};vr.prototype.writeUInt16BE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};vr.prototype.writeUInt16LE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};vr.prototype.writeUInt32BE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};vr.prototype.writeInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};vr.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};vr.prototype.writeVarintNum=function(e){var t=vr.varintBufNum(e);return this.write(t),this};vr.prototype.writeVarintBN=function(e){var t=vr.varintBufBN(e);return this.write(t),this};vr.varintBufNum=function(e){var t;return e<253?(t=h.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=h.Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};vr.varintBufBN=function(e){var t,r=e.toNumber();if(r<253)t=h.Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new vr;i.writeUInt8(255),i.writeUInt64LEBN(e),t=i.concat()}return t};Ak.exports=vr});var Yp=k((Gpe,Pk)=>{"use strict";v();var ol=xt(),U0=Bt(),qee=pi();function Et(e){if(!(this instanceof Et))return new Et(e);var t;if(ol.isNumber(e))t=e;else if(ol.isString(e))t=Et.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return qee.defineImmutable(this,{num:t}),this}Et.fromBuffer=function(e){return U0.checkArgument(h.Buffer.isBuffer(e)),new Et(+("0x"+e.toString("hex")))};Et.fromNumber=function(e){return U0.checkArgument(ol.isNumber(e)),new Et(e)};Et.fromString=function(e){U0.checkArgument(ol.isString(e));var t=Et.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new Et(t)};Et.prototype.toHex=function(){return this.num.toString(16)};Et.prototype.toBuffer=function(){return h.Buffer.from(this.toHex(),"hex")};Et.prototype.toNumber=function(){return this.num};Et.prototype.toString=function(){var e=Et.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};Et.smallInt=function(e){return U0.checkArgument(ol.isNumber(e),"Invalid Argument: n should be number"),U0.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?Et("OP_0"):new Et(Et.map.OP_1+e-1)};Et.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_SUBSTR:179,OP_LEFT:180,OP_RIGHT:181,OP_NOP4:182,OP_NOP5:183,OP_NOP6:184,OP_NOP7:185,OP_NOP8:186,OP_NOP9:187,OP_NOP10:188,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};Et.reverseMap=[];for(e4 in Et.map)Et.reverseMap[Et.map[e4]]=e4;var e4;ol.extend(Et,Et.map);Et.isSmallIntOp=function(e){return e instanceof Et&&(e=e.toNumber()),e===Et.map.OP_0||e>=Et.map.OP_1&&e<=Et.map.OP_16};Et.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};Pk.exports=Et});var i4=k((Wpe,Rk)=>{"use strict";v();var Yn=hf(),Uee=Da(),Fee=Wn(),t4=cr(),he=Yp(),lf=$n(),cf=Vr(),Tk=Ss(),er=Bt(),yt=xt(),r4=hn(),kk=Kt(),Hee=pi(),Q=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],h.Buffer.isBuffer(t))return e.fromBuffer(t);if(t instanceof Yn)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(yt.isString(t))return e.fromString(t);yt.isObject(t)&&yt.isArray(t.chunks)&&this.set(t)};Q.prototype.set=function(e){return er.checkArgument(yt.isObject(e)),er.checkArgument(yt.isArray(e.chunks)),this.chunks=e.chunks,this};Q.fromBuffer=function(e){var t=new Q;t.chunks=[];for(var r=new Uee(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<he.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===he.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(a){throw a instanceof RangeError?new r4.Script.InvalidBuffer(e.toString("hex")):a}return t};Q.prototype.toBuffer=function(){for(var e=new Fee,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<he.OP_PUSHDATA1?e.write(r.buf):i===he.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===he.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):i===he.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};Q.fromASM=function(e){var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(n==="0")a=0,t.chunks.push({opcodenum:a}),i=i+1;else if(n==="-1")a=he.OP_1NEGATE,t.chunks.push({opcodenum:a}),i=i+1;else if(yt.isUndefined(a)){var s=h.Buffer.from(r[i],"hex");if(s.toString("hex")!==r[i])throw new Error("invalid hex string in script");var u=s.length;u>=0&&u<he.OP_PUSHDATA1?a=u:u<Math.pow(2,8)?a=he.OP_PUSHDATA1:u<Math.pow(2,16)?a=he.OP_PUSHDATA2:u<Math.pow(2,32)&&(a=he.OP_PUSHDATA4),t.chunks.push({buf:s,len:s.length,opcodenum:a}),i=i+1}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.fromHex=function(e){return new Q(kk.Buffer.from(e,"hex"))};Q.fromString=function(e){if(Hee.isHexa(e)||e.length===0)return new Q(kk.Buffer.from(e,"hex"));var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(yt.isUndefined(a))if(a=parseInt(n),a>0&&a<he.OP_PUSHDATA1)t.chunks.push({buf:h.Buffer.from(r[i+1].slice(2),"hex"),len:a,opcodenum:a}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(a===he.OP_PUSHDATA1||a===he.OP_PUSHDATA2||a===he.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:h.Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:a}),i=i+3}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)!i&&(r===he.OP_PUSHDATA1||r===he.OP_PUSHDATA2||r===he.OP_PUSHDATA4)&&(n=n+" "+he(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof he.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+he(r).toString():n=n+" "+he(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};Q.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};Q.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};Q.prototype.toHex=function(){return this.toBuffer().toString("hex")};Q.prototype.inspect=function(){return"<Script: "+this.toString()+">"};Q.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashOutPrefix=function(){return!!(this.chunks.length>=5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};Q.prototype.getPublicKey=function(){return er.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};Q.prototype.getPublicKeyHash=function(){return er.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf};Q.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===he.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return lf.isValid(e)}return!1};Q.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};Q.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===he.OP_HASH160&&e[1]===20&&e[e.length-1]===he.OP_EQUAL};Q.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=Q.fromBuffer(t)}catch(n){if(n instanceof r4.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==Q.types.UNKNOWN};Q.prototype.isMultisigOut=function(){return this.chunks.length>3&&he.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)})&&he.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===he.OP_CHECKMULTISIG};Q.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)&&cf.isTxDER(e.buf)})};Q.prototype.isDataOut=function(){var e=this.chunks.length>=1&&this.chunks[0].opcodenum===he.OP_RETURN;if(!e)return!1;var t=this.chunks.slice(1),r=new Q({chunks:t});return r.isPushOnly()};Q.prototype.isSafeDataOut=function(){if(this.chunks.length<2||this.chunks[0].opcodenum!==he.OP_FALSE)return!1;var e=this.chunks.slice(1),t=new Q({chunks:e});return t.isDataOut()};Q.prototype.getData=function(){if(this.isSafeDataOut()){var e=this.chunks.slice(2),t=e.map(r=>r.buf);return t}if(this.isDataOut()||this.isScriptHashOut())return yt.isUndefined(this.chunks[1])?h.Buffer.alloc(0):h.Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return h.Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};Q.prototype.isPushOnly=function(){return yt.every(this.chunks,function(e){return e.opcodenum<=he.OP_16||e.opcodenum===he.OP_PUSHDATA1||e.opcodenum===he.OP_PUSHDATA2||e.opcodenum===he.OP_PUSHDATA4})};Q.types={};Q.types.UNKNOWN="Unknown";Q.types.PUBKEY_OUT="Pay to public key";Q.types.PUBKEY_IN="Spend from public key";Q.types.PUBKEYHASH_OUT="Pay to public key hash";Q.types.PUBKEYHASH_IN="Spend from public key hash";Q.types.SCRIPTHASH_OUT="Pay to script hash";Q.types.SCRIPTHASH_IN="Spend from script hash";Q.types.MULTISIG_OUT="Pay to multisig";Q.types.MULTISIG_IN="Spend from multisig";Q.types.DATA_OUT="Data push";Q.types.SAFE_DATA_OUT="Safe data push";Q.OP_RETURN_STANDARD_SIZE=220;Q.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!==Q.types.UNKNOWN?e:this.classifyInput()};Q.outputIdentifiers={};Q.outputIdentifiers.PUBKEY_OUT=Q.prototype.isPublicKeyOut;Q.outputIdentifiers.PUBKEYHASH_OUT=Q.prototype.isPublicKeyHashOut;Q.outputIdentifiers.MULTISIG_OUT=Q.prototype.isMultisigOut;Q.outputIdentifiers.SCRIPTHASH_OUT=Q.prototype.isScriptHashOut;Q.outputIdentifiers.DATA_OUT=Q.prototype.isDataOut;Q.outputIdentifiers.SAFE_DATA_OUT=Q.prototype.isSafeDataOut;Q.prototype.classifyOutput=function(){for(var e in Q.outputIdentifiers)if(Q.outputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.inputIdentifiers={};Q.inputIdentifiers.PUBKEY_IN=Q.prototype.isPublicKeyIn;Q.inputIdentifiers.PUBKEYHASH_IN=Q.prototype.isPublicKeyHashIn;Q.inputIdentifiers.MULTISIG_IN=Q.prototype.isMultisigIn;Q.inputIdentifiers.SCRIPTHASH_IN=Q.prototype.isScriptHashIn;Q.prototype.classifyInput=function(){for(var e in Q.inputIdentifiers)if(Q.inputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.prototype.isStandard=function(){return this.classify()!==Q.types.UNKNOWN};Q.prototype.prepend=function(e){return this._addByType(e,!0),this};Q.prototype.equals=function(e){if(er.checkState(e instanceof Q,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(h.Buffer.isBuffer(this.chunks[t].buf)&&!h.Buffer.isBuffer(e.chunks[t].buf)||h.Buffer.isBuffer(this.chunks[t].buf)&&!this.chunks[t].buf.equals(e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};Q.prototype.add=function(e){return this._addByType(e,!1),this};Q.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof he)this._addOpcode(e,t);else if(h.Buffer.isBuffer(e))this._addBuffer(e,t);else if(e instanceof Q)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};Q.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};Q.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof he?r=e.toNumber():r=he(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};Q.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<he.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=he.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=he.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=he.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};Q.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==he.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};Q.buildMultisigOut=function(e,t,r){er.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new Q;i.add(he.smallInt(t)),e=yt.map(e,lf);var n=e;r.noSorting||(n=e.map(s=>s.toString("hex")).sort().map(s=>new lf(s)));for(var o=0;o<n.length;o++){var a=n[o];i.add(a.toBuffer())}return i.add(he.smallInt(e.length)),i.add(he.OP_CHECKMULTISIG),i};Q.buildMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n};Q.buildP2SHMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n.add((i.cachedMultisig||Q.buildMultisigOut(e,t,i)).toBuffer()),n};Q.buildPublicKeyHashOut=function(e){er.checkArgument(!yt.isUndefined(e)),er.checkArgument(e instanceof lf||e instanceof Yn||yt.isString(e)),e instanceof lf?e=e.toAddress():yt.isString(e)&&(e=new Yn(e));var t=new Q;return t.add(he.OP_DUP).add(he.OP_HASH160).add(e.hashBuffer).add(he.OP_EQUALVERIFY).add(he.OP_CHECKSIG),t._network=e.network,t};Q.buildPublicKeyOut=function(e){er.checkArgument(e instanceof lf);var t=new Q;return t.add(e.toBuffer()).add(he.OP_CHECKSIG),t};Q.buildDataOut=function(e,t){er.checkArgument(yt.isUndefined(e)||yt.isString(e)||yt.isArray(e)||h.Buffer.isBuffer(e));var r=e;yt.isArray(r)||(r=[e]);var i=new Q;i.add(he.OP_RETURN);for(let n of r)er.checkArgument(yt.isUndefined(n)||yt.isString(n)||h.Buffer.isBuffer(n)),yt.isString(n)&&(n=h.Buffer.from(n,t)),yt.isUndefined(n)||i.add(n);return i};Q.buildSafeDataOut=function(e,t){var r=Q.buildDataOut(e,t),i=new Q;return i.add(he.OP_FALSE),i.add(r),i};Q.buildScriptHashOut=function(e){er.checkArgument(e instanceof Q||e instanceof Yn&&e.isPayToScriptHash());var t=new Q;return t.add(he.OP_HASH160).add(e instanceof Yn?e.hashBuffer:t4.sha256ripemd160(e.toBuffer())).add(he.OP_EQUAL),t._network=e._network||e.network,t};Q.buildPublicKeyIn=function(e,t){er.checkArgument(e instanceof cf||h.Buffer.isBuffer(e)),er.checkArgument(yt.isUndefined(t)||yt.isNumber(t)),e instanceof cf&&(e=e.toBuffer());var r=new Q;return r.add(h.Buffer.concat([e,h.Buffer.from([(t||cf.SIGHASH_ALL)&255])])),r};Q.buildPublicKeyHashIn=function(e,t,r){er.checkArgument(t instanceof cf||h.Buffer.isBuffer(t)),er.checkArgument(yt.isUndefined(r)||yt.isNumber(r)),t instanceof cf&&(t=t.toBuffer());var i=new Q().add(h.Buffer.concat([t,h.Buffer.from([(r||cf.SIGHASH_ALL)&255])])).add(new lf(e).toBuffer());return i};Q.empty=function(){return new Q};Q.prototype.toScriptHashOut=function(){return Q.buildScriptHashOut(this)};Q.fromAddress=function(e){if(e=Yn(e),e.isPayToScriptHash())return Q.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return Q.buildPublicKeyHashOut(e);throw new r4.Script.UnrecognizedAddress(e)};Q.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};Q.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToPublicKeyHash;else return!1;return e};Q.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=t4.sha256ripemd160(this.chunks[1].buf),e.type=Yn.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=t4.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Yn.PayToScriptHash;else return!1;return e};Q.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=Tk.get(e)||this._network||Tk.defaultNetwork,new Yn(t)):!1};Q.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=Q({chunks:[this.chunks[i]]}),o=n.toBuffer(),a=o.toString("hex");r===a&&this.chunks.splice(i,1)}return this};Q.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===he.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===he.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===he.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===he.OP_PUSHDATA1:r.length<=65535?i===he.OP_PUSHDATA2:!0:!0};Q.prototype._decodeOP_N=function(e){if(e===he.OP_0)return 0;if(e>=he.OP_1&&e<=he.OP_16)return e-(he.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))};Q.prototype.getSignatureOperationsCount=function(e){e=yt.isUndefined(e)?!0:e;var t=this,r=0,i=he.OP_INVALIDOPCODE;return yt.each(t.chunks,function(o){var a=o.opcodenum;a===he.OP_CHECKSIG||a===he.OP_CHECKSIGVERIFY?r++:(a===he.OP_CHECKMULTISIG||a===he.OP_CHECKMULTISIGVERIFY)&&(e&&i>=he.OP_1&&i<=he.OP_16?r+=t._decodeOP_N(i):r+=20),i=a}),r};Rk.exports=Q});var n4=k(($pe,Mk)=>{v();var jee=Object.prototype.toString;Mk.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return Zee(t)?"generatorfunction":"function";if(zee(t))return"array";if($ee(t))return"buffer";if(Yee(t))return"arguments";if(Vee(t))return"date";if(Kee(t))return"error";if(Gee(t))return"regexp";switch(Bk(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(Wee(t))return"generator";switch(r=jee.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Bk(e){return typeof e.constructor=="function"?e.constructor.name:null}function zee(e){return Array.isArray?Array.isArray(e):e instanceof Array}function Kee(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Vee(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Gee(e){return e instanceof RegExp?!0:typeof e.flags=="string"&&typeof e.ignoreCase=="boolean"&&typeof e.multiline=="boolean"&&typeof e.global=="boolean"}function Zee(e,t){return Bk(e)==="GeneratorFunction"}function Wee(e){return typeof e.throw=="function"&&typeof e.return=="function"&&typeof e.next=="function"}function Yee(e){try{if(typeof e.length=="number"&&typeof e.callee=="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function $ee(e){return e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var Dk=k((Jpe,Ck)=>{"use strict";v();var Nk=Symbol.prototype.valueOf,Xee=n4();function Jee(e,t){switch(Xee(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return rte(e);case"symbol":return ite(e);case"arraybuffer":return ete(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return tte(e);case"regexp":return Qee(e);case"error":return Object.create(e);default:return e}}function Qee(e){let t=e.flags!==void 0?e.flags:/\w+$/.exec(e)||void 0,r=new e.constructor(e.source,t);return r.lastIndex=e.lastIndex,r}function ete(e){let t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function tte(e,t){return new e.constructor(e.buffer,e.byteOffset,e.length)}function rte(e){let t=e.length,r=h.Buffer.allocUnsafe?h.Buffer.allocUnsafe(t):h.Buffer.from(t);return e.copy(r),r}function ite(e){return Nk?Object(Nk.call(e)):{}}Ck.exports=Jee});var qk=k((e6e,Lk)=>{"use strict";v();Lk.exports=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}});var Hk=k((r6e,Fk)=>{"use strict";v();var nte=qk();function Uk(e){return nte(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}Fk.exports=function(t){var r,i;return!(Uk(t)===!1||(r=t.constructor,typeof r!="function")||(i=r.prototype,Uk(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var zk=k((n6e,jk)=>{"use strict";v();var ote=Dk(),ate=n4(),ste=Hk();function o4(e,t){switch(ate(e)){case"object":return ute(e,t);case"array":return fte(e,t);default:return ote(e)}}function ute(e,t){if(typeof t=="function")return t(e);if(t||ste(e)){let r=new e.constructor;for(let i in e)r[i]=o4(e[i],t);return r}return e}function fte(e,t){let r=new e.constructor(e.length);for(let i=0;i<e.length;i++)r[i]=o4(e[i],t);return r}jk.exports=o4});var al=k((a6e,Gk)=>{"use strict";v();var Kk=Wn(),Vk=Da(),cte=fr(),Xn=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof cte){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};Xn.prototype.set=function(e){return this.buf=e.buf||this.buf,this};Xn.prototype.fromString=function(e){return this.set({buf:h.Buffer.from(e,"hex")}),this};Xn.prototype.toString=function(){return this.buf.toString("hex")};Xn.prototype.fromBuffer=function(e){return this.buf=e,this};Xn.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};Xn.prototype.fromBN=function(e){return this.buf=Kk().writeVarintBN(e).concat(),this};Xn.prototype.fromNumber=function(e){return this.buf=Kk().writeVarintNum(e).concat(),this};Xn.prototype.toBuffer=function(){return this.buf};Xn.prototype.toBN=function(){return Vk(this.buf).readVarintBN()};Xn.prototype.toNumber=function(){return Vk(this.buf).readVarintNum()};Gk.exports=Xn});var La=k((u6e,Wk)=>{"use strict";v();var $p=xt(),a4=fr(),Zk=Kt(),Xp=pi(),lte=Wn(),hte=al(),s4=bn(),u4=Bt(),dte=hn(),pte=9007199254740991;function Zr(e){if(!(this instanceof Zr))return new Zr(e);if($p.isObject(e))if(this.satoshis=e.satoshis,h.Buffer.isBuffer(e.script))this._scriptBuffer=e.script;else{var t;$p.isString(e.script)&&Xp.isHexa(e.script)?t=Zk.Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(Zr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(Zr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof a4?(this._satoshisBN=e,this._satoshis=e.toNumber()):$p.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=a4.fromNumber(this._satoshis)):(u4.checkArgument(Xp.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=a4.fromNumber(e),this._satoshis=e),u4.checkState(Xp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.invalidSatoshis=function(){return this._satoshis>pte?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};Object.defineProperty(Zr.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(e){this._satoshisBN=e,this._satoshis=e.toNumber(),u4.checkState(Xp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.toObject=Zr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};Zr.fromObject=function(e){return new Zr(e)};Zr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=s4.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof dte.Script.InvalidBuffer)this._script=null;else throw t}};Zr.prototype.setScript=function(e){if(e instanceof s4)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if($p.isString(e))this._script=s4.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(h.Buffer.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};Zr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};Zr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=Zk.Buffer.from([]),new Zr(t)};Zr.prototype.toBufferWriter=function(e){e||(e=new lte),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};Zr.prototype.getSize=function(){var e=this.script.toBuffer().length,t=hte(e).toBuffer().length;return 8+t+e};Wk.exports=Zr});var sl=k((c6e,Jk)=>{"use strict";v();var Ps=xt(),gte=Bt(),F0=hn(),vte=Wn(),f4=Kt(),$k=pi(),Jp=bn(),mte=qa(),Yk=La(),Qp=4294967295,yte=Qp-2,Xk=Qp,bte=Qp-1;function jt(e){if(!(this instanceof jt))return new jt(e);if(e)return this._fromObject(e)}jt.MAXINT=Qp;jt.DEFAULT_SEQNUMBER=Xk;jt.DEFAULT_LOCKTIME_SEQNUMBER=bte;jt.DEFAULT_RBF_SEQNUMBER=yte;jt.BASE_SIZE=40;Object.defineProperty(jt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new Jp(this._scriptBuffer),this._script._isInput=!0),this._script)}});jt.fromObject=function(e){gte.checkArgument(Ps.isObject(e));var t=new jt;return t._fromObject(e)};jt.prototype._fromObject=function(e){var t;if(Ps.isString(e.prevTxId)&&$k.isHexa(e.prevTxId)?t=f4.Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.output=e.output?e.output instanceof Yk?e.output:new Yk(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=Ps.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=Ps.isUndefined(e.sequenceNumber)?Ps.isUndefined(e.seqnum)?Xk:e.seqnum:e.sequenceNumber,Ps.isUndefined(e.script)&&Ps.isUndefined(e.scriptBuffer))throw new F0.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};jt.prototype.toObject=jt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};jt.fromBufferReader=function(e){var t=new jt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};jt.prototype.toBufferWriter=function(e){e||(e=new vte),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};jt.prototype.setScript=function(e){if(this._script=null,e instanceof Jp)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(e===null)this._script=Jp.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if($k.isHexa(e))this._scriptBuffer=f4.Buffer.from(e,"hex");else if(Ps.isString(e))this._script=new Jp(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(h.Buffer.isBuffer(e))this._scriptBuffer=f4.Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};jt.prototype.getSignatures=function(){throw new F0.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};jt.prototype.isFullySigned=function(){throw new F0.AbstractMethodInvoked("Input#isFullySigned")};jt.prototype.isFinal=function(){return this.sequenceNumber===jt.MAXINT};jt.prototype.addSignature=function(){throw new F0.AbstractMethodInvoked("Input#addSignature")};jt.prototype.clearSignatures=function(){throw new F0.AbstractMethodInvoked("Input#clearSignatures")};jt.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,mte.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};jt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};jt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};Jk.exports=jt});var fl=k((h6e,tR)=>{"use strict";v();var ul=xt(),_n=Bt(),_te=Ot(),Qk=pi(),eR=$n(),wte=hn(),H0=Vr();function Jn(e){if(!(this instanceof Jn))return new Jn(e);if(e instanceof Jn)return e;if(ul.isObject(e))return this._fromObject(e);throw new wte.InvalidArgument("TransactionSignatures must be instantiated from an object")}_te(Jn,H0);Jn.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new eR(e.publicKey),this.prevTxId=h.Buffer.isBuffer(e.prevTxId)?e.prevTxId:h.Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof H0?e.signature:h.Buffer.isBuffer(e.signature)?H0.fromBuffer(e.signature):H0.fromString(e.signature),this.sigtype=e.sigtype,this};Jn.prototype._checkObjectArgs=function(e){_n.checkArgument(eR(e.publicKey),"publicKey"),_n.checkArgument(!ul.isUndefined(e.inputIndex),"inputIndex"),_n.checkArgument(!ul.isUndefined(e.outputIndex),"outputIndex"),_n.checkState(ul.isNumber(e.inputIndex),"inputIndex must be a number"),_n.checkState(ul.isNumber(e.outputIndex),"outputIndex must be a number"),_n.checkArgument(e.signature,"signature"),_n.checkArgument(e.prevTxId,"prevTxId"),_n.checkState(e.signature instanceof H0||h.Buffer.isBuffer(e.signature)||Qk.isHexa(e.signature),"signature must be a buffer or hexa value"),_n.checkState(h.Buffer.isBuffer(e.prevTxId)||Qk.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),_n.checkArgument(e.sigtype,"sigtype"),_n.checkState(ul.isNumber(e.sigtype),"sigtype must be a number")};Jn.prototype.toObject=Jn.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};Jn.fromObject=function(e){return _n.checkArgument(e),new Jn(e)};tR.exports=Jn});var aR=k((p6e,oR)=>{"use strict";v();var Ste=Ot(),iR=Bt(),c4=sl(),xte=La(),Ete=qa(),nR=bn(),rR=Vr(),Ote=fl();function Ua(){c4.apply(this,arguments)}Ste(Ua,c4);Ua.prototype.getSignatures=function(e,t,r,i){iR.checkState(this.output instanceof xte),i=i||rR.SIGHASH_ALL|rR.SIGHASH_FORKID;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new Ote({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:Ete.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Ua.prototype.addSignature=function(e,t){return iR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(nR.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};Ua.prototype.clearSignatures=function(){return this.setScript(nR.empty()),this};Ua.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};Ua.SCRIPT_MAX_SIZE=74;Ua.prototype._estimateSize=function(){return c4.BASE_SIZE+Ua.SCRIPT_MAX_SIZE};oR.exports=Ua});var lR=k((v6e,cR)=>{"use strict";v();var Ite=Ot(),uR=Bt(),Ate=cr(),l4=sl(),Pte=La(),Tte=qa(),fR=bn(),sR=Vr(),kte=fl();function Fa(){l4.apply(this,arguments)}Ite(Fa,l4);Fa.prototype.getSignatures=function(e,t,r,i,n){uR.checkState(this.output instanceof Pte),n=n||Ate.sha256ripemd160(t.publicKey.toBuffer()),i=i||sR.SIGHASH_ALL|sR.SIGHASH_FORKID;var o=this.output.script.chunks[2]&&this.output.script.chunks[2].buf;return o&&n.equals(o)?[new kte({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:Tte.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Fa.prototype.addSignature=function(e,t){return uR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(fR.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};Fa.prototype.clearSignatures=function(){return this.setScript(fR.empty()),this};Fa.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()};Fa.SCRIPT_MAX_SIZE=108;Fa.prototype._estimateSize=function(){return l4.BASE_SIZE+Fa.SCRIPT_MAX_SIZE};cR.exports=Fa});var pR=k((y6e,dR)=>{"use strict";v();var Qn=xt(),Rte=Ot(),t6=sl(),Bte=La(),j0=Bt(),hR=bn(),e6=Vr(),h4=qa(),d4=fl(),Mte=$n(),Nte=al();function Br(e,t,r,i){t6.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new Mte(o)),j0.checkState(hR.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},Qn.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}Rte(Br,t6);Br.prototype.toObject=function(){var e=t6.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=Qn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Br.prototype._deserializeSignatures=function(e){return Qn.map(e,function(t){if(t)return new d4(t)})};Br.prototype._serializeSignatures=function(){return Qn.map(this.signatures,function(e){if(e)return e.toObject()})};Br.prototype.getSignatures=function(e,t,r,i){j0.checkState(this.output instanceof Bte),i=i||e6.SIGHASH_ALL|e6.SIGHASH_FORKID;var n=this,o=[];return Qn.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new d4({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:h4.sign(e,t,i,r,n.output.script,n.output.satoshisBN),sigtype:i}))}),o};Br.prototype.addSignature=function(e,t){return j0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),j0.checkArgument(!Qn.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),j0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Br.prototype._updateScript=function(){return this.setScript(hR.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Br.prototype._createSignatures=function(){return Qn.map(Qn.filter(this.signatures,function(e){return!Qn.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Br.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Br.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Br.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Br.prototype.countSignatures=function(){return Qn.reduce(this.signatures,function(e,t){return e+!!t},0)};Br.prototype.publicKeysWithoutSignature=function(){var e=this;return Qn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Br.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,h4.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};Br.normalizeSignatures=function(e,t,r,i,n){return n.map(function(o){var a=null;return i=i.filter(function(s){if(a)return!0;var u=new d4({signature:e6.fromTxFormat(s),publicKey:o,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:e6.SIGHASH_ALL});u.signature.nhashtype=u.sigtype;var c=h4.verify(e,u.signature,u.publicKey,u.inputIndex,t.output.script);return c?(a=u,!1):!0}),a||null})};Br.SIGNATURE_SIZE=73;Br.prototype._estimateSize=function(){var e=1+this.threshold*Br.SIGNATURE_SIZE;return t6.BASE_SIZE+Nte(e).toBuffer().length+e};dR.exports=Br});var bR=k((_6e,yR)=>{"use strict";v();var eo=xt(),Cte=Ot(),r6=sl(),Dte=La(),z0=Bt(),p4=bn(),gR=Vr(),vR=qa(),mR=fl(),Lte=$n(),qte=al();function Er(e,t,r,i){r6.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new Lte(o)),this.redeemScript=p4.buildMultisigOut(this.publicKeys,r),z0.checkState(p4.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},eo.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}Cte(Er,r6);Er.prototype.toObject=function(){var e=r6.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=eo.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Er.prototype._deserializeSignatures=function(e){return eo.map(e,function(t){if(t)return new mR(t)})};Er.prototype._serializeSignatures=function(){return eo.map(this.signatures,function(e){if(e)return e.toObject()})};Er.prototype.getSignatures=function(e,t,r,i){z0.checkState(this.output instanceof Dte),i=i||gR.SIGHASH_ALL|gR.SIGHASH_FORKID;var n=this,o=[];return eo.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new mR({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:vR.sign(e,t,i,r,n.redeemScript,n.output.satoshisBN),sigtype:i}))}),o};Er.prototype.addSignature=function(e,t){return z0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),z0.checkArgument(!eo.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),z0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Er.prototype._updateScript=function(){return this.setScript(p4.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this};Er.prototype._createSignatures=function(){return eo.map(eo.filter(this.signatures,function(e){return!eo.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Er.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Er.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Er.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Er.prototype.countSignatures=function(){return eo.reduce(this.signatures,function(e,t){return e+!!t},0)};Er.prototype.publicKeysWithoutSignature=function(){var e=this;return eo.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Er.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,vR.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript,this.output.satoshisBN)};Er.SIGNATURE_SIZE=73;Er.PUBKEY_SIZE=34;Er.prototype._estimateSize=function(){var e=this.publicKeys.length*Er.PUBKEY_SIZE,t=this.threshold*Er.SIGNATURE_SIZE,r=3+e,i=r<=75?1:r<=255?2:3,n=t+1+i+r;return r6.BASE_SIZE+qte(n).toBuffer().length+n};yR.exports=Er});var i6=k((S6e,cl)=>{v();cl.exports=sl();cl.exports.PublicKey=aR();cl.exports.PublicKeyHash=lR();cl.exports.MultiSig=pR();cl.exports.MultiSigScriptHash=bR()});var qa=k((E6e,ER)=>{"use strict";v();var Ute=Kt(),Hi=Vr(),g4=bn(),Fte=La(),Hte=Da(),K0=Wn(),_R=fr(),n6=cr(),wR=a6(),v4=Bt(),m4=o6(),Ts=xt(),SR=h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),jte="ffffffffffffffff",zte=m4.SCRIPT_ENABLE_SIGHASH_FORKID,Kte=function(e,t,r,i,n){var o=e.inputs[r];v4.checkArgument(n instanceof _R,"For ForkId=0 signatures, satoshis or complete input must be provided");function a(M){var D=new K0;Ts.each(M.inputs,function(K){D.writeReverse(K.prevTxId),D.writeUInt32LE(K.outputIndex)});var L=D.toBuffer(),U=n6.sha256sha256(L);return U}function s(M){var D=new K0;Ts.each(M.inputs,function(K){D.writeUInt32LE(K.sequenceNumber)});var L=D.toBuffer(),U=n6.sha256sha256(L);return U}function u(M,D){var L=new K0;Ts.isUndefined(D)?Ts.each(M.outputs,function(N){N.toBufferWriter(L)}):M.outputs[D].toBufferWriter(L);var U=L.toBuffer(),K=n6.sha256sha256(U);return K}var c=h.Buffer.alloc(32),l=h.Buffer.alloc(32),m=h.Buffer.alloc(32);t&Hi.SIGHASH_ANYONECANPAY||(c=a(e)),!(t&Hi.SIGHASH_ANYONECANPAY)&&(t&31)!==Hi.SIGHASH_SINGLE&&(t&31)!==Hi.SIGHASH_NONE&&(l=s(e)),(t&31)!==Hi.SIGHASH_SINGLE&&(t&31)!==Hi.SIGHASH_NONE?m=u(e):(t&31)===Hi.SIGHASH_SINGLE&&r<e.outputs.length&&(m=u(e,r));var w=new K0;w.writeInt32LE(e.version),w.write(c),w.write(l),w.writeReverse(o.prevTxId),w.writeUInt32LE(o.outputIndex),w.writeVarintNum(i.toBuffer().length),w.write(i.toBuffer()),w.writeUInt64LEBN(n);var E=o.sequenceNumber;w.writeUInt32LE(E),w.write(m),w.writeUInt32LE(e.nLockTime),w.writeUInt32LE(t>>>0);var P=w.toBuffer();return P},xR=function(t,r,i,n,o,a){var s=b4(),u=i6();Ts.isUndefined(a)&&(a=zte);var c=s.shallowCopy(t);if(n=new g4(n),a&m4.SCRIPT_ENABLE_REPLAY_PROTECTION){var l=r>>8,m=16711680|l^57005;r=m<<8|r&255}if(r&Hi.SIGHASH_FORKID&&a&m4.SCRIPT_ENABLE_SIGHASH_FORKID)return Kte(c,r,i,n,o);n.removeCodeseparators();var w;for(w=0;w<c.inputs.length;w++)c.inputs[w]=new u(c.inputs[w]).setScript(g4.empty());if(c.inputs[i]=new u(c.inputs[i]).setScript(n),(r&31)===Hi.SIGHASH_NONE||(r&31)===Hi.SIGHASH_SINGLE)for(w=0;w<c.inputs.length;w++)w!==i&&(c.inputs[w].sequenceNumber=0);if((r&31)===Hi.SIGHASH_NONE)c.outputs=[];else if((r&31)===Hi.SIGHASH_SINGLE){if(i>=c.outputs.length)return SR;for(c.outputs.length=i+1,w=0;w<i;w++)c.outputs[w]=new Fte({satoshis:_R.fromBuffer(Ute.Buffer.from(jte,"hex")),script:g4.empty()})}r&Hi.SIGHASH_ANYONECANPAY&&(c.inputs=[c.inputs[i]]);var E=new K0().write(c.toBuffer()).writeInt32LE(r).toBuffer();return E},y4=function(t,r,i,n,o,a){var s=xR(t,r,i,n,o,a);if(s.compare(SR)===0)return s;var u=n6.sha256sha256(s);return u=new Hte(u).readReverse(),u};function Vte(e,t,r,i,n,o,a){var s=y4(e,r,i,n,o,a),u=wR.sign(s,t,"little").set({nhashtype:r});return u}function Gte(e,t,r,i,n,o,a){v4.checkArgument(!Ts.isUndefined(e)),v4.checkArgument(!Ts.isUndefined(t)&&!Ts.isUndefined(t.nhashtype));var s=y4(e,t.nhashtype,i,n,o,a);return wR.verify(s,t,r,"little")}ER.exports={sighashPreimage:xR,sighash:y4,sign:Vte,verify:Gte}});var _4=k((I6e,IR)=>{"use strict";v();var Ha=xt(),s6=Bt(),OR=pi(),Zte=bn(),Wte=hf();function ja(e){if(!(this instanceof ja))return new ja(e);s6.checkArgument(Ha.isObject(e),"Must provide an object from where to extract data");var t=e.address?new Wte(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!OR.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=Ha.isUndefined(e.vout)?e.outputIndex:e.vout;if(!Ha.isNumber(i))throw new Error("Invalid outputIndex, received "+i);s6.checkArgument(!Ha.isUndefined(e.scriptPubKey)||!Ha.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new Zte(e.scriptPubKey||e.script);s6.checkArgument(!Ha.isUndefined(e.amount)||!Ha.isUndefined(e.satoshis),"Must provide an amount for the output");var o=Ha.isUndefined(e.amount)?e.satoshis:Math.round(e.amount*1e8);s6.checkArgument(Ha.isNumber(o),"Amount must be a number"),OR.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}ja.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};ja.prototype.toString=function(){return this.txId+":"+this.outputIndex};ja.fromObject=function(e){return new ja(e)};ja.prototype.toObject=ja.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:Number.parseFloat((this.satoshis/1e8).toFixed(8))}};IR.exports=ja});var b4=k((P6e,NR)=>{"use strict";v();var Ee=xt(),Wr=Bt(),Yte=Kt(),Nr=hn(),PR=pi(),TR=Da(),$te=Wn(),AR=al(),kR=cr(),f6=Vr(),RR=qa(),Xte=hf(),BR=_4(),Mr=i6(),Jte=Mr.PublicKeyHash,Qte=Mr.PublicKey,ere=Mr.MultiSigScriptHash,tre=Mr.MultiSig,to=La(),Co=bn(),rre=V0(),u6=fr(),ire=o6(),nre=ire.SCRIPT_ENABLE_SIGHASH_FORKID;function fe(e){if(!(this instanceof fe))return new fe(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof fe)return fe.shallowCopy(e);if(PR.isHexa(e))this.fromString(e);else if(h.Buffer.isBuffer(e))this.fromBuffer(e);else if(Ee.isObject(e))this.fromObject(e);else throw new Nr.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var ore=1,are=0,sre=1e6;fe.DUST_AMOUNT=546;fe.FEE_SECURITY_MARGIN=150;fe.MAX_MONEY=21e6*1e8;fe.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;fe.NLOCKTIME_MAX_VALUE=4294967295;fe.FEE_PER_KB=500;fe.CHANGE_OUTPUT_MAX_SIZE=62;fe.shallowCopy=function(e){var t=new fe(e.toBuffer());return t};var MR={configurable:!1,enumerable:!0,get:function(){return this._hash=new TR(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(fe.prototype,"hash",MR);Object.defineProperty(fe.prototype,"id",MR);var w4={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(fe.prototype,"inputAmount",w4);w4.get=function(){return this._getOutputAmount()};Object.defineProperty(fe.prototype,"outputAmount",w4);fe.prototype._getHash=function(){return kR.sha256sha256(this.toBuffer())};fe.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};fe.prototype.uncheckedSerialize=fe.prototype.toString=function(){return this.toBuffer().toString("hex")};fe.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bsv.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()};fe.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};fe.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Nr.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Nr.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};fe.prototype._hasFeeError=function(e,t){if(!Ee.isUndefined(this._fee)&&this._fee!==t)return new Nr.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(fe.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Nr.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Nr.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}};fe.prototype._missingChange=function(){return!this._changeScript};fe.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<fe.DUST_AMOUNT&&!r.script.isDataOut()&&!r.script.isSafeDataOut())return new Nr.Transaction.DustOutputs}};fe.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Nr.Transaction.MissingSignatures};fe.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};fe.prototype.toBuffer=function(){var e=new $te;return this.toBufferWriter(e).toBuffer()};fe.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),Ee.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),Ee.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e};fe.prototype.fromBuffer=function(e){var t=new TR(e);return this.fromBufferReader(t)};fe.prototype.fromBufferReader=function(e){Wr.checkArgument(!e.finished(),"No transaction data received");var t,r,i;for(this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t<r;t++){var n=Mr.fromBufferReader(e);this.inputs.push(n)}for(i=e.readVarintNum(),t=0;t<i;t++)this.outputs.push(to.fromBufferReader(e));return this.nLockTime=e.readUInt32LE(),this};fe.prototype.toObject=fe.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),Ee.isUndefined(this._changeIndex)||(i.changeIndex=this._changeIndex),Ee.isUndefined(this._fee)||(i.fee=this._fee),i};fe.prototype.fromObject=function(t){Wr.checkArgument(Ee.isObject(t)||t instanceof fe);var r=this,i;return t instanceof fe?i=i.toObject():i=t,Ee.each(i.inputs,function(n){if(!n.output||!n.output.script){r.uncheckedAddInput(new Mr(n));return}var o=new Co(n.output.script),a;if(o.isPublicKeyHashOut())a=new Mr.PublicKeyHash(n);else if(o.isScriptHashOut()&&n.publicKeys&&n.threshold)a=new Mr.MultiSigScriptHash(n,n.publicKeys,n.threshold,n.signatures);else if(o.isPublicKeyOut())a=new Mr.PublicKey(n);else throw new Nr.Transaction.Input.UnsupportedScript(n.output.script);r.addInput(a)}),Ee.each(i.outputs,function(n){r.addOutput(new to(n))}),i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new Co(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};fe.prototype._checkConsistency=function(e){Ee.isUndefined(this._changeIndex)||(Wr.checkState(this._changeScript,"Change script is expected."),Wr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),Wr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&Wr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};fe.prototype.lockUntilDate=function(e){if(Wr.checkArgument(e),Ee.isNumber(e)&&e<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.LockTimeTooEarly;Ee.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.lockUntilBlockHeight=function(e){if(Wr.checkArgument(Ee.isNumber(e)),e>=fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.BlockHeightTooHigh;if(e<0)throw new Nr.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};fe.prototype.fromString=function(e){this.fromBuffer(Yte.Buffer.from(e,"hex"))};fe.prototype._newTransaction=function(){this.version=ore,this.nLockTime=are};fe.prototype.from=function(e,t,r){if(Ee.isArray(e)){var i=this;return Ee.each(e,function(o){i.from(o,t,r)}),this}var n=Ee.some(this.inputs,function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex});return n?this:(t&&r?this._fromMultisigUtxo(e,t,r):this._fromNonP2SH(e),this)};fe.prototype._fromNonP2SH=function(e){var t;e=new BR(e),e.script.isPublicKeyHashOutPrefix()?t=Jte:e.script.isPublicKeyOut()?t=Qte:t=Mr,this.addInput(new t({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()}))};fe.prototype._fromMultisigUtxo=function(e,t,r){Wr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");var i;if(e=new BR(e),e.script.isMultisigOut())i=tre;else if(e.script.isScriptHashOut())i=ere;else throw new Nr.Transaction.Input.UnsupportedScript(e.script.toString());this.addInput(new i({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()},t,r))};fe.prototype.addInput=function(e,t,r){if(Wr.checkArgumentType(e,Mr,"input"),!e.output&&(Ee.isUndefined(t)||Ee.isUndefined(r)))throw new Nr.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&!Ee.isUndefined(r)&&(t=t instanceof Co?t:new Co(t),Wr.checkArgumentType(r,"number","satoshis"),e.output=new to({script:t,satoshis:r})),this.uncheckedAddInput(e)};fe.prototype.uncheckedAddInput=function(e){return Wr.checkArgumentType(e,Mr,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};fe.prototype.hasAllUtxoInfo=function(){return Ee.every(this.inputs.map(function(e){return!!e.output}))};fe.prototype.fee=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};fe.prototype.feePerKb=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};fe.prototype.change=function(e){return Wr.checkArgument(e,"address is required"),this._changeScript=Co.fromAddress(e),this._updateChangeOutput(),this};fe.prototype.getChangeOutput=function(){return Ee.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]};fe.prototype.to=function(e,t){if(Ee.isArray(e)){var r=this;return Ee.each(e,function(i){r.to(i.address,i.satoshis)}),this}return Wr.checkArgument(PR.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new to({script:Co(new Xte(e)),satoshis:t})),this};fe.prototype.addData=function(e){return this.addOutput(new to({script:Co.buildDataOut(e),satoshis:0})),this};fe.prototype.addSafeData=function(e){return this.addOutput(new to({script:Co.buildSafeDataOut(e),satoshis:0})),this};fe.prototype.addOutput=function(e){return Wr.checkArgumentType(e,to,"output"),this._addOutput(e),this._updateChangeOutput(),this};fe.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};fe.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};fe.prototype._getOutputAmount=function(){if(Ee.isUndefined(this._outputAmount)){var e=this;this._outputAmount=0,Ee.each(this.outputs,function(t){e._outputAmount+=t.satoshis})}return this._outputAmount};fe.prototype._getInputAmount=function(){if(Ee.isUndefined(this._inputAmount)){var e=this;this._inputAmount=0,Ee.each(this.inputs,function(t){if(Ee.isUndefined(t.output))throw new Nr.Transaction.Input.MissingPreviousOutput;e._inputAmount+=t.output.satoshis})}return this._inputAmount};fe.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),Ee.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex),this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:0}));var e=this._getUnspentValue(),t=this.getFee(),r=e-t;this._removeOutput(this._changeIndex),this._changeIndex=void 0,r>=fe.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:r})))}};fe.prototype.getFee=function(){return this.isCoinbase()?0:Ee.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee};fe.prototype._estimateFee=function(){var e=this._estimateSize();return Math.ceil(e/1e3*(this._feePerKb||fe.FEE_PER_KB))};fe.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};fe.prototype._clearSignatures=function(){Ee.each(this.inputs,function(e){e.clearSignatures!==Mr.prototype.clearSignatures&&e.clearSignatures()})};fe.prototype._estimateSize=function(){var e=8;return e+=AR(this.inputs.length).toBuffer().length,e+=AR(this.outputs.length).toBuffer().length,Ee.each(this.inputs,function(t){e+=t._estimateSize()}),Ee.each(this.outputs,function(t){e+=t.getSize()}),e};fe.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=Ee.without(this.outputs,t),this._outputAmount=void 0};fe.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};fe.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.prevTxId.compare(i.prevTxId)||r.outputIndex-i.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.satoshis-i.satoshis||r.script.toBuffer().compare(i.script.toBuffer())}),t}),this};fe.prototype.shuffleOutputs=function(){return this.sortOutputs(Ee.shuffle)};fe.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};fe.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};fe.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||Ee.difference(this.outputs,e).length!==0;if(t)throw new Nr.Transaction.InvalidSorting;if(!Ee.isUndefined(this._changeIndex)){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};fe.prototype.removeInput=function(e,t){var r;if(!t&&Ee.isNumber(e)?r=e:r=Ee.findIndex(this.inputs,function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Nr.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=Ee.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};fe.prototype.sign=function(e,t){Wr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return Ee.isArray(e)?(Ee.each(e,function(i){r.sign(i,t)}),this):(Ee.each(this.getSignatures(e,t),function(i){r.applySignature(i)}),this)};fe.prototype.getSignatures=function(e,t){e=new rre(e),t=t||f6.SIGHASH_ALL|f6.SIGHASH_FORKID;var r=this,i=[],n=kR.sha256ripemd160(e.publicKey.toBuffer());return Ee.each(this.inputs,function(a,s){Ee.each(a.getSignatures(r,e,s,t,n),function(u){i.push(u)})}),i};fe.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this};fe.prototype.isFullySigned=function(){return Ee.each(this.inputs,function(e){if(e.isFullySigned===Mr.prototype.isFullySigned)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),Ee.every(Ee.map(this.inputs,function(e){return e.isFullySigned()}))};fe.prototype.isValidSignature=function(e){var t=this;if(this.inputs[e.inputIndex].isValidSignature===Mr.prototype.isValidSignature)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(t,e)};fe.prototype.verifySignature=function(e,t,r,i,n,o){return RR.verify(this,e,t,r,i,n,o)};fe.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new u6(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new u6(fe.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new u6(fe.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>sre)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(!Ee.isUndefined(i[o]))return"transaction input "+t+" duplicate input";i[o]=!0}var a=this.isCoinbase();if(a){var s=this.inputs[0]._scriptBuffer;if(s.length<2||s.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};fe.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};fe.prototype.sighash=function(e,t,r,i,n){t=t||f6.SIGHASH_ALL|f6.SIGHASH_FORKID;var o=this.inputs[e];if(!o)throw new Error("Input index "+e+" does not exist");return!r&&o.output&&(r=o.output.script),!i&&o.output&&(i=new u6(o.output.satoshis)),n=n||nre,RR.sighash(this,t,e,r,i,n)};NR.exports=fe});var ks=k((k6e,df)=>{v();df.exports=b4();df.exports.Input=i6();df.exports.Output=La();df.exports.UnspentOutput=_4();df.exports.Signature=fl();df.exports.Sighash=qa()});var o6=k((B6e,DR)=>{"use strict";v();var c6=xt(),Z0=i4(),V=Yp(),Pe=fr(),G0=cr(),pf=Vr(),S4=$n(),CR=zk(),re=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};re.prototype.verify=function(e,t,r,i,n,o){var a=ks();if(c6.isUndefined(r)&&(r=new a),c6.isUndefined(i)&&(i=0),c6.isUndefined(n)&&(n=0),n&re.SCRIPT_ENABLE_SIGHASH_FORKID&&(n|=re.SCRIPT_VERIFY_STRICTENC,!o))throw new Error("internal error - need satoshisBN to verify FORKID transactions");this.set({script:e,tx:r,nin:i,flags:n,satoshisBN:o});var s;if((n&re.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;n&re.SCRIPT_VERIFY_P2SH&&(s=this.stack.slice());var u=this.stack;if(this.initialize(),this.set({script:t,stack:u,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var c=this.stack[this.stack.length-1];if(!re.castToBool(c))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(n&re.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(s.length===0)throw new Error("internal error - stack copy empty");var l=s[s.length-1],m=Z0.fromBuffer(l);if(s.pop(),this.initialize(),this.set({script:m,stack:s,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(s.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!re.castToBool(s[s.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if((n&re.SCRIPT_VERIFY_CLEANSTACK)!==0){if((n&re.SCRIPT_VERIFY_P2SH)===0)throw new Error("internal error - CLEANSTACK without P2SH");if(s.length!==1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0};DR.exports=re;re.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0};re.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin<"u"?e.nin:this.nin,this.satoshisBN=e.satoshisBN||this.satoshisBN,this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc<"u"?e.pc:this.pc,this.pbegincodehash=typeof e.pbegincodehash<"u"?e.pbegincodehash:this.pbegincodehash,this.nOpCount=typeof e.nOpCount<"u"?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags<"u"?e.flags:this.flags};re.true=h.Buffer.from([1]);re.false=h.Buffer.from([]);re.MAX_SCRIPT_ELEMENT_SIZE=520;re.MAXIMUM_ELEMENT_SIZE=4;re.MAX_OPS_PER_SCRIPT=201;re.MAX_SCRIPT_SIZE=1e4;re.LOCKTIME_THRESHOLD=5e8;re.LOCKTIME_THRESHOLD_BN=new Pe(re.LOCKTIME_THRESHOLD);re.useGenesisLimits=function(e){return e=e||2147483647,re.MAX_SCRIPT_ELEMENT_SIZE=e,re.MAXIMUM_ELEMENT_SIZE=e,re.MAX_OPS_PER_SCRIPT=e,re.MAX_SCRIPT_SIZE=e,re};re.getLimits=function(){return{maxScriptElementSize:re.MAX_SCRIPT_ELEMENT_SIZE,maximumElementSize:re.MAXIMUM_ELEMENT_SIZE,maxOpsPerScript:re.MAX_OPS_PER_SCRIPT,maxScriptSize:re.MAX_SCRIPT_SIZE}};re.setLimits=function(e){return e=e||{},e.maxScriptElementSize!=null&&(re.MAX_SCRIPT_ELEMENT_SIZE=e.maxScriptElementSize),e.maximumElementSize!=null&&(re.MAXIMUM_ELEMENT_SIZE=e.maximumElementSize),e.maxOpsPerScript!=null&&(re.MAX_OPS_PER_SCRIPT=e.maxOpsPerScript),e.maxScriptSize!=null&&(re.MAX_SCRIPT_SIZE=e.maxScriptSize),re};re.SCRIPT_VERIFY_NONE=0;re.SCRIPT_VERIFY_P2SH=1;re.SCRIPT_VERIFY_STRICTENC=2;re.SCRIPT_VERIFY_DERSIG=4;re.SCRIPT_VERIFY_LOW_S=8;re.SCRIPT_VERIFY_NULLDUMMY=16;re.SCRIPT_VERIFY_SIGPUSHONLY=32;re.SCRIPT_VERIFY_MINIMALDATA=64;re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;re.SCRIPT_VERIFY_CLEANSTACK=256;re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;re.SCRIPT_VERIFY_MINIMALIF=8192;re.SCRIPT_VERIFY_NULLFAIL=16384;re.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768;re.SCRIPT_ENABLE_SIGHASH_FORKID=65536;re.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;re.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18;re.SCRIPT_ENABLE_MAGNETIC_OPCODES=1<<19;re.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;re.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;re.SEQUENCE_LOCKTIME_MASK=65535;re.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};re.prototype.checkSignatureEncoding=function(e){var t;if(e.length===0)return!0;if((this.flags&(re.SCRIPT_VERIFY_DERSIG|re.SCRIPT_VERIFY_LOW_S|re.SCRIPT_VERIFY_STRICTENC))!==0&&!pf.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if((this.flags&re.SCRIPT_VERIFY_LOW_S)!==0){if(t=pf.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if((this.flags&re.SCRIPT_VERIFY_STRICTENC)!==0){if(t=pf.fromTxFormat(e),!t.hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nhashtype&pf.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nhashtype&pf.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0};re.prototype.checkPubkeyEncoding=function(e){return(this.flags&re.SCRIPT_VERIFY_STRICTENC)!==0&&!S4.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):!0};re._isMinimallyEncoded=function(e,t){return t=t||re.MAXIMUM_ELEMENT_SIZE,!(e.length>t||e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))};re._minimallyEncode=function(e){if(e.length===0)return e;var t=e[e.length-1];if(t&127)return e;if(e.length===1)return h.Buffer.from("");if(e[e.length-2]&128)return e;for(var r=e.length-1;r>0;r--)if(e[r-1]!==0)return e[r-1]&128?e[r++]=t:e[r-1]|=t,e.slice(0,r);return h.Buffer.from("")};re.prototype.evaluate=function(){if(this.script.toBuffer().length>re.MAX_SCRIPT_SIZE)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let t={pc:this.pc,opcode:V.fromNumber(this.script.chunks[this.pc].opcodenum)};var e=this.step();if(!e)return!1;this._callbackStep(t)}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(t){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};re.prototype._callbackStep=function(e){if(typeof this.stepListener=="function")try{this.stepListener(e,CR(this.stack,!0),CR(this.altstack,!0))}catch(t){console.log(`Error in Step callback:${t}`)}};re.prototype.checkLockTime=function(e){return!(!(this.tx.nLockTime<re.LOCKTIME_THRESHOLD&&e.lt(re.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=re.LOCKTIME_THRESHOLD&&e.gte(re.LOCKTIME_THRESHOLD_BN))||e.gt(new Pe(this.tx.nLockTime))||this.tx.inputs[this.nin].isFinal())};re.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2||t&re.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=re.SEQUENCE_LOCKTIME_TYPE_FLAG|re.SEQUENCE_LOCKTIME_MASK,i=new Pe(t&r),n=e.and(r),o=new Pe(re.SEQUENCE_LOCKTIME_TYPE_FLAG);return!(!(i.lt(o)&&n.lt(o)||i.gte(o)&&n.gte(o))||n.gt(i))};function ure(e,t){let r=e;for(;r.length<t;)r=h.Buffer.concat([h.Buffer.from([0]),r]);return r}re.prototype.step=function(){var e=this;function t(se){return e.stack[e.stack.length+se]}function r(se){switch(se){case V.OP_2MUL:case V.OP_2DIV:return!0;case V.OP_INVERT:case V.OP_MUL:case V.OP_LSHIFT:case V.OP_RSHIFT:if((e.flags&re.SCRIPT_ENABLE_MAGNETIC_OPCODES)===0)return!0;break;case V.OP_DIV:case V.OP_MOD:case V.OP_SPLIT:case V.OP_CAT:case V.OP_AND:case V.OP_OR:case V.OP_XOR:case V.OP_BIN2NUM:case V.OP_NUM2BIN:return!1;default:break}return!1}var i=(this.flags&re.SCRIPT_VERIFY_MINIMALDATA)!==0,n=this.vfExec.indexOf(!1)===-1,o,a,s,u,c,l,m,w,E,P,M,D,L,U,K,N,C,F=this.script.chunks[this.pc];this.pc++;var H=F.opcodenum;if(c6.isUndefined(H))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(F.buf&&F.buf.length>re.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(H>V.OP_16&&++this.nOpCount>re.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(r(H))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(n&&H>=0&&H<=V.OP_PUSHDATA4){if(i&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!F.buf)this.stack.push(re.false);else{if(F.len!==F.buf.length)throw new Error(`Length of push value not equal to length of data (${F.len},${F.buf.length})`);this.stack.push(F.buf)}}else if(n||V.OP_IF<=H&&H<=V.OP_ENDIF)switch(H){case V.OP_1NEGATE:case V.OP_1:case V.OP_2:case V.OP_3:case V.OP_4:case V.OP_5:case V.OP_6:case V.OP_7:case V.OP_8:case V.OP_9:case V.OP_10:case V.OP_11:case V.OP_12:case V.OP_13:case V.OP_14:case V.OP_15:case V.OP_16:c=H-(V.OP_1-1),o=new Pe(c).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_NOP:break;case V.OP_NOP2:case V.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var z=Pe.fromScriptNumBuffer(this.stack[this.stack.length-1],i,5);if(z.lt(new Pe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(z))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP3:case V.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var G=Pe.fromScriptNumBuffer(t(-1),i,5);if(G.lt(new Pe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((G&re.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(G))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP1:case V.OP_NOP4:case V.OP_NOP5:case V.OP_NOP6:case V.OP_NOP7:case V.OP_NOP8:case V.OP_NOP9:case V.OP_NOP10:if(this.flags&re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case V.OP_IF:case V.OP_NOTIF:if(N=!1,n){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(o=t(-1),this.flags&re.SCRIPT_VERIFY_MINIMALIF){if(o.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(o.length===1&&o[0]!==1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}N=re.castToBool(o),H===V.OP_NOTIF&&(N=!N),this.stack.pop()}this.vfExec.push(N);break;case V.OP_ELSE:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case V.OP_ENDIF:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case V.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),N=re.castToBool(o),N)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1;break;case V.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case V.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case V.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case V.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case V.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3),s=t(-2);var B=t(-1);this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s)),this.stack.push(h.Buffer.from(B));break;case V.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-4),s=t(-3),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-6,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-4,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1),N=re.castToBool(o),N&&this.stack.push(h.Buffer.from(o));break;case V.OP_DEPTH:o=new Pe(this.stack.length).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case V.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-1)));break;case V.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case V.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-2)));break;case V.OP_PICK:case V.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),w=Pe.fromScriptNumBuffer(o,i),c=w.toNumber(),this.stack.pop(),c<0||c>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-c-1),H===V.OP_ROLL&&this.stack.splice(this.stack.length-c-1,1),this.stack.push(h.Buffer.from(o));break;case V.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-3),m=t(-2);var g=t(-1);this.stack[this.stack.length-3]=m,this.stack[this.stack.length-2]=g,this.stack[this.stack.length-1]=l;break;case V.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-2),m=t(-1),this.stack[this.stack.length-2]=m,this.stack[this.stack.length-1]=l;break;case V.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,h.Buffer.from(t(-1)));break;case V.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;w=new Pe(t(-1).length),this.stack.push(w.toScriptNumBuffer());break;case V.OP_AND:case V.OP_OR:case V.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length!==s.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(H){case V.OP_AND:for(let se=0;se<a.length;se++)a[se]&=s[se];break;case V.OP_OR:for(let se=0;se<a.length;se++)a[se]|=s[se];break;case V.OP_XOR:for(let se=0;se<a.length;se++)a[se]^=s[se];break;default:break}this.stack.pop();break;case V.OP_INVERT:this.stack.length<1&&(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION"),o=t(-1);for(let se=0;se<o.length;se++)o[se]=~o[se];break;case V.OP_LSHIFT:case V.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),a.length===0)this.stack.pop();else{if(E=new Pe(a),P=Pe.fromScriptNumBuffer(t(-1),i),c=P.toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop();let se;H===V.OP_LSHIFT&&(se=E.ushln(c)),H===V.OP_RSHIFT&&(se=E.ushrn(c));let ue=ure(h.Buffer.from(se.toArray().slice(a.length*-1)),a.length);this.stack.push(ue)}break;case V.OP_EQUAL:case V.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1);var O=a.toString("hex")===s.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(O?re.true:re.false),H===V.OP_EQUALVERIFY)if(O)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;break;case V.OP_1ADD:case V.OP_1SUB:case V.OP_NEGATE:case V.OP_ABS:case V.OP_NOT:case V.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(o=t(-1),w=Pe.fromScriptNumBuffer(o,i),H){case V.OP_1ADD:w=w.add(Pe.One);break;case V.OP_1SUB:w=w.sub(Pe.One);break;case V.OP_NEGATE:w=w.neg();break;case V.OP_ABS:w.cmp(Pe.Zero)<0&&(w=w.neg());break;case V.OP_NOT:w=new Pe((w.cmp(Pe.Zero)===0)+0);break;case V.OP_0NOTEQUAL:w=new Pe((w.cmp(Pe.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(w.toScriptNumBuffer());break;case V.OP_ADD:case V.OP_SUB:case V.OP_MUL:case V.OP_MOD:case V.OP_DIV:case V.OP_BOOLAND:case V.OP_BOOLOR:case V.OP_NUMEQUAL:case V.OP_NUMEQUALVERIFY:case V.OP_NUMNOTEQUAL:case V.OP_LESSTHAN:case V.OP_GREATERTHAN:case V.OP_LESSTHANOREQUAL:case V.OP_GREATERTHANOREQUAL:case V.OP_MIN:case V.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(E=Pe.fromScriptNumBuffer(t(-2),i,re.MAXIMUM_ELEMENT_SIZE),P=Pe.fromScriptNumBuffer(t(-1),i,re.MAXIMUM_ELEMENT_SIZE),w=new Pe(0),H){case V.OP_ADD:w=E.add(P);break;case V.OP_SUB:w=E.sub(P);break;case V.OP_MUL:w=E.mul(P);break;case V.OP_DIV:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.div(P);break;case V.OP_MOD:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.mod(P);break;case V.OP_BOOLAND:w=new Pe((E.cmp(Pe.Zero)!==0&&P.cmp(Pe.Zero)!==0)+0);break;case V.OP_BOOLOR:w=new Pe((E.cmp(Pe.Zero)!==0||P.cmp(Pe.Zero)!==0)+0);break;case V.OP_NUMEQUAL:w=new Pe((E.cmp(P)===0)+0);break;case V.OP_NUMEQUALVERIFY:w=new Pe((E.cmp(P)===0)+0);break;case V.OP_NUMNOTEQUAL:w=new Pe((E.cmp(P)!==0)+0);break;case V.OP_LESSTHAN:w=new Pe((E.cmp(P)<0)+0);break;case V.OP_GREATERTHAN:w=new Pe((E.cmp(P)>0)+0);break;case V.OP_LESSTHANOREQUAL:w=new Pe((E.cmp(P)<=0)+0);break;case V.OP_GREATERTHANOREQUAL:w=new Pe((E.cmp(P)>=0)+0);break;case V.OP_MIN:w=E.cmp(P)<0?E:P;break;case V.OP_MAX:w=E.cmp(P)>0?E:P;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(w.toScriptNumBuffer()),H===V.OP_NUMEQUALVERIFY)if(re.castToBool(t(-1)))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;break;case V.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;E=Pe.fromScriptNumBuffer(t(-3),i,re.MAXIMUM_ELEMENT_SIZE),P=Pe.fromScriptNumBuffer(t(-2),i,re.MAXIMUM_ELEMENT_SIZE);var y=Pe.fromScriptNumBuffer(t(-1),i,re.MAXIMUM_ELEMENT_SIZE);N=P.cmp(E)<=0&&E.cmp(y)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(N?re.true:re.false);break;case V.OP_RIPEMD160:case V.OP_SHA1:case V.OP_SHA256:case V.OP_HASH160:case V.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1);var f;H===V.OP_RIPEMD160?f=G0.ripemd160(o):H===V.OP_SHA1?f=G0.sha1(o):H===V.OP_SHA256?f=G0.sha256(o):H===V.OP_HASH160?f=G0.sha256ripemd160(o):H===V.OP_HASH256&&(f=G0.sha256sha256(o)),this.stack.pop(),this.stack.push(f);break;case V.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case V.OP_CHECKSIG:case V.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(M=t(-2),D=t(-1),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;L=new Z0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});var d=new Z0().add(M);L.findAndDelete(d);try{U=pf.fromTxFormat(M),K=S4.fromBuffer(D,!1),C=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{C=!1}if(!C&&this.flags&re.SCRIPT_VERIFY_NULLFAIL&&M.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(C?re.true:re.false),H===V.OP_CHECKSIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;break;case V.OP_CHECKMULTISIG:case V.OP_CHECKMULTISIGVERIFY:var _=1;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var x=Pe.fromScriptNumBuffer(t(-_),i).toNumber();if(x<0||x>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=x,this.nOpCount>re.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var b=++_;_+=x;var p=x+2;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var I=Pe.fromScriptNumBuffer(t(-_),i).toNumber();if(I<0||I>x)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var T=++_;if(_+=I,this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;L=new Z0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var S=0;S<I;S++)M=t(-T-S),L.findAndDelete(new Z0().add(M));for(C=!0;C&&I>0;){if(M=t(-T),D=t(-b),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;var R;try{U=pf.fromTxFormat(M),K=S4.fromBuffer(D,!1),R=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{R=!1}R&&(T++,I--),b++,x--,I>x&&(C=!1)}for(;_-- >1;){if(!C&&this.flags&re.SCRIPT_VERIFY_NULLFAIL&&!p&&t(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;p>0&&p--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&re.SCRIPT_VERIFY_NULLDUMMY&&t(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(C?re.true:re.false),H===V.OP_CHECKMULTISIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;break;case V.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length+s.length>re.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=h.Buffer.concat([a,s]),this.stack.pop();break;case V.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2);var Y=Pe.fromScriptNumBuffer(t(-1),i).toNumber();if(Y<0||Y>a.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var X=h.Buffer.from(a);this.stack[this.stack.length-2]=X.slice(0,Y),this.stack[this.stack.length-1]=X.slice(Y);break;case V.OP_LEFT:case V.OP_RIGHT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),c=Pe.fromScriptNumBuffer(t(-1),i).toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;c>a.length&&(c=a.length),this.stack.pop(),H===V.OP_LEFT?this.stack[this.stack.length-1]=h.Buffer.from(a).slice(0,c):this.stack[this.stack.length-1]=h.Buffer.from(a).slice(a.length-c);break;case V.OP_SUBSTR:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3);var ne=Pe.fromScriptNumBuffer(t(-1),i).toNumber(),ce=Pe.fromScriptNumBuffer(t(-2),i).toNumber();if(ce<0||ne<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;ce>a.length&&(ce=a.length),ce+ne>a.length&&(ne=a.length-ce),this.stack.pop(),this.stack.pop(),this.stack[this.stack.length-1]=h.Buffer.from(a).slice(ce,ce+ne);break;case V.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var pe=Pe.fromScriptNumBuffer(t(-1),i).toNumber();if(pe>re.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var q=t(-1);if(q=re._minimallyEncode(q),q.length>pe)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(q.length===pe){this.stack[this.stack.length-1]=q;break}var W=0;q.length>0&&(W=q[q.length-1]&128,q[q.length-1]&=127);var $=h.Buffer.alloc(pe);q.copy($,0);for(var ee=q.length-1;ee++<pe-2;)$[ee]=0;$[ee]=W,this.stack[this.stack.length-1]=$;break;case V.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-1),s=re._minimallyEncode(a),this.stack[this.stack.length-1]=s,!re._isMinimallyEncoded(s))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}});var bn=k((N6e,x4)=>{v();x4.exports=i4();x4.exports.Interpreter=o6()});var hf=k((D6e,FR)=>{"use strict";v();var E4=xt(),za=Bt(),fre=hn(),LR=tl(),wn=Ss(),qR=cr(),UR=pi(),O4=$n();function me(e,t,r){if(!(this instanceof me))return new me(e,t,r);if(E4.isArray(e)&&E4.isNumber(t))return me.createMultisig(e,t,r);if(e instanceof me)return e;if(za.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!wn.get(t))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==me.PayToPublicKeyHash&&r!==me.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||wn.get(t)||wn.defaultNetwork,i.type=i.type||r||me.PayToPublicKeyHash,UR.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}me.prototype._classifyArguments=function(e,t,r){if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===20)return me._transformHash(e);if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===21)return me._transformBuffer(e,t,r);if(e instanceof O4)return me._transformPublicKey(e);if(e instanceof W0)return me._transformScript(e,t);if(typeof e=="string")return me._transformString(e,t,r);if(E4.isObject(e))return me._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};me.PayToPublicKeyHash="pubkeyhash";me.PayToScriptHash="scripthash";me._transformHash=function(e){var t={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t};me._transformObject=function(e){return za.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),za.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?h.Buffer.from(e.hash,"hex"):e.hashBuffer,network:wn.get(e.network)||wn.defaultNetwork,type:e.type}};me._classifyFromVersion=function(e){var t={},r=wn.get(e[0],"pubkeyhash"),i=wn.get(e[0],"scripthash");return r?(t.network=r,t.type=me.PayToPublicKeyHash):i&&(t.network=i,t.type=me.PayToScriptHash),t};me._transformBuffer=function(e,t,r){var i={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==21)throw new TypeError("Address buffers must be exactly 21 bytes.");var n=wn.get(t),o=me._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n!==o.network)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=o.network,i.type=o.type,i};me._transformPublicKey=function(e){var t={};if(!(e instanceof O4))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=qR.sha256ripemd160(e.toBuffer()),t.type=me.PayToPublicKeyHash,t};me._transformScript=function(e,t){za.checkArgument(e instanceof W0,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new fre.Script.CantDeriveAddress(e);return r};me.createMultisig=function(e,t,r){return r=r||e[0].network||wn.defaultNetwork,me.payingTo(W0.buildMultisigOut(e,t),r)};me._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length<27)throw new Error("Invalid Address string provided");e=e.trim();var i=wn.get(t);if(t&&!i)throw new TypeError("Unknown network");var n=LR.decode(e);return me._transformBuffer(n,t,r)};me.fromPublicKey=function(e,t){var r=me._transformPublicKey(e);return t=t||wn.defaultNetwork,new me(r.hashBuffer,t,r.type)};me.fromPrivateKey=function(e,t){let r=O4.fromPrivateKey(e);return t=t||e.network||wn.defaultNetwork,me.fromPublicKey(r,t)};me.fromPublicKeyHash=function(e,t){var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToPublicKeyHash)};me.fromScriptHash=function(e,t){za.checkArgument(e,"hash parameter is required");var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToScriptHash)};me.payingTo=function(e,t){return za.checkArgument(e,"script is required"),za.checkArgument(e instanceof W0,"script must be instance of Script"),me.fromScriptHash(qR.sha256ripemd160(e.toBuffer()),t)};me.fromScript=function(e,t){za.checkArgument(e instanceof W0,"script must be a Script instance");var r=me._transformScript(e,t);return new me(r.hashBuffer,t,r.type)};me.fromBuffer=function(e,t,r){var i=me._transformBuffer(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromHex=function(e,t,r){return me.fromBuffer(h.Buffer.from(e,"hex"),t,r)};me.fromString=function(e,t,r){var i=me._transformString(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromObject=function(t){za.checkState(UR.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=h.Buffer.from(t.hash,"hex");return new me(r,t.network,t.type)};me.getValidationError=function(e,t,r){var i;try{new me(e,t,r)}catch(n){i=n}return i};me.isValid=function(e,t,r){return!me.getValidationError(e,t,r)};me.prototype.isPayToPublicKeyHash=function(){return this.type===me.PayToPublicKeyHash};me.prototype.isPayToScriptHash=function(){return this.type===me.PayToScriptHash};me.prototype.toBuffer=function(){var e=h.Buffer.from([this.network[this.type]]),t=h.Buffer.concat([e,this.hashBuffer]);return t};me.prototype.toHex=function(){return this.toBuffer().toString("hex")};me.prototype.toObject=me.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};me.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};me.prototype.toString=function(){return LR.encode(this.toBuffer())};FR.exports=me;var W0=bn()});var V0=k((q6e,VR)=>{"use strict";v();var l6=xt(),cre=hf(),HR=tl(),gf=fr(),jR=pi(),Ka=Ss(),zR=vn(),lre=$n(),hre=ds(),KR=Bt();function Me(e,t){if(!(this instanceof Me))return new Me(e,t);if(e instanceof Me)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new gf(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(zR.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return jR.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}Me.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?Ka.get(t):Ka.defaultNetwork};if(l6.isUndefined(e)||l6.isNull(e))r.bn=Me._getRandomBN();else if(e instanceof gf)r.bn=e;else if(e instanceof h.Buffer||e instanceof Uint8Array)r=Me._transformBuffer(e,t);else if(e.bn&&e.network)r=Me._transformObject(e);else if(!t&&Ka.get(e))r.bn=Me._getRandomBN(),r.network=Ka.get(e);else if(typeof e=="string")jR.isHexa(e)?r.bn=new gf(h.Buffer.from(e,"hex")):r=Me._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};Me._getRandomBN=function(){var e,t;do{var r=hre.getRandomBuffer(32);t=gf.fromBuffer(r),e=t.lt(zR.getN())}while(!e);return t};Me._transformBuffer=function(e,t){var r={};if(e.length===32)return Me._transformBNBuffer(e,t);if(r.network=Ka.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==Ka.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=gf.fromBuffer(e.slice(1,33)),r};Me._transformBNBuffer=function(e,t){var r={};return r.network=Ka.get(t)||Ka.defaultNetwork,r.bn=gf.fromBuffer(e),r.compressed=!1,r};Me._transformWIF=function(e,t){return Me._transformBuffer(HR.decode(e),t)};Me.fromBuffer=function(e,t){return new Me(e,t)};Me.fromHex=function(e,t){return Me.fromBuffer(h.Buffer.from(e,"hex"),t)};Me._transformObject=function(e){var t=new gf(e.bn,"hex"),r=Ka.get(e.network);return{bn:t,network:r,compressed:e.compressed}};Me.fromString=Me.fromWIF=function(e){return KR.checkArgument(l6.isString(e),"First argument is expected to be a string."),new Me(e)};Me.fromObject=Me.fromJSON=function(e){return KR.checkArgument(l6.isObject(e),"First argument is expected to be an object."),new Me(e)};Me.fromRandom=function(e){var t=Me._getRandomBN();return new Me(t,e)};Me.getValidationError=function(e,t){var r;try{new Me(e,t)}catch(i){r=i}return r};Me.isValid=function(e,t){return e?!Me.getValidationError(e,t):!1};Me.prototype.toString=function(){return this.toWIF()};Me.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),h.Buffer.from([1])]):r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),HR.encode(r)};Me.prototype.toBigNumber=function(){return this.bn};Me.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};Me.prototype.toHex=function(){return this.toBuffer().toString("hex")};Me.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=lre.fromPrivateKey(this)),this._pubkey};Me.prototype.toAddress=function(e){var t=this.toPublicKey();return cre.fromPublicKey(t,e||this.network)};Me.prototype.toObject=Me.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};Me.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toHex()+", network: "+this.network+e+">"};VR.exports=Me});var $n=k((F6e,ZR)=>{"use strict";v();var ll=fr(),hl=vn(),dre=cr(),pre=pi(),GR=Ss(),I4=xt(),vf=Bt();function Se(e,t){if(!(this instanceof Se))return new Se(e,t);if(vf.checkArgument(e,"First argument is required, please include public key data."),e instanceof Se)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),pre.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||GR.defaultNetwork}),this}Se.prototype._classifyArgs=function(e,t){var r={compressed:I4.isUndefined(t.compressed)||t.compressed};if(e instanceof hl)r.point=e;else if(e.x&&e.y)r=Se._transformObject(e);else if(typeof e=="string")r=Se._transformDER(h.Buffer.from(e,"hex"));else if(Se._isBuffer(e))r=Se._transformDER(e);else if(Se._isPrivateKey(e))r=Se._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=I4.isUndefined(t.network)?void 0:GR.get(t.network)),r};Se._isPrivateKey=function(e){var t=V0();return e instanceof t};Se._isBuffer=function(e){return e instanceof h.Buffer||e instanceof Uint8Array};Se._transformPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=hl.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};Se._transformDER=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r={};t=I4.isUndefined(t)?!0:t;var i,n,o,a;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),a=e.slice(33,65),o.length!==32||a.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new ll(o),n=new ll(a),r.point=new hl(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new ll(o),r=Se._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new ll(o),r=Se._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};Se._transformX=function(e,t){vf.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=hl.fromX(e,t),r};Se._transformObject=function(e){var t=new ll(e.x,"hex"),r=new ll(e.y,"hex"),i=new hl(t,r);return new Se(i,{compressed:e.compressed})};Se.fromPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t=Se._transformPrivateKey(e);return new Se(t.point,{compressed:t.compressed,network:t.network})};Se.fromDER=Se.fromBuffer=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r=Se._transformDER(e,t);return new Se(r.point,{compressed:r.compressed})};Se.fromPoint=function(e,t){return vf.checkArgument(e instanceof hl,"First argument must be an instance of Point."),new Se(e,{compressed:t})};Se.fromHex=Se.fromString=function(e,t){var r=h.Buffer.from(e,t||"hex"),i=Se._transformDER(r);return new Se(i.point,{compressed:i.compressed})};Se.fromX=function(e,t){var r=Se._transformX(e,t);return new Se(r.point,{compressed:r.compressed})};Se.getValidationError=function(e){var t;try{new Se(e)}catch(r){t=r}return t};Se.isValid=function(e){return!Se.getValidationError(e)};Se.prototype.toObject=Se.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};Se.prototype.toBuffer=Se.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=h.Buffer.from([3]):n=h.Buffer.from([2]),h.Buffer.concat([n,r])}else return n=h.Buffer.from([4]),h.Buffer.concat([n,r,i])};Se.prototype._getID=function(){return dre.sha256ripemd160(this.toBuffer())};Se.prototype.toAddress=function(e){var t=hf();return t.fromPublicKey(this,e||this.network)};Se.prototype.toString=Se.prototype.toHex=function(){return this.toDER().toString("hex")};Se.prototype.inspect=function(){return"<PublicKey: "+this.toHex()+(this.compressed?"":", uncompressed")+">"};ZR.exports=Se});var a6=k((j6e,WR)=>{"use strict";v();var ji=fr(),Do=vn(),gre=Vr(),vre=$n(),mre=ds(),Rs=cr(),yre=xt(),A4=Bt(),zt=function e(t){if(!(this instanceof e))return new e(t);t&&this.set(t)};Object.defineProperty(zt.prototype,"k",{get:function(){return this._k},set:function(e){this._k=e,this._kFresh=!0},enumerable:!0,configurable:!0});zt.prototype.set=function(e){if(this.hashbuf=e.hashbuf||this.hashbuf,this.endian=e.endian||this.endian,this.privkey=e.privkey||this.privkey,this.pubkey=e.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),e.sig)if(h.Buffer.isBuffer(e.sig)){var t=Vr();this.sig=t.fromDER(e.sig)}else this.sig=e.sig;else this.sig=this.sig;return e.k&&(this.k=e.k),this.verified=e.verified||this.verified,this};zt.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()};zt.prototype.calci=function(){for(var e=0;e<4;e++){this.sig.i=e;var t;try{t=this.toPublicKey()}catch(r){console.error(r);continue}if(t.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")};zt.fromString=function(e){var t=JSON.parse(e);return new zt(t)};zt.prototype.randomK=function(){var e=Do.getN(),t;do t=ji.fromBuffer(mre.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(ji.Zero)));return this.k=t,this};zt.prototype.deterministicK=function(e){yre.isUndefined(e)&&(e=0);var t=h.Buffer.alloc(32);t.fill(1);var r=h.Buffer.alloc(32);r.fill(0);var i=this.privkey.bn.toBuffer({size:32}),n=this.endian==="little"?h.Buffer.from(this.hashbuf).reverse():this.hashbuf;r=Rs.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0]),i,n]),r),t=Rs.sha256hmac(t,r),r=Rs.sha256hmac(h.Buffer.concat([t,h.Buffer.from([1]),i,n]),r),t=Rs.sha256hmac(t,r),t=Rs.sha256hmac(t,r);for(var o=ji.fromBuffer(t),a=Do.getN(),s=0;s<e||!(o.lt(a)&&o.gt(ji.Zero));s++)r=Rs.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0])]),r),t=Rs.sha256hmac(t,r),t=Rs.sha256hmac(t,r),o=ji.fromBuffer(t);return this.k=o,this};zt.prototype.toPublicKey=function(){var e=this.sig.i;A4.checkArgument(e===0||e===1||e===2||e===3,new Error("i must be equal to 0, 1, 2, or 3"));var t=ji.fromBuffer(this.hashbuf),r=this.sig.r,i=this.sig.s,n=e&1,o=e>>1,a=Do.getN(),s=Do.getG(),u=o?r.add(a):r,c=Do.fromX(n,u),l=c.mul(a);if(!l.isInfinity())throw new Error("nR is not a valid curve point");var m=t.neg().umod(a),w=r.invm(a),E=c.mul(i).add(s.mul(m)).mul(w),P=vre.fromPoint(E,this.sig.compressed);return P};zt.prototype.sigError=function(){if(!h.Buffer.isBuffer(this.hashbuf)||this.hashbuf.length!==32)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s,r=Do.getN();try{if(e.lte(ji.Zero)||t.lte(ji.Zero)||e.gte(r)||t.gte(r))return"r and s not in range";var i=ji.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),n=t.invm(r),o=n.mul(i).umod(r),a=n.mul(e).umod(r),s=Do.getG().mulAdd(o,this.pubkey.point,a);return s.isInfinity()?"p is infinity":s.getX().umod(r).cmp(e)!==0?"Invalid signature":!1}catch(u){return"Signature security validation failed: "+u.message}};zt.toLowS=function(e){return e.gt(ji.fromBuffer(h.Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=Do.getN().sub(e)),e};zt.prototype._findSignature=function(e,t){var r=Do.getN(),i=Do.getG(),n=0,o,a,s,u;do(!this.k||!this._kFresh||n>0)&&this.deterministicK(n),n++,o=this.k,a=i.mul(o),s=a.x.umod(r),u=o.invm(r).mul(t.add(e.mul(s))).umod(r);while(s.cmp(ji.Zero)<=0||u.cmp(ji.Zero)<=0);return this._kFresh=!1,u=zt.toLowS(u),{s:u,r:s}};zt.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;A4.checkState(e&&t&&r,new Error("invalid parameters")),A4.checkState(h.Buffer.isBuffer(e)&&e.length===32,new Error("hashbuf must be a 32 byte buffer"));var i=ji.fromBuffer(e,this.endian?{endian:this.endian}:void 0),n=this._findSignature(r,i);return n.compressed=this.pubkey.compressed,this.sig=new gre(n),this};zt.prototype.signRandomK=function(){return this.randomK(),this.sign()};zt.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)};zt.prototype.verify=function(){return this.verified=!this.sigError(),this.verified};zt.prototype.verifyBool=function(){return this.verify()===!0};zt.sign=function(e,t,r){return zt().set({hashbuf:e,endian:r,privkey:t}).sign().sig};zt.signWithCalcI=function(e,t,r){return zt().set({hashbuf:e,endian:r,privkey:t}).sign().calci().sig};zt.signRandomK=function(e,t,r){return zt().set({hashbuf:e,endian:r,privkey:t}).signRandomK().sig};zt.verify=function(e,t,r,i){return zt().set({hashbuf:e,endian:i,sig:t,pubkey:r}).verify()};WR.exports=zt});var $R=k((P4,YR)=>{v();(function(e,t){"use strict";typeof define=="function"&&define.amd?define([],function(){return e.secrets=t()}):typeof P4=="object"?YR.exports=t(_r()):e.secrets=t(e.crypto)})(P4,function(e){"use strict";var t,r,i,n,o;function a(){t={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},r={},i=new Array(1024).join("0"),n=!0,o=["nodeCryptoRandomBytes","browserCryptoGetRandomValues","testRandom"]}function s(){return!!(r&&r.rng&&typeof r.rng=="function")}function u(N,C){var F;if(C===0||C===1)return N;if(C&&C>1024)throw new Error("Padding must be multiples of no larger than 1024 bits.");return C=C||r.bits,N&&(F=N.length%C),F?(i+N).slice(-(C-F+N.length)):N}function c(N){var C="",F,H;for(H=N.length-1;H>=0;H--){if(F=parseInt(N[H],16),isNaN(F))throw new Error("Invalid hex character.");C=u(F.toString(2),4)+C}return C}function l(N){var C="",F,H;for(N=u(N,4),H=N.length;H>=4;H-=4){if(F=parseInt(N.slice(H-4,H),2),isNaN(F))throw new Error("Invalid binary character.");C=F.toString(16)+C}return C}function m(){return!!(e&&typeof e=="object"&&(typeof e.getRandomValues=="function"||typeof e.getRandomValues=="object")&&(typeof Uint32Array=="function"||typeof Uint32Array=="object"))}function w(){return typeof e=="object"&&typeof e.randomBytes=="function"}function E(N){function C(G,B,g,O){var y=0,f,d="",_;for(B&&(f=B.length-1);y<f||d.length<G;)_=Math.abs(parseInt(B[y],g)),d=d+u(_.toString(2),O),y++;return d=d.substr(-G),(d.match(/0/g)||[]).length===d.length?null:d}function F(G){var B,g,O,y,f=null;for(O=16,y=4,g=Math.ceil(G/8);f===null;)B=e.randomBytes(g),f=C(G,B.toString("hex"),O,y);return f}function H(G){var B,g,O,y=null;for(g=10,O=32,B=Math.ceil(G/32);y===null;)y=C(G,e.getRandomValues(new Uint32Array(B)),g,O);return y}function z(G){var B,g,O,y,f,d=null;y=10,f=32,g=Math.ceil(G/32),O=123456789,B=new Uint32Array(g);for(var _=0;_<B.length;_++)B[_]=O;for(;d===null;)d=C(G,B,y,f);return d}if(N&&N==="testRandom")return r.typeCSPRNG=N,z;if(N&&N==="nodeCryptoRandomBytes")return r.typeCSPRNG=N,F;if(N&&N==="browserCryptoGetRandomValues")return r.typeCSPRNG=N,H;if(w())return r.typeCSPRNG="nodeCryptoRandomBytes",F;if(m())return r.typeCSPRNG="browserCryptoGetRandomValues",H}function P(N,C){var F=[],H;for(C&&(N=u(N,C)),H=N.length;H>r.bits;H-=r.bits)F.push(parseInt(N.slice(H-r.bits,H),2));return F.push(parseInt(N.slice(0,H),2)),F}function M(N,C){var F=r.logs[N],H=0,z;for(z=C.length-1;z>=0;z--)H!==0?H=r.exps[(F+r.logs[H])%r.maxShares]^C[z]:H=C[z];return H}function D(N,C,F){var H=0,z,G,B,g;for(B=0,z=C.length;B<z;B++)if(F[B]){for(G=r.logs[F[B]],g=0;g<z;g++)if(B!==g){if(N===C[g]){G=-1;break}G=(G+r.logs[N^C[g]]-r.logs[C[B]^C[g]]+r.maxShares)%r.maxShares}H=G===-1?H:H^r.exps[G]}return H}function L(N,C,F){var H=[],z=[N],G,B;for(G=1;G<F;G++)z[G]=parseInt(r.rng(r.bits),2);for(G=1,B=C+1;G<B;G++)H[G-1]={x:G,y:M(G,z)};return H}function U(N,C,F){var H,z,G,B,g;if(C=parseInt(C,r.radix),N=parseInt(N,10)||r.bits,H=N.toString(36).toUpperCase(),G=Math.pow(2,N)-1,B=G.toString(r.radix).length,z=u(C.toString(r.radix),B),typeof C!="number"||C%1!==0||C<1||C>G)throw new Error("Share id must be an integer between 1 and "+G+", inclusive.");return g=H+z+F,g}var K={init:function(N,C){var F=[],H=[],z=1,G,B;if(a(),N&&(typeof N!="number"||N%1!==0||N<t.minBits||N>t.maxBits))throw new Error("Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(C&&o.indexOf(C)===-1)throw new Error("Invalid RNG type argument : '"+C+"'");for(r.radix=t.radix,r.bits=N||t.bits,r.size=Math.pow(2,r.bits),r.maxShares=r.size-1,G=t.primitivePolynomials[r.bits],B=0;B<r.size;B++)H[B]=z,F[z]=B,z=z<<1,z>=r.size&&(z=z^G,z=z&r.maxShares);if(r.logs=F,r.exps=H,C&&this.setRNG(C),s()||this.setRNG(),!s()||!r.bits||!r.size||!r.maxShares||!r.logs||!r.exps||r.logs.length!==r.size||r.exps.length!==r.size)throw new Error("Initialization failed.")},combine:function(N,C){var F,H,z,G,B="",g,O,y,f=[],d=[];for(C=C||0,F=0,z=N.length;F<z;F++){if(O=this.extractShareComponents(N[F]),g===void 0)g=O.bits;else if(O.bits!==g)throw new Error("Mismatched shares: Different bit settings.");if(r.bits!==g&&this.init(g),f.indexOf(O.id)===-1)for(f.push(O.id),y=P(c(O.data)),H=0,G=y.length;H<G;H++)d[H]=d[H]||[],d[H][f.length-1]=y[H]}for(F=0,z=d.length;F<z;F++)B=u(D(C,f,d[F]).toString(2))+B;return l(C>=1?B:B.slice(B.indexOf("1")+1))},getConfig:function(){var N={};return N.radix=r.radix,N.bits=r.bits,N.maxShares=r.maxShares,N.hasCSPRNG=s(),N.typeCSPRNG=r.typeCSPRNG,N},extractShareComponents:function(N){var C,F,H,z,G={},B,g;if(C=parseInt(N.substr(0,1),36),C&&(typeof C!="number"||C%1!==0||C<t.minBits||C>t.maxBits))throw new Error("Invalid share : Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(z=Math.pow(2,C)-1,H=(Math.pow(2,C)-1).toString(r.radix).length,B="^([a-kA-K3-9]{1})([a-fA-F0-9]{"+H+"})([a-fA-F0-9]+)$",g=new RegExp(B).exec(N),g&&(F=parseInt(g[2],r.radix)),typeof F!="number"||F%1!==0||F<1||F>z)throw new Error("Invalid share : Share id must be an integer between 1 and "+r.maxShares+", inclusive.");if(g&&g[3])return G.bits=C,G.id=F,G.data=g[3],G;throw new Error("The share data provided is invalid : "+N)},setRNG:function(N){var C="Random number generator is invalid ",F=" Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.";if(N&&typeof N=="string"&&o.indexOf(N)===-1)throw new Error("Invalid RNG type argument : '"+N+"'");if(N||(N=E()),N&&typeof N=="string"&&(N=E(N)),n){if(N&&typeof N!="function")throw new Error(C+"(Not a function)."+F);if(N&&typeof N(r.bits)!="string")throw new Error(C+"(Output is not a string)."+F);if(N&&!parseInt(N(r.bits),2))throw new Error(C+"(Binary string output not parseable to an Integer)."+F);if(N&&N(r.bits).length>r.bits)throw new Error(C+"(Output length is greater than config.bits)."+F);if(N&&N(r.bits).length<r.bits)throw new Error(C+"(Output length is less than config.bits)."+F)}return r.rng=N,!0},str2hex:function(N,C){var F,H,z="",G,B,g,O;if(typeof N!="string")throw new Error("Input must be a character string.");if(C||(C=t.bytesPerChar),typeof C!="number"||C<1||C>t.maxBytesPerChar||C%1!==0)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,H=Math.pow(16,F)-1,g=0,O=N.length;g<O;g++){if(B=N[g].charCodeAt(),isNaN(B))throw new Error("Invalid character: "+N[g]);if(B>H)throw G=Math.ceil(Math.log(B+1)/Math.log(256)),new Error("Invalid character code ("+B+"). Maximum allowable is 256^bytes-1 ("+H+"). To convert this character, use at least "+G+" bytes.");z=u(B.toString(16),F)+z}return z},hex2str:function(N,C){var F,H="",z,G;if(typeof N!="string")throw new Error("Input must be a hexadecimal string.");if(C=C||t.bytesPerChar,typeof C!="number"||C%1!==0||C<1||C>t.maxBytesPerChar)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,N=u(N,F),z=0,G=N.length;z<G;z+=F)H=String.fromCharCode(parseInt(N.slice(z,z+F),16))+H;return H},random:function(N){if(typeof N!="number"||N%1!==0||N<2||N>65536)throw new Error("Number of bits must be an Integer between 1 and 65536.");return l(r.rng(N))},share:function(N,C,F,H){var z,G,B=new Array(C),g=new Array(C),O,y,f;if(H=H||128,typeof N!="string")throw new Error("Secret must be a string.");if(typeof C!="number"||C%1!==0||C<2)throw new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(C>r.maxShares)throw z=Math.ceil(Math.log(C+1)/Math.LN2),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To create "+C+" shares, use at least "+z+" bits.");if(typeof F!="number"||F%1!==0||F<2)throw new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(F>r.maxShares)throw z=Math.ceil(Math.log(F+1)/Math.LN2),new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To use a threshold of "+F+", use at least "+z+" bits.");if(F>C)throw new Error("Threshold number of shares was "+F+" but must be less than or equal to the "+C+" shares specified as the total to generate.");if(typeof H!="number"||H%1!==0||H<0||H>1024)throw new Error("Zero-pad length must be an integer between 0 and 1024 inclusive.");for(N="1"+c(N),N=P(N,H),O=0,f=N.length;O<f;O++)for(G=L(N[O],C,F),y=0;y<C;y++)B[y]=B[y]||G[y].x.toString(r.radix),g[y]=u(G[y].y.toString(2))+(g[y]||"");for(O=0;O<C;O++)B[O]=U(r.bits,B[O],l(g[O]));return B},newShare:function(N,C){var F,H;if(N&&typeof N=="string"&&(N=parseInt(N,r.radix)),H=N.toString(r.radix),N&&H&&C&&C[0])return F=this.extractShareComponents(C[0]),U(F.bits,H,this.combine(C,N));throw new Error("Invalid 'id' or 'shares' Array argument to newShare().")},_reset:a,_padLeft:u,_hex2bin:c,_bin2hex:l,_hasCryptoGetRandomValues:m,_hasCryptoRandomBytes:w,_getRNG:E,_isSetRNG:s,_splitNumStringToIntArray:P,_horner:M,_lagrange:D,_getShares:L,_constructPublicShareString:U};return K.init(),K})});var k4=k((V6e,eB)=>{"use strict";v();var gi=fr(),XR=ds(),JR=cr(),h6=null;function T4(){if(h6)return h6;var e=$R();return e.setRNG(function(t){for(var r=64,i=0;i<r;i++){for(var n=XR.getRandomBuffer(Math.ceil(t/8)),o="",a=0;a<n.length;a++)o+=("00000000"+n[a].toString(2)).slice(-8);if(o=o.slice(0,t),/1/.test(o))return o}throw new Error("shamir: CSPRNG returned all-zero draws "+r+" times in a row \u2014 refusing to hang on a degenerate/stubbed random source")}),h6=e,h6}var d6="ff",QR=2;function Or(e){return this instanceof Or?(this.options=e||{},this):new Or(e)}Or.split=function(e,t,r,i){if(i=i||{},e==null)throw new Error("Secret is required");if(t<2)throw new Error("Threshold must be at least 2");if(r<t)throw new Error("Number of shares must be at least threshold");if(t>255||r>255)throw new Error("Threshold and shares must be <= 255");for(var n=h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8"),o=d6+n.toString("hex"),a=T4().share(o,r,t),s=XR.getRandomBuffer(8).toString("hex"),u=i.checksum===!0,c=u?JR.sha256(n).slice(0,4).toString("hex"):null,l=[],m=0;m<a.length;m++)l.push({v:QR,id:m+1,threshold:t,shares:r,length:n.length,splitId:s,share:a[m],checksum:c});return l};Or.combine=function(e){if(!e||e.length===0)throw new Error("Shares array is required");if(e[0]&&Array.isArray(e[0].bytes)&&e[0].share===void 0)return Or._combineLegacy(e);var t=e[0].threshold,r=e[0].splitId;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var i=[],n=0;n<e.length;n++){var o=e[n];if(!o||typeof o.share!="string")throw new Error("Invalid share at index "+n);if(r!==void 0&&o.splitId!==r)throw new Error("Shares are from different splits (splitId mismatch)");if(o.threshold!==t)throw new Error("Shares have inconsistent threshold");i.push(o.share)}var a=T4().combine(i);if(a.slice(0,d6.length)!==d6)throw new Error("Reconstruction failed: invalid or insufficient shares");var s=h.Buffer.from(a.slice(d6.length),"hex"),u=e[0].checksum;if(u){var c=JR.sha256(s).slice(0,4).toString("hex");if(c!==u)throw new Error("Integrity check failed: shares are inconsistent or tampered")}return s};Or.verifyShare=function(e){try{return!e||typeof e!="object"?!1:Array.isArray(e.bytes)&&e.share===void 0?Or._verifyLegacyShare(e):e.v!==QR||typeof e.share!="string"||!/^[0-9a-fA-F]+$/.test(e.share)||typeof e.threshold!="number"||typeof e.shares!="number"||e.threshold<2||e.shares<e.threshold||e.shares>255||e.id<1||e.id>e.shares||e.checksum!==null&&e.checksum!==void 0&&!/^[0-9a-fA-F]{8}$/.test(e.checksum)?!1:(T4().extractShareComponents(e.share),!0)}catch{return!1}};Or.generateTestVectors=function(){var e="Hello, Bitcoin SV!",t=3,r=5,i=Or.split(e,t,r),n=Or.combine(i.slice(0,t));return{secret:e,threshold:t,totalShares:r,shares:i,reconstructed:n.toString("utf8"),valid:n.toString("utf8")===e}};var Bs=new gi(2147483647);Or._combineLegacy=function(e){var t=e[0].threshold,r=e[0].shares,i=e[0].length;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var n=0;n<e.length;n++){if(e[n].threshold!==t||e[n].shares!==r)throw new Error("Shares have inconsistent parameters");if(e[n].length!==i)throw new Error("Shares have different secret lengths")}for(var o=[],a=0;a<i;a++){for(var s=[],u=0;u<Math.min(e.length,t);u++)s.push(e[u].bytes[a]);o.push(Or._combineByteLegacy(s))}return h.Buffer.from(o)};Or._combineByteLegacy=function(e){for(var t=new gi(0),r=0;r<e.length;r++){for(var i=new gi(e[r].x),n=new gi(e[r].y,16),o=new gi(1),a=new gi(1),s=0;s<e.length;s++)if(r!==s){var u=new gi(e[s].x),c=new gi(0).sub(u);c.lt(new gi(0))&&(c=c.add(Bs)),o=o.mul(c).mod(Bs);var l=i.sub(u);l.lt(new gi(0))&&(l=l.add(Bs)),a=a.mul(l).mod(Bs)}var m=Or._modInverseLegacy(a,Bs),w=o.mul(m).mod(Bs);t=t.add(n.mul(w)).mod(Bs)}return t.mod(Bs).mod(new gi(256)).toNumber()};Or._modInverseLegacy=function(e,t){e.lt(new gi(0))&&(e=e.mod(t).add(t));var r=Or._extendedGCDLegacy(e,t);if(!r.gcd.eq(new gi(1)))throw new Error("Modular inverse does not exist");return r.x.mod(t).add(t).mod(t)};Or._extendedGCDLegacy=function(e,t){if(e.eq(new gi(0)))return{gcd:t,x:new gi(0),y:new gi(1)};var r=Or._extendedGCDLegacy(t.mod(e),e);return{gcd:r.gcd,x:r.y.sub(t.div(e).mul(r.x)),y:r.x}};Or._verifyLegacyShare=function(e){if(!e.id||!e.threshold||!e.shares||!e.bytes||typeof e.length!="number"||e.threshold<2||e.shares<e.threshold||!Array.isArray(e.bytes)||e.bytes.length!==e.length)return!1;for(var t=0;t<e.bytes.length;t++){var r=e.bytes[t];if(!r||!r.x||!r.y||r.x<1||r.x>e.shares||!/^[0-9a-fA-F]+$/.test(r.y))return!1}return!0};eB.exports=Or});var g6=k((Z6e,tB)=>{"use strict";v();var Lo=fr(),bre=vn(),_re=a6(),Y0=bre.getN(),p6=Y0.shrn(1);function wre(e,t,r){if(!h.Buffer.isBuffer(e)||e.length!==32)throw new Error("Invalid message hash: must be 32-byte buffer");if(!t)return!1;let i=t;if(h.Buffer.isBuffer(t))try{i=Vr().fromDER(t)}catch{return!1}if(!i||!i.r||!i.s)return!1;let n=Lo.isBN(i.r)?i.r:new Lo(i.r),o=Lo.isBN(i.s)?i.s:new Lo(i.s);if(n.isZero()||o.isZero()||n.gte(Y0)||o.gte(Y0)||o.gt(p6))return!1;let a=Vr(),s=new a({r:n,s:o});return _re.verify(e,s,r)}function Sre(e){if(!e)return!1;let t=e;if(h.Buffer.isBuffer(e))try{t=Vr().fromDER(e)}catch{return!1}return!t||!t.s?!1:(Lo.isBN(t.s)?t.s:new Lo(t.s)).lte(p6)}function xre(e){if(!e||!e.r||!e.s)throw new Error("Invalid signature object");let t=Lo.isBN(e.r)?e.r:new Lo(e.r),r=Lo.isBN(e.s)?e.s:new Lo(e.s),i=r;return r.gt(p6)&&(i=Y0.sub(r)),{r:t,s:i}}tB.exports={smartVerify:wre,isCanonical:Sre,canonicalize:xre,constants:{n:Y0,nh:p6}}});var v6=k((Y6e,nB)=>{"use strict";v();var Ere=fr(),{secp256k1:dl}=(g0(),lo(p0)),rB=dl.Point,Ore=rB.Fn.ORDER;function R4(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new Ere(t,16)}function B4(e){return h.Buffer.isBuffer(e)?Uint8Array.from(e):e instanceof Uint8Array?e:Uint8Array.from(h.Buffer.from(e,"hex"))}function M4(e){this._p=e}M4.prototype.eq=function(e){var t=e&&e._p?e._p:e;return this._p.equals(t)};var iB={curve:{n:R4(Ore)},keyFromPrivate:function(e,t){var r;h.Buffer.isBuffer(e)?r=e:e instanceof Uint8Array?r=h.Buffer.from(e):r=h.Buffer.from(e,t||"hex");var i=Uint8Array.from(r);return{_priv:i,getPublic:function(){return new M4(rB.fromBytes(dl.getPublicKey(i,!0)))}}},sign:function(e,t){var r=dl.sign(B4(e),t._priv,{lowS:!0,prehash:!1,format:"recovered"}),i=r[0],n=R4(BigInt("0x"+h.Buffer.from(r.subarray(1,33)).toString("hex"))),o=R4(BigInt("0x"+h.Buffer.from(r.subarray(33,65)).toString("hex")));return{r:n,s:o,recoveryParam:i}},verify:function(e,t,r){try{if(!t||typeof t!="object")return!1;var i=t.r,n=t.s;if(!i||!n||typeof i.cmp!="function"||typeof n.cmp!="function"||i.isZero()||n.isZero())return!1;var o=iB.curve.n;if(i.cmp(o)>=0||n.cmp(o)>=0)return!1;var a=h.Buffer.concat([i.toBuffer({size:32}),n.toBuffer({size:32})]),s=r._priv?dl.getPublicKey(r._priv,!0):r._p?r._p.toBytes(!0):r;return dl.verify(Uint8Array.from(a),B4(e),Uint8Array.from(s),{lowS:!1,prehash:!1})}catch{return!1}},recoverPubKey:function(e,t,r){var i=h.Buffer.concat([t.r.toBuffer({size:32}),t.s.toBuffer({size:32})]),n=dl.Signature.fromBytes(Uint8Array.from(i),"compact").addRecoveryBit(r);return new M4(n.recoverPublicKey(B4(e)))}};nB.exports=iB});var X0=k((X6e,sB)=>{"use strict";v();var m6=xt(),$0=fr(),y6=Da(),Ire=Wn(),Are=cr(),oB=Bt(),Pre=486604799,gt=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&oB.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};gt._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=gt._fromBufferReader(y6(t));else if(m6.isObject(t))r=gt._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};gt._fromObject=function(t){oB.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;m6.isString(t.prevHash)&&(r=h.Buffer.from(t.prevHash,"hex").reverse()),m6.isString(t.merkleRoot)&&(i=h.Buffer.from(t.merkleRoot,"hex").reverse());var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};gt.fromObject=function(t){var r=gt._fromObject(t);return new gt(r)};gt.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=y6(t);r.pos=gt.Constants.START_OF_HEADER;var i=gt._fromBufferReader(r);return new gt(i)};gt.fromBuffer=function(t){var r=gt._fromBufferReader(y6(t));return new gt(r)};gt.fromString=function(t){var r=h.Buffer.from(t,"hex");return gt.fromBuffer(r)};gt._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};gt.fromBufferReader=function(t){var r=gt._fromBufferReader(t);return new gt(r)};gt.prototype.toObject=gt.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:h.Buffer.from(this.prevHash).reverse().toString("hex"),merkleRoot:h.Buffer.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};gt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};gt.prototype.toString=function(){return this.toBuffer().toString("hex")};gt.prototype.toBufferWriter=function(t){return t||(t=new Ire),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};gt.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new $0(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new $0(2));return r};gt.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(Pre).mul(new $0(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};gt.prototype._getHash=function(){var t=this.toBuffer();return Are.sha256sha256(t)};var aB={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=y6(this._getHash()).readReverse().toString("hex")),this._id},set:m6.noop};Object.defineProperty(gt.prototype,"id",aB);Object.defineProperty(gt.prototype,"hash",aB);gt.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+gt.Constants.MAX_TIME_OFFSET)};gt.prototype.validProofOfWork=function(){var t=new $0(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};gt.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};gt.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new $0("10000000000000000000000000000000000000000000000000000000000000000","hex")};sB.exports=gt});var dB=k((Q6e,hB)=>{"use strict";v();var C4=xt(),fB=X0(),uB=fr(),D4=Da(),Tre=Wn(),kre=cr(),N4=ks(),cB=Bt();function at(e){return this instanceof at?(C4.extend(this,at._from(e)),this):new at(e)}at.MAX_BLOCK_SIZE=128e6;at._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=at._fromBufferReader(D4(t));else if(C4.isObject(t))r=at._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};at._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof N4?r.push(n):r.push(N4().fromObject(n))});var i={header:fB.fromObject(t.header),transactions:r};return i};at.fromObject=function(t){var r=at._fromObject(t);return new at(r)};at._fromBufferReader=function(t){var r={};cB.checkState(!t.finished(),"No block data received"),r.header=fB.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(N4().fromBufferReader(t));return r};at.fromBufferReader=function(t){cB.checkArgument(t,"br is required");var r=at._fromBufferReader(t);return new at(r)};at.fromBuffer=function(t){return at.fromBufferReader(new D4(t))};at.fromString=function(t){var r=h.Buffer.from(t,"hex");return at.fromBuffer(r)};at.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=D4(t);r.pos=at.Values.START_OF_BLOCK;var i=at._fromBufferReader(r);return new at(i)};at.prototype.toObject=at.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};at.prototype.toBuffer=function(){return this.toBufferWriter().concat()};at.prototype.toString=function(){return this.toBuffer().toString("hex")};at.prototype.toBufferWriter=function(t){t||(t=new Tre),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};at.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[at.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};at.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),a=h.Buffer.concat([t[r+n],t[r+o]]);t.push(kre.sha256sha256(a))}r+=i}return t};at.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};at.prototype.validMerkleRoot=function(){var t=new uB(this.header.merkleRoot.toString("hex"),"hex"),r=new uB(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};at.prototype._getHash=function(){return this.header._getHash()};var lB={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:C4.noop};Object.defineProperty(at.prototype,"id",lB);Object.defineProperty(at.prototype,"hash",lB);at.prototype.inspect=function(){return"<Block "+this.id+">"};at.Values={START_OF_BLOCK:8,NULL_HASH:h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};hB.exports=at});var U4=k((t5e,vB)=>{"use strict";v();var mf=xt(),q4=X0(),gB=Da(),Rre=Wn(),Bre=cr(),pB=ks(),L4=hn(),yf=Bt();function nr(e){if(!(this instanceof nr))return new nr(e);var t={};if(h.Buffer.isBuffer(e))t=nr._fromBufferReader(gB(e));else if(mf.isObject(e)){var r;e.header instanceof q4?r=e.header:r=q4.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return mf.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}nr.fromBuffer=function(t){return nr.fromBufferReader(gB(t))};nr.fromBufferReader=function(t){return new nr(nr._fromBufferReader(t))};nr.prototype.toBuffer=function(){return this.toBufferWriter().concat()};nr.prototype.toBufferWriter=function(t){t||(t=new Rre),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(h.Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};nr.prototype.toObject=nr.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};nr.prototype.validMerkleTree=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:i.equals(this.header.merkleRoot)};nr.prototype.filterdTxsHash=function(){throw new Error("filterdTxsHash has been deprecated. use filteredTxsHash.")};nr.prototype.filteredTxsHash=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new L4.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new L4.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new L4.MerkleBlock.InvalidMerkleTree;return i};nr.prototype._traverseMerkleTree=function(t,r,i,n){if(i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0,n=n||!1,i.flagBitsUsed>this.flags.length*8)return null;var o=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!o){if(i.hashesUsed>=this.hashes.length)return null;var a=this.hashes[i.hashesUsed++];return t===0&&o&&i.txs.push(a),h.Buffer.from(a,"hex")}else{var s=this._traverseMerkleTree(t-1,r*2,i),u=s;return r*2+1<this._calcTreeWidth(t-1)&&(u=this._traverseMerkleTree(t-1,r*2+1,i)),n?i.txs:Bre.sha256sha256(h.Buffer.concat([s,u]))}};nr.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};nr.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};nr.prototype.hasTransaction=function(t){yf.checkArgument(!mf.isUndefined(t),"tx cannot be undefined"),yf.checkArgument(t instanceof pB||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof pB&&(r=h.Buffer.from(t.id,"hex").reverse().toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};nr._fromBufferReader=function(t){yf.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=q4.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};nr.fromObject=function(t){return new nr(t)};vB.exports=nr});var mB=k((i5e,b6)=>{v();b6.exports=dB();b6.exports.BlockHeader=X0();b6.exports.MerkleBlock=U4()});var OB=k((o5e,EB)=>{"use strict";v();var wB=Te(),yB=wB.crypto.Hash,bB=/^[0-9a-fA-F]{64}$/;function SB(e){return h.Buffer.from(e).reverse()}function _B(e){return SB(h.Buffer.from(e,"hex"))}function xB(e){return SB(e).toString("hex")}function F4(e,t,r){if(!bB.test(String(e)))throw new Error("txid must be 32-byte hex");if(!Number.isInteger(t)||t<0)throw new Error("index must be a non-negative integer");r=r||[];for(var i=_B(e),n=t,o=0;o<r.length;o++){var a=r[o],s;if(a==="*"||a===""||a==null)s=i;else{if(!bB.test(String(a)))throw new Error("proof node "+o+' must be 32-byte hex or "*"');s=_B(a)}i=n&1?yB.sha256sha256(h.Buffer.concat([s,i])):yB.sha256sha256(h.Buffer.concat([i,s])),n=Math.floor(n/2)}return xB(i)}function Mre(e){if(!e||!e.merkleRoot)throw new Error("proof.merkleRoot is required");var t=F4(e.txid,e.index,e.nodes);return t.toLowerCase()===String(e.merkleRoot).toLowerCase()}function Nre(e){var t=e.header;if((h.Buffer.isBuffer(t)||typeof t=="string")&&(t=wB.BlockHeader.fromBuffer(h.Buffer.isBuffer(t)?t:h.Buffer.from(t,"hex"))),!t||!t.merkleRoot)throw new Error("a valid block header is required");var r=xB(t.merkleRoot),i=F4(e.txid,e.index,e.nodes),n=i.toLowerCase()===r.toLowerCase(),o=e.requirePow!==!1,a=t.validProofOfWork();return{valid:n&&(!o||a),rootMatches:n,powValid:a,merkleRoot:i,blockHash:t.id}}EB.exports={merkleRootFromBranch:F4,verifyMerkleProof:Mre,verifyTxInclusion:Nre}});var PB=k((s5e,AB)=>{"use strict";v();var IB=Te();function Cre(e){return h.Buffer.from(e).reverse()}function Dre(e){if(e&&typeof e.validProofOfWork=="function")return e;if(h.Buffer.isBuffer(e))return IB.BlockHeader.fromBuffer(e);if(typeof e=="string")return IB.BlockHeader.fromBuffer(h.Buffer.from(e,"hex"));throw new Error("each header must be a BlockHeader, an 80-byte Buffer, or hex")}function Lre(e,t){if(t=t||{},!Array.isArray(e)||e.length===0)throw new Error("headers must be a non-empty array");for(var r=e.map(Dre),i=t.requirePow!==!1,n=0,o=0;o<r.length;o++){if(i&&!r[o].validProofOfWork())return{valid:!1,reason:"invalid proof-of-work at index "+o,count:r.length};if(n+=r[o].getDifficulty(),o>0){var a=Cre(r[o].prevHash).toString("hex").toLowerCase()===r[o-1].id.toLowerCase();if(!a)return{valid:!1,reason:"broken link at index "+o,count:r.length}}}var s=r[0].id,u=r[r.length-1].id;if(t.trustedHash){var c=String(t.trustedHash).toLowerCase();if(c!==u.toLowerCase()&&c!==s.toLowerCase())return{valid:!1,reason:"chain is not anchored at the trusted hash",count:r.length,anchorHash:s,tipHash:u}}return{valid:!0,count:r.length,anchorHash:s,tipHash:u,work:n}}AB.exports={verifyHeaderChain:Lre}});var kB=k((f5e,TB)=>{"use strict";v();var H4=OB(),qre=PB();TB.exports={merkleRootFromBranch:H4.merkleRootFromBranch,verifyMerkleProof:H4.verifyMerkleProof,verifyTxInclusion:H4.verifyTxInclusion,verifyHeaderChain:qre.verifyHeaderChain}});var z4=k((l5e,DB)=>{"use strict";v();var Ir=xt(),RB=Bt(),BB=fr(),Ure=E0(),_6=tl(),MB=cr(),w6=K4(),bf=Ss(),j4=vn(),NB=$n(),CB=hn(),J0=CB,ro=CB.HDPublicKey,S6=Es(),Ms=pi();function oe(e){if(e instanceof oe)return e;if(!(this instanceof oe))return new oe(e);if(e)if(Ir.isString(e)||h.Buffer.isBuffer(e)){var t=oe.getSerializedError(e);if(t){if(h.Buffer.isBuffer(e)&&!oe.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof ro.ArgumentIsPrivateExtended)return new w6(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(Ir.isObject(e))return e instanceof w6?this._buildFromPrivate(e):this._buildFromObject(e);throw new ro.UnrecognizedArgument(e)}else throw new ro.MustSupplyArgument}oe.fromHDPrivateKey=function(e){return new oe(e)};oe.isValidPath=function(e){if(Ir.isString(e)){var t=w6._getDerivationIndexes(e);return t!==null&&Ir.every(t,oe.isValidPath)}return Ir.isNumber(e)?e>=0&&e<oe.Hardened:!1};oe.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};oe.prototype.deriveChild=function(e,t){if(Ir.isNumber(e))return this._deriveWithNumber(e,t);if(Ir.isString(e))return this._deriveFromString(e);throw new ro.InvalidDerivationArgument(e)};oe.prototype._deriveWithNumber=function(e,t){if(e>=oe.Hardened||t)throw new ro.InvalidIndexCantDeriveHardened;if(e<0)throw new ro.InvalidPath(e);var r=Ms.integerAsBuffer(e),i=h.Buffer.concat([this.publicKey.toBuffer(),r]),n=MB.sha512hmac(i,this._buffers.chainCode),o=BB.fromBuffer(n.slice(0,32),{size:32}),a=n.slice(32,64),s;try{s=NB.fromPoint(j4.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var u=new oe({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:a,publicKey:s});return u};oe.prototype._deriveFromString=function(e){if(Ir.includes(e,"'"))throw new ro.InvalidIndexCantDeriveHardened;if(!oe.isValidPath(e))throw new ro.InvalidPath(e);var t=w6._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};oe.isValidSerialized=function(e,t){return Ir.isNull(oe.getSerializedError(e,t))};oe.getSerializedError=function(e,t){if(!(Ir.isString(e)||h.Buffer.isBuffer(e)))return new ro.UnrecognizedArgument("expected buffer or string");if(!Ure.validCharacters(e))return new J0.InvalidB58Char("(unknown)",e);try{e=_6.decode(e)}catch{return new J0.InvalidB58Checksum(e)}if(e.length!==oe.DataSize)return new ro.InvalidLength(e);if(!Ir.isUndefined(t)){var r=oe._validateNetwork(e,t);if(r)return r}var i=e.readUInt32BE(0);return i===bf.livenet.xprivkey||i===bf.testnet.xprivkey?new ro.ArgumentIsPrivateExtended:null};oe._validateNetwork=function(e,t){var r=bf.get(t);if(!r)return new J0.InvalidNetworkArgument(t);var i=e.slice(oe.VersionStart,oe.VersionEnd);return i.readUInt32BE(0)!==r.xpubkey?new J0.InvalidNetwork(i):null};oe.prototype._buildFromPrivate=function(e){var t=Ir.clone(e._buffers),r=j4.getG().mul(BB.fromBuffer(t.privateKey));return t.publicKey=j4.pointToCompressed(r),t.version=Ms.integerAsBuffer(bf.get(t.version.readUInt32BE(0)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};oe.prototype._buildFromObject=function(e){var t={version:e.network?Ms.integerAsBuffer(bf.get(e.network).xpubkey):e.version,depth:Ir.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:Ir.isNumber(e.parentFingerPrint)?Ms.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Ir.isNumber(e.childIndex)?Ms.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Ir.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:Ir.isString(e.publicKey)?h.Buffer.from(e.publicKey,"hex"):h.Buffer.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:Ir.isNumber(e.checksum)?Ms.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};oe.prototype._buildFromSerialized=function(e){var t=_6.decode(e),r={version:t.slice(oe.VersionStart,oe.VersionEnd),depth:t.slice(oe.DepthStart,oe.DepthEnd),parentFingerPrint:t.slice(oe.ParentFingerPrintStart,oe.ParentFingerPrintEnd),childIndex:t.slice(oe.ChildIndexStart,oe.ChildIndexEnd),chainCode:t.slice(oe.ChainCodeStart,oe.ChainCodeEnd),publicKey:t.slice(oe.PublicKeyStart,oe.PublicKeyEnd),checksum:t.slice(oe.ChecksumStart,oe.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};oe.prototype._buildFromBuffers=function(e){oe._validateBufferArguments(e),Ms.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=h.Buffer.concat(t),i=_6.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new J0.InvalidB58Checksum(r,i);var n=bf.get(e.version.readUInt32BE(0)),o;o=_6.encode(h.Buffer.concat(t)),e.xpubkey=h.Buffer.from(o);var a=new NB(e.publicKey,{network:n}),s=oe.ParentFingerPrintSize,u=MB.sha256ripemd160(a.toBuffer()).slice(0,s);return Ms.defineImmutable(this,{xpubkey:o,network:n,depth:e.depth[0],publicKey:a,fingerPrint:u}),this};oe._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];S6(h.Buffer.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),S6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",oe.VersionSize),t("depth",oe.DepthSize),t("parentFingerPrint",oe.ParentFingerPrintSize),t("childIndex",oe.ChildIndexSize),t("chainCode",oe.ChainCodeSize),t("publicKey",oe.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",oe.CheckSumSize)};oe.fromString=function(e){return RB.checkArgument(Ir.isString(e),"No valid string was provided"),new oe(e)};oe.fromObject=function(e){return RB.checkArgument(Ir.isObject(e),"No valid argument was provided"),new oe(e)};oe.prototype.toString=function(){return this.xpubkey};oe.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};oe.prototype.toObject=oe.prototype.toJSON=function(){return{network:bf.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}};oe.fromBuffer=function(e){return new oe(e)};oe.fromHex=function(e){return oe.fromBuffer(h.Buffer.from(e,"hex"))};oe.prototype.toBuffer=function(){return h.Buffer.from(this._buffers.xpubkey)};oe.prototype.toHex=function(){return this.toBuffer().toString("hex")};oe.Hardened=2147483648;oe.RootElementAlias=["m","M"];oe.VersionSize=4;oe.DepthSize=1;oe.ParentFingerPrintSize=4;oe.ChildIndexSize=4;oe.ChainCodeSize=32;oe.PublicKeySize=33;oe.CheckSumSize=4;oe.DataSize=78;oe.SerializedByteSize=82;oe.VersionStart=0;oe.VersionEnd=oe.VersionStart+oe.VersionSize;oe.DepthStart=oe.VersionEnd;oe.DepthEnd=oe.DepthStart+oe.DepthSize;oe.ParentFingerPrintStart=oe.DepthEnd;oe.ParentFingerPrintEnd=oe.ParentFingerPrintStart+oe.ParentFingerPrintSize;oe.ChildIndexStart=oe.ParentFingerPrintEnd;oe.ChildIndexEnd=oe.ChildIndexStart+oe.ChildIndexSize;oe.ChainCodeStart=oe.ChildIndexEnd;oe.ChainCodeEnd=oe.ChainCodeStart+oe.ChainCodeSize;oe.PublicKeyStart=oe.ChainCodeEnd;oe.PublicKeyEnd=oe.PublicKeyStart+oe.PublicKeySize;oe.ChecksumStart=oe.PublicKeyEnd;oe.ChecksumEnd=oe.ChecksumStart+oe.CheckSumSize;S6(oe.PublicKeyEnd===oe.DataSize);S6(oe.ChecksumEnd===oe.SerializedByteSize);DB.exports=oe});var K4=k((d5e,HB)=>{"use strict";v();var x6=Es(),e1=Kt(),mr=xt(),qB=Bt(),UB=fr(),Fre=E0(),Q0=tl(),V4=cr(),_f=Ss(),Hre=vn(),FB=V0(),jre=ds(),pl=hn(),Uo=pl.HDPrivateKey,qo=pi(),zre=128,LB=1/8,Kre=512;function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(!e)return this._generateRandomly();if(_f.get(e))return this._generateRandomly(e);if(mr.isString(e)||h.Buffer.isBuffer(e))if(J.isValidSerialized(e))this._buildFromSerialized(e);else if(qo.isValidJSON(e))this._buildFromJSON(e);else if(h.Buffer.isBuffer(e)&&J.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw J.getSerializedError(e);else if(mr.isObject(e))this._buildFromObject(e);else throw new Uo.UnrecognizedArgument(e)}J.fromRandom=function(e){return new J(e)};J.isValidPath=function(e,t){if(mr.isString(e)){var r=J._getDerivationIndexes(e);return r!==null&&mr.every(r,J.isValidPath)}return mr.isNumber(e)?(e<J.Hardened&&t===!0&&(e+=J.Hardened),e>=0&&e<J.MaxIndex):!1};J._getDerivationIndexes=function(e){var t=e.split("/");if(mr.includes(J.RootElementAlias,e))return[];if(!mr.includes(J.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=J.Hardened),o});return mr.some(r,isNaN)?null:r};J.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};J.prototype.deriveChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t);if(mr.isString(e))return this._deriveFromString(e);throw new Uo.InvalidDerivationArgument(e)};J.prototype.deriveNonCompliantChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t,!0);if(mr.isString(e))return this._deriveFromString(e,!0);throw new Uo.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t,r){if(!J.isValidPath(e,t))throw new Uo.InvalidPath(e);t=e>=J.Hardened?!0:t,e<J.Hardened&&t===!0&&(e+=J.Hardened);var i=qo.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=h.Buffer.concat([e1.Buffer.from([0]),o,i])}else if(t){var a=this.privateKey.bn.toBuffer({size:32});x6(a.length===32,"length of private key buffer is expected to be 32 bytes"),n=h.Buffer.concat([e1.Buffer.from([0]),a,i])}else n=h.Buffer.concat([this.publicKey.toBuffer(),i]);var s=V4.sha512hmac(n,this._buffers.chainCode),u=UB.fromBuffer(s.slice(0,32),{size:32}),c=s.slice(32,64),l=u.add(this.privateKey.toBigNumber()).umod(Hre.getN()).toBuffer({size:32});if(!FB.isValid(l))return this._deriveWithNumber(e+1,null,r);var m=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:c,privateKey:l});return m};J.prototype._deriveFromString=function(e,t){if(!J.isValidPath(e))throw new Uo.InvalidPath(e);var r=J._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};J.isValidSerialized=function(e,t){return!J.getSerializedError(e,t)};J.getSerializedError=function(e,t){if(!(mr.isString(e)||h.Buffer.isBuffer(e)))return new Uo.UnrecognizedArgument("Expected string or buffer");if(!Fre.validCharacters(e))return new pl.InvalidB58Char("(unknown)",e);try{e=Q0.decode(e)}catch{return new pl.InvalidB58Checksum(e)}if(e.length!==J.DataLength)return new Uo.InvalidLength(e);if(!mr.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}return null};J._validateNetwork=function(e,t){var r=_f.get(t);if(!r)return new pl.InvalidNetworkArgument(t);var i=e.slice(0,4);return i.readUInt32BE(0)!==r.xprivkey?new pl.InvalidNetwork(i):null};J.fromString=function(e){return qB.checkArgument(mr.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return qB.checkArgument(mr.isObject(e),"No valid argument was provided"),new J(e)};J.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};J.prototype._buildFromObject=function(e){var t={version:e.network?qo.integerAsBuffer(_f.get(e.network).xprivkey):e.version,depth:mr.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:mr.isNumber(e.parentFingerPrint)?qo.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:mr.isNumber(e.childIndex)?qo.integerAsBuffer(e.childIndex):e.childIndex,chainCode:mr.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:mr.isString(e.privateKey)&&qo.isHexa(e.privateKey)?h.Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:qo.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=Q0.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),privateKey:t.slice(J.PrivateKeyStart,J.PrivateKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};J.prototype._generateRandomly=function(e){return J.fromSeed(jre.getRandomBuffer(64),e)};J.fromSeed=function(e,t){if(qo.isHexaString(e)&&(e=h.Buffer.from(e,"hex")),!h.Buffer.isBuffer(e))throw new Uo.InvalidEntropyArgument(e);if(e.length<zre*LB)throw new Uo.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>Kre*LB)throw new Uo.InvalidEntropyArgument.TooMuchEntropy(e);var r=V4.sha512hmac(e,e1.Buffer.from("Bitcoin seed"));return new J({network:_f.get(t)||_f.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};J.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=z4();this._hdPublicKey=new e(this)}};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),qo.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,h.Buffer.alloc(1),e.privateKey],r=e1.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=Q0.checksum(r);else if(e.checksum.toString()!==Q0.checksum(r).toString())throw new pl.InvalidB58Checksum(r);var i=_f.get(e.version.readUInt32BE(0)),n;n=Q0.encode(e1.Buffer.concat(t)),e.xprivkey=h.Buffer.from(n);var o=new FB(UB.fromBuffer(e.privateKey),i),a=o.toPublicKey(),s=J.ParentFingerPrintSize,u=V4.sha256ripemd160(a.toBuffer()).slice(0,s);return qo.defineImmutable(this,{xprivkey:n,network:i,depth:e.depth[0],privateKey:o,publicKey:a,fingerPrint:u}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];x6(h.Buffer.isBuffer(n),r+" argument is not a buffer"),x6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("privateKey",J.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.prototype.toString=function(){return this.xprivkey};J.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:_f.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}};J.fromBuffer=function(e){return new J(e.toString())};J.fromHex=function(e){return J.fromBuffer(h.Buffer.from(e,"hex"))};J.prototype.toBuffer=function(){return h.Buffer.from(this.toString())};J.prototype.toHex=function(){return this.toBuffer().toString("hex")};J.DefaultDepth=0;J.DefaultFingerprint=0;J.DefaultChildIndex=0;J.Hardened=2147483648;J.MaxIndex=2*J.Hardened;J.RootElementAlias=["m","M","m'","M'"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PrivateKeySize=32;J.CheckSumSize=4;J.DataLength=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PrivateKeyStart=J.ChainCodeEnd+1;J.PrivateKeyEnd=J.PrivateKeyStart+J.PrivateKeySize;J.ChecksumStart=J.PrivateKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;x6(J.ChecksumEnd===J.SerializedByteSize);HB.exports=J});var GB=k((g5e,VB)=>{"use strict";v();var Fo=Te(),E6=Fo.deps._,Vre=Fo.PrivateKey,Gre=Fo.PublicKey,jB=Fo.Address,zB=Fo.encoding.BufferWriter,G4=Fo.crypto.ECDSA,KB=Fo.crypto.Signature,Zre=Fo.crypto.Hash.sha256sha256,Wre=Fo.util.js,gl=Fo.util.preconditions,or=function e(t){return this instanceof e?(gl.checkArgument(E6.isString(t)||h.Buffer.isBuffer(t),"First argument should be a string or Buffer"),E6.isString(t)&&(this.messageBuffer=h.Buffer.from(t)),h.Buffer.isBuffer(t)&&(this.messageBuffer=t),this):new e(t)};or.sign=function(e,t){return new or(e).sign(t)};or.verify=function(e,t,r){return new or(e).verify(t,r)};or.MAGIC_BYTES=h.Buffer.from(`Bitcoin Signed Message:
|
|
76
76
|
`);or.prototype.magicHash=function(){var t=zB.varintBufNum(or.MAGIC_BYTES.length),r=zB.varintBufNum(this.messageBuffer.length),i=h.Buffer.concat([t,or.MAGIC_BYTES,r,this.messageBuffer]),n=Zre(i);return n};or.prototype._sign=function(t){gl.checkArgument(t instanceof Vre,"First argument should be an instance of PrivateKey");var r=this.magicHash();return G4.signWithCalcI(r,t)};or.prototype.sign=function(t){var r=this._sign(t);return r.toCompact().toString("base64")};or.prototype._verify=function(t,r){gl.checkArgument(t instanceof Gre,"First argument should be an instance of PublicKey"),gl.checkArgument(r instanceof KB,"Second argument should be an instance of Signature");var i=this.magicHash(),n=G4.verify(i,r,t);return n||(this.error="The signature was invalid"),n};or.prototype.verify=function(t,r){gl.checkArgument(t),gl.checkArgument(r&&E6.isString(r)),E6.isString(t)&&(t=jB.fromString(t));var i=KB.fromCompact(h.Buffer.from(r,"base64")),n=new G4;n.hashbuf=this.magicHash(),n.sig=i;var o=n.toPublicKey(),a=jB.fromPublicKey(o,t.network);return t.toString()!==a.toString()?(this.error="The signature did not match the message digest",!1):this._verify(o,i)};or.fromString=function(e){return new or(e)};or.fromJSON=function(t){return Wre.isValidJSON(t)&&(t=JSON.parse(t)),or.fromObject(t)};or.prototype.toObject=function(){return{messageHex:this.messageBuffer.toString("hex")}};or.fromObject=function(e){let t=h.Buffer.from(e.messageHex,"hex");return new or(t)};or.prototype.toJSON=function(){return JSON.stringify(this.toObject())};or.prototype.toString=function(){return this.messageBuffer.toString()};or.prototype.inspect=function(){return"<Message: "+this.toString()+">"};VB.exports=or});var YB=k((m5e,WB)=>{v();var ZB=Te();ZB.Message=GB();WB.exports=ZB.Message});var XB=k(($B,Z4)=>{v();(function(e){"use strict";for(var t=[null,0,{}],r=10,i=44032,n=4352,o=4449,a=4519,s=19,u=21,c=28,l=u*c,m=s*l,w=function(x,b){this.codepoint=x,this.feature=b},E={},P=[],M=0;M<=255;++M)P[M]=0;function D(x,b,p){var I=E[b];return I||(I=x(b,p),I.feature&&++P[b>>8&255]>r&&(E[b]=I)),I}function L(x,b,p){var I=b&65280,T=w.udata[I]||{},S=T[b];return S?new w(b,S):new w(b,t)}function U(x,b,p){return p?x(b,p):new w(b,null)}function K(x,b,p){var I;if(b<n||n+s<=b&&b<i||i+m<b)return x(b,p);if(n<=b&&b<n+s){var T={},S=(b-n)*u;for(I=0;I<u;++I)T[o+I]=i+c*(I+S);return new w(b,[,,T])}var R=b-i,Y=R%c,X=[];if(Y!==0)X[0]=[i+R-Y,a+Y];else for(X[0]=[n+Math.floor(R/l),o+Math.floor(R%l/c)],X[2]={},I=1;I<c;++I)X[2][a+I]=b+I;return new w(b,X)}function N(x,b,p){return b<60||13311<b&&b<42607?new w(b,t):x(b,p)}var C=[N,D,U,K,L];w.fromCharCode=C.reduceRight(function(x,b){return function(p,I){return b(x,p,I)}},null),w.isHighSurrogate=function(x){return x>=55296&&x<=56319},w.isLowSurrogate=function(x){return x>=56320&&x<=57343},w.prototype.prepFeature=function(){this.feature||(this.feature=w.fromCharCode(this.codepoint,!0).feature)},w.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var x=this.codepoint-65536;return String.fromCharCode(Math.floor(x/1024)+55296,x%1024+56320)},w.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},w.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&this.feature[1]&256},w.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&this.feature[1]&512},w.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?this.feature[1]&255:0},w.prototype.getComposite=function(x){if(this.prepFeature(),!this.feature[2])return null;var b=this.feature[2][x.codepoint];return b?w.fromCharCode(b):null};var F=function(x){this.str=x,this.cursor=0};F.prototype.next=function(){if(this.str&&this.cursor<this.str.length){var x=this.str.charCodeAt(this.cursor++),b;return w.isHighSurrogate(x)&&this.cursor<this.str.length&&w.isLowSurrogate(b=this.str.charCodeAt(this.cursor))&&(x=(x-55296)*1024+(b-56320)+65536,++this.cursor),w.fromCharCode(x)}else return this.str=null,null};var H=function(x,b){this.it=x,this.canonical=b,this.resBuf=[]};H.prototype.next=function(){function x(p,I){var T=I.getDecomp();if(T&&!(p&&I.isCompatibility())){for(var S=[],R=0;R<T.length;++R){var Y=x(p,w.fromCharCode(T[R]));S=S.concat(Y)}return S}else return[I]}if(this.resBuf.length===0){var b=this.it.next();if(!b)return null;this.resBuf=x(this.canonical,b)}return this.resBuf.shift()};var z=function(x){this.it=x,this.resBuf=[]};z.prototype.next=function(){var x;if(this.resBuf.length===0)do{var b=this.it.next();if(!b)break;x=b.getCanonicalClass();var p=this.resBuf.length;if(x!==0)for(;p>0;--p){var I=this.resBuf[p-1],T=I.getCanonicalClass();if(T<=x)break}this.resBuf.splice(p,0,b)}while(x!==0);return this.resBuf.shift()};var G=function(x){this.it=x,this.procBuf=[],this.resBuf=[],this.lastClass=null};G.prototype.next=function(){for(;this.resBuf.length===0;){var x=this.it.next();if(!x){this.resBuf=this.procBuf,this.procBuf=[];break}if(this.procBuf.length===0)this.lastClass=x.getCanonicalClass(),this.procBuf.push(x);else{var b=this.procBuf[0],p=b.getComposite(x),I=x.getCanonicalClass();p&&(this.lastClass<I||this.lastClass===0)?this.procBuf[0]=p:(I===0&&(this.resBuf=this.procBuf,this.procBuf=[]),this.lastClass=I,this.procBuf.push(x))}}return this.resBuf.shift()};var B=function(x,b){switch(x){case"NFD":return new z(new H(new F(b),!0));case"NFKD":return new z(new H(new F(b),!1));case"NFC":return new G(new z(new H(new F(b),!0)));case"NFKC":return new G(new z(new H(new F(b),!1)))}throw x+" is invalid"},g=function(x,b){for(var p=B(x,b),I="",T;T=p.next();)I+=T.toString();return I};function O(x){return g("NFD",x)}function y(x){return g("NFKD",x)}function f(x){return g("NFC",x)}function d(x){return g("NFKC",x)}w.udata={0:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}],76:[,,{769:313,780:317,803:7734,807:315,813:7740,817:7738}],77:[,,{769:7742,775:7744,803:7746}],78:[,,{768:504,769:323,771:209,775:7748,780:327,803:7750,807:325,813:7754,817:7752}],79:[,,{768:210,769:211,770:212,771:213,772:332,774:334,775:558,776:214,777:7886,779:336,780:465,783:524,785:526,795:416,803:7884,808:490}],80:[,,{769:7764,775:7766}],82:[,,{769:340,775:7768,780:344,783:528,785:530,803:7770,807:342,817:7774}],83:[,,{769:346,770:348,775:7776,780:352,803:7778,806:536,807:350}],84:[,,{775:7786,780:356,803:7788,806:538,807:354,813:7792,817:7790}],85:[,,{768:217,769:218,770:219,771:360,772:362,774:364,776:220,777:7910,778:366,779:368,780:467,783:532,785:534,795:431,803:7908,804:7794,808:370,813:7798,816:7796}],86:[,,{771:7804,803:7806}],87:[,,{768:7808,769:7810,770:372,775:7814,776:7812,803:7816}],88:[,,{775:7818,776:7820}],89:[,,{768:7922,769:221,770:374,771:7928,772:562,775:7822,776:376,777:7926,803:7924}],90:[,,{769:377,770:7824,775:379,780:381,803:7826,817:7828}],97:[,,{768:224,769:225,770:226,771:227,772:257,774:259,775:551,776:228,777:7843,778:229,780:462,783:513,785:515,803:7841,805:7681,808:261}],98:[,,{775:7683,803:7685,817:7687}],99:[,,{769:263,770:265,775:267,780:269,807:231}],100:[,,{775:7691,780:271,803:7693,807:7697,813:7699,817:7695}],101:[,,{768:232,769:233,770:234,771:7869,772:275,774:277,775:279,776:235,777:7867,780:283,783:517,785:519,803:7865,807:553,808:281,813:7705,816:7707}],102:[,,{775:7711}],103:[,,{769:501,770:285,772:7713,774:287,775:289,780:487,807:291}],104:[,,{770:293,775:7715,776:7719,780:543,803:7717,807:7721,814:7723,817:7830}],105:[,,{768:236,769:237,770:238,771:297,772:299,774:301,776:239,777:7881,780:464,783:521,785:523,803:7883,808:303,816:7725}],106:[,,{770:309,780:496}],107:[,,{769:7729,780:489,803:7731,807:311,817:7733}],108:[,,{769:314,780:318,803:7735,807:316,813:7741,817:7739}],109:[,,{769:7743,775:7745,803:7747}],110:[,,{768:505,769:324,771:241,775:7749,780:328,803:7751,807:326,813:7755,817:7753}],111:[,,{768:242,769:243,770:244,771:245,772:333,774:335,775:559,776:246,777:7887,779:337,780:466,783:525,785:527,795:417,803:7885,808:491}],112:[,,{769:7765,775:7767}],114:[,,{769:341,775:7769,780:345,783:529,785:531,803:7771,807:343,817:7775}],115:[,,{769:347,770:349,775:7777,780:353,803:7779,806:537,807:351}],116:[,,{775:7787,776:7831,780:357,803:7789,806:539,807:355,813:7793,817:7791}],117:[,,{768:249,769:250,770:251,771:361,772:363,774:365,776:252,777:7911,778:367,779:369,780:468,783:533,785:535,795:432,803:7909,804:7795,808:371,813:7799,816:7797}],118:[,,{771:7805,803:7807}],119:[,,{768:7809,769:7811,770:373,775:7815,776:7813,778:7832,803:7817}],120:[,,{775:7819,776:7821}],121:[,,{768:7923,769:253,770:375,771:7929,772:563,775:7823,776:255,777:7927,778:7833,803:7925}],122:[,,{769:378,770:7825,775:380,780:382,803:7827,817:7829}],160:[[32],256],168:[[32,776],256,{768:8173,769:901,834:8129}],170:[[97],256],175:[[32,772],256],178:[[50],256],179:[[51],256],180:[[32,769],256],181:[[956],256],184:[[32,807],256],185:[[49],256],186:[[111],256],188:[[49,8260,52],256],189:[[49,8260,50],256],190:[[51,8260,52],256],192:[[65,768]],193:[[65,769]],194:[[65,770],,{768:7846,769:7844,771:7850,777:7848}],195:[[65,771]],196:[[65,776],,{772:478}],197:[[65,778],,{769:506}],198:[,,{769:508,772:482}],199:[[67,807],,{769:7688}],200:[[69,768]],201:[[69,769]],202:[[69,770],,{768:7872,769:7870,771:7876,777:7874}],203:[[69,776]],204:[[73,768]],205:[[73,769]],206:[[73,770]],207:[[73,776],,{769:7726}],209:[[78,771]],210:[[79,768]],211:[[79,769]],212:[[79,770],,{768:7890,769:7888,771:7894,777:7892}],213:[[79,771],,{769:7756,772:556,776:7758}],214:[[79,776],,{772:554}],216:[,,{769:510}],217:[[85,768]],218:[[85,769]],219:[[85,770]],220:[[85,776],,{768:475,769:471,772:469,780:473}],221:[[89,769]],224:[[97,768]],225:[[97,769]],226:[[97,770],,{768:7847,769:7845,771:7851,777:7849}],227:[[97,771]],228:[[97,776],,{772:479}],229:[[97,778],,{769:507}],230:[,,{769:509,772:483}],231:[[99,807],,{769:7689}],232:[[101,768]],233:[[101,769]],234:[[101,770],,{768:7873,769:7871,771:7877,777:7875}],235:[[101,776]],236:[[105,768]],237:[[105,769]],238:[[105,770]],239:[[105,776],,{769:7727}],241:[[110,771]],242:[[111,768]],243:[[111,769]],244:[[111,770],,{768:7891,769:7889,771:7895,777:7893}],245:[[111,771],,{769:7757,772:557,776:7759}],246:[[111,776],,{772:555}],248:[,,{769:511}],249:[[117,768]],250:[[117,769]],251:[[117,770]],252:[[117,776],,{768:476,769:472,772:470,780:474}],253:[[121,769]],255:[[121,776]]},256:{256:[[65,772]],257:[[97,772]],258:[[65,774],,{768:7856,769:7854,771:7860,777:7858}],259:[[97,774],,{768:7857,769:7855,771:7861,777:7859}],260:[[65,808]],261:[[97,808]],262:[[67,769]],263:[[99,769]],264:[[67,770]],265:[[99,770]],266:[[67,775]],267:[[99,775]],268:[[67,780]],269:[[99,780]],270:[[68,780]],271:[[100,780]],274:[[69,772],,{768:7700,769:7702}],275:[[101,772],,{768:7701,769:7703}],276:[[69,774]],277:[[101,774]],278:[[69,775]],279:[[101,775]],280:[[69,808]],281:[[101,808]],282:[[69,780]],283:[[101,780]],284:[[71,770]],285:[[103,770]],286:[[71,774]],287:[[103,774]],288:[[71,775]],289:[[103,775]],290:[[71,807]],291:[[103,807]],292:[[72,770]],293:[[104,770]],296:[[73,771]],297:[[105,771]],298:[[73,772]],299:[[105,772]],300:[[73,774]],301:[[105,774]],302:[[73,808]],303:[[105,808]],304:[[73,775]],306:[[73,74],256],307:[[105,106],256],308:[[74,770]],309:[[106,770]],310:[[75,807]],311:[[107,807]],313:[[76,769]],314:[[108,769]],315:[[76,807]],316:[[108,807]],317:[[76,780]],318:[[108,780]],319:[[76,183],256],320:[[108,183],256],323:[[78,769]],324:[[110,769]],325:[[78,807]],326:[[110,807]],327:[[78,780]],328:[[110,780]],329:[[700,110],256],332:[[79,772],,{768:7760,769:7762}],333:[[111,772],,{768:7761,769:7763}],334:[[79,774]],335:[[111,774]],336:[[79,779]],337:[[111,779]],340:[[82,769]],341:[[114,769]],342:[[82,807]],343:[[114,807]],344:[[82,780]],345:[[114,780]],346:[[83,769],,{775:7780}],347:[[115,769],,{775:7781}],348:[[83,770]],349:[[115,770]],350:[[83,807]],351:[[115,807]],352:[[83,780],,{775:7782}],353:[[115,780],,{775:7783}],354:[[84,807]],355:[[116,807]],356:[[84,780]],357:[[116,780]],360:[[85,771],,{769:7800}],361:[[117,771],,{769:7801}],362:[[85,772],,{776:7802}],363:[[117,772],,{776:7803}],364:[[85,774]],365:[[117,774]],366:[[85,778]],367:[[117,778]],368:[[85,779]],369:[[117,779]],370:[[85,808]],371:[[117,808]],372:[[87,770]],373:[[119,770]],374:[[89,770]],375:[[121,770]],376:[[89,776]],377:[[90,769]],378:[[122,769]],379:[[90,775]],380:[[122,775]],381:[[90,780]],382:[[122,780]],383:[[115],256,{775:7835}],416:[[79,795],,{768:7900,769:7898,771:7904,777:7902,803:7906}],417:[[111,795],,{768:7901,769:7899,771:7905,777:7903,803:7907}],431:[[85,795],,{768:7914,769:7912,771:7918,777:7916,803:7920}],432:[[117,795],,{768:7915,769:7913,771:7919,777:7917,803:7921}],439:[,,{780:494}],452:[[68,381],256],453:[[68,382],256],454:[[100,382],256],455:[[76,74],256],456:[[76,106],256],457:[[108,106],256],458:[[78,74],256],459:[[78,106],256],460:[[110,106],256],461:[[65,780]],462:[[97,780]],463:[[73,780]],464:[[105,780]],465:[[79,780]],466:[[111,780]],467:[[85,780]],468:[[117,780]],469:[[220,772]],470:[[252,772]],471:[[220,769]],472:[[252,769]],473:[[220,780]],474:[[252,780]],475:[[220,768]],476:[[252,768]],478:[[196,772]],479:[[228,772]],480:[[550,772]],481:[[551,772]],482:[[198,772]],483:[[230,772]],486:[[71,780]],487:[[103,780]],488:[[75,780]],489:[[107,780]],490:[[79,808],,{772:492}],491:[[111,808],,{772:493}],492:[[490,772]],493:[[491,772]],494:[[439,780]],495:[[658,780]],496:[[106,780]],497:[[68,90],256],498:[[68,122],256],499:[[100,122],256],500:[[71,769]],501:[[103,769]],504:[[78,768]],505:[[110,768]],506:[[197,769]],507:[[229,769]],508:[[198,769]],509:[[230,769]],510:[[216,769]],511:[[248,769]],66045:[,220]},512:{512:[[65,783]],513:[[97,783]],514:[[65,785]],515:[[97,785]],516:[[69,783]],517:[[101,783]],518:[[69,785]],519:[[101,785]],520:[[73,783]],521:[[105,783]],522:[[73,785]],523:[[105,785]],524:[[79,783]],525:[[111,783]],526:[[79,785]],527:[[111,785]],528:[[82,783]],529:[[114,783]],530:[[82,785]],531:[[114,785]],532:[[85,783]],533:[[117,783]],534:[[85,785]],535:[[117,785]],536:[[83,806]],537:[[115,806]],538:[[84,806]],539:[[116,806]],542:[[72,780]],543:[[104,780]],550:[[65,775],,{772:480}],551:[[97,775],,{772:481}],552:[[69,807],,{774:7708}],553:[[101,807],,{774:7709}],554:[[214,772]],555:[[246,772]],556:[[213,772]],557:[[245,772]],558:[[79,775],,{772:560}],559:[[111,775],,{772:561}],560:[[558,772]],561:[[559,772]],562:[[89,772]],563:[[121,772]],658:[,,{780:495}],688:[[104],256],689:[[614],256],690:[[106],256],691:[[114],256],692:[[633],256],693:[[635],256],694:[[641],256],695:[[119],256],696:[[121],256],728:[[32,774],256],729:[[32,775],256],730:[[32,778],256],731:[[32,808],256],732:[[32,771],256],733:[[32,779],256],736:[[611],256],737:[[108],256],738:[[115],256],739:[[120],256],740:[[661],256],66272:[,220]},768:{768:[,230],769:[,230],770:[,230],771:[,230],772:[,230],773:[,230],774:[,230],775:[,230],776:[,230,{769:836}],777:[,230],778:[,230],779:[,230],780:[,230],781:[,230],782:[,230],783:[,230],784:[,230],785:[,230],786:[,230],787:[,230],788:[,230],789:[,232],790:[,220],791:[,220],792:[,220],793:[,220],794:[,232],795:[,216],796:[,220],797:[,220],798:[,220],799:[,220],800:[,220],801:[,202],802:[,202],803:[,220],804:[,220],805:[,220],806:[,220],807:[,202],808:[,202],809:[,220],810:[,220],811:[,220],812:[,220],813:[,220],814:[,220],815:[,220],816:[,220],817:[,220],818:[,220],819:[,220],820:[,1],821:[,1],822:[,1],823:[,1],824:[,1],825:[,220],826:[,220],827:[,220],828:[,220],829:[,230],830:[,230],831:[,230],832:[[768],230],833:[[769],230],834:[,230],835:[[787],230],836:[[776,769],230],837:[,240],838:[,230],839:[,220],840:[,220],841:[,220],842:[,230],843:[,230],844:[,230],845:[,220],846:[,220],848:[,230],849:[,230],850:[,230],851:[,220],852:[,220],853:[,220],854:[,220],855:[,230],856:[,232],857:[,220],858:[,220],859:[,230],860:[,233],861:[,234],862:[,234],863:[,233],864:[,234],865:[,234],866:[,233],867:[,230],868:[,230],869:[,230],870:[,230],871:[,230],872:[,230],873:[,230],874:[,230],875:[,230],876:[,230],877:[,230],878:[,230],879:[,230],884:[[697]],890:[[32,837],256],894:[[59]],900:[[32,769],256],901:[[168,769]],902:[[913,769]],903:[[183]],904:[[917,769]],905:[[919,769]],906:[[921,769]],908:[[927,769]],910:[[933,769]],911:[[937,769]],912:[[970,769]],913:[,,{768:8122,769:902,772:8121,774:8120,787:7944,788:7945,837:8124}],917:[,,{768:8136,769:904,787:7960,788:7961}],919:[,,{768:8138,769:905,787:7976,788:7977,837:8140}],921:[,,{768:8154,769:906,772:8153,774:8152,776:938,787:7992,788:7993}],927:[,,{768:8184,769:908,787:8008,788:8009}],929:[,,{788:8172}],933:[,,{768:8170,769:910,772:8169,774:8168,776:939,788:8025}],937:[,,{768:8186,769:911,787:8040,788:8041,837:8188}],938:[[921,776]],939:[[933,776]],940:[[945,769],,{837:8116}],941:[[949,769]],942:[[951,769],,{837:8132}],943:[[953,769]],944:[[971,769]],945:[,,{768:8048,769:940,772:8113,774:8112,787:7936,788:7937,834:8118,837:8115}],949:[,,{768:8050,769:941,787:7952,788:7953}],951:[,,{768:8052,769:942,787:7968,788:7969,834:8134,837:8131}],953:[,,{768:8054,769:943,772:8145,774:8144,776:970,787:7984,788:7985,834:8150}],959:[,,{768:8056,769:972,787:8e3,788:8001}],961:[,,{787:8164,788:8165}],965:[,,{768:8058,769:973,772:8161,774:8160,776:971,787:8016,788:8017,834:8166}],969:[,,{768:8060,769:974,787:8032,788:8033,834:8182,837:8179}],970:[[953,776],,{768:8146,769:912,834:8151}],971:[[965,776],,{768:8162,769:944,834:8167}],972:[[959,769]],973:[[965,769]],974:[[969,769],,{837:8180}],976:[[946],256],977:[[952],256],978:[[933],256,{769:979,776:980}],979:[[978,769]],980:[[978,776]],981:[[966],256],982:[[960],256],1008:[[954],256],1009:[[961],256],1010:[[962],256],1012:[[920],256],1013:[[949],256],1017:[[931],256],66422:[,230],66423:[,230],66424:[,230],66425:[,230],66426:[,230]},1024:{1024:[[1045,768]],1025:[[1045,776]],1027:[[1043,769]],1030:[,,{776:1031}],1031:[[1030,776]],1036:[[1050,769]],1037:[[1048,768]],1038:[[1059,774]],1040:[,,{774:1232,776:1234}],1043:[,,{769:1027}],1045:[,,{768:1024,774:1238,776:1025}],1046:[,,{774:1217,776:1244}],1047:[,,{776:1246}],1048:[,,{768:1037,772:1250,774:1049,776:1252}],1049:[[1048,774]],1050:[,,{769:1036}],1054:[,,{776:1254}],1059:[,,{772:1262,774:1038,776:1264,779:1266}],1063:[,,{776:1268}],1067:[,,{776:1272}],1069:[,,{776:1260}],1072:[,,{774:1233,776:1235}],1075:[,,{769:1107}],1077:[,,{768:1104,774:1239,776:1105}],1078:[,,{774:1218,776:1245}],1079:[,,{776:1247}],1080:[,,{768:1117,772:1251,774:1081,776:1253}],1081:[[1080,774]],1082:[,,{769:1116}],1086:[,,{776:1255}],1091:[,,{772:1263,774:1118,776:1265,779:1267}],1095:[,,{776:1269}],1099:[,,{776:1273}],1101:[,,{776:1261}],1104:[[1077,768]],1105:[[1077,776]],1107:[[1075,769]],1110:[,,{776:1111}],1111:[[1110,776]],1116:[[1082,769]],1117:[[1080,768]],1118:[[1091,774]],1140:[,,{783:1142}],1141:[,,{783:1143}],1142:[[1140,783]],1143:[[1141,783]],1155:[,230],1156:[,230],1157:[,230],1158:[,230],1159:[,230],1217:[[1046,774]],1218:[[1078,774]],1232:[[1040,774]],1233:[[1072,774]],1234:[[1040,776]],1235:[[1072,776]],1238:[[1045,774]],1239:[[1077,774]],1240:[,,{776:1242}],1241:[,,{776:1243}],1242:[[1240,776]],1243:[[1241,776]],1244:[[1046,776]],1245:[[1078,776]],1246:[[1047,776]],1247:[[1079,776]],1250:[[1048,772]],1251:[[1080,772]],1252:[[1048,776]],1253:[[1080,776]],1254:[[1054,776]],1255:[[1086,776]],1256:[,,{776:1258}],1257:[,,{776:1259}],1258:[[1256,776]],1259:[[1257,776]],1260:[[1069,776]],1261:[[1101,776]],1262:[[1059,772]],1263:[[1091,772]],1264:[[1059,776]],1265:[[1091,776]],1266:[[1059,779]],1267:[[1091,779]],1268:[[1063,776]],1269:[[1095,776]],1272:[[1067,776]],1273:[[1099,776]]},1280:{1415:[[1381,1410],256],1425:[,220],1426:[,230],1427:[,230],1428:[,230],1429:[,230],1430:[,220],1431:[,230],1432:[,230],1433:[,230],1434:[,222],1435:[,220],1436:[,230],1437:[,230],1438:[,230],1439:[,230],1440:[,230],1441:[,230],1442:[,220],1443:[,220],1444:[,220],1445:[,220],1446:[,220],1447:[,220],1448:[,230],1449:[,230],1450:[,220],1451:[,230],1452:[,230],1453:[,222],1454:[,228],1455:[,230],1456:[,10],1457:[,11],1458:[,12],1459:[,13],1460:[,14],1461:[,15],1462:[,16],1463:[,17],1464:[,18],1465:[,19],1466:[,19],1467:[,20],1468:[,21],1469:[,22],1471:[,23],1473:[,24],1474:[,25],1476:[,230],1477:[,220],1479:[,18]},1536:{1552:[,230],1553:[,230],1554:[,230],1555:[,230],1556:[,230],1557:[,230],1558:[,230],1559:[,230],1560:[,30],1561:[,31],1562:[,32],1570:[[1575,1619]],1571:[[1575,1620]],1572:[[1608,1620]],1573:[[1575,1621]],1574:[[1610,1620]],1575:[,,{1619:1570,1620:1571,1621:1573}],1608:[,,{1620:1572}],1610:[,,{1620:1574}],1611:[,27],1612:[,28],1613:[,29],1614:[,30],1615:[,31],1616:[,32],1617:[,33],1618:[,34],1619:[,230],1620:[,230],1621:[,220],1622:[,220],1623:[,230],1624:[,230],1625:[,230],1626:[,230],1627:[,230],1628:[,220],1629:[,230],1630:[,230],1631:[,220],1648:[,35],1653:[[1575,1652],256],1654:[[1608,1652],256],1655:[[1735,1652],256],1656:[[1610,1652],256],1728:[[1749,1620]],1729:[,,{1620:1730}],1730:[[1729,1620]],1746:[,,{1620:1747}],1747:[[1746,1620]],1749:[,,{1620:1728}],1750:[,230],1751:[,230],1752:[,230],1753:[,230],1754:[,230],1755:[,230],1756:[,230],1759:[,230],1760:[,230],1761:[,230],1762:[,230],1763:[,220],1764:[,230],1767:[,230],1768:[,230],1770:[,220],1771:[,230],1772:[,230],1773:[,220]},1792:{1809:[,36],1840:[,230],1841:[,220],1842:[,230],1843:[,230],1844:[,220],1845:[,230],1846:[,230],1847:[,220],1848:[,220],1849:[,220],1850:[,230],1851:[,220],1852:[,220],1853:[,230],1854:[,220],1855:[,230],1856:[,230],1857:[,230],1858:[,220],1859:[,230],1860:[,220],1861:[,230],1862:[,220],1863:[,230],1864:[,220],1865:[,230],1866:[,230],2027:[,230],2028:[,230],2029:[,230],2030:[,230],2031:[,230],2032:[,230],2033:[,230],2034:[,220],2035:[,230]},2048:{2070:[,230],2071:[,230],2072:[,230],2073:[,230],2075:[,230],2076:[,230],2077:[,230],2078:[,230],2079:[,230],2080:[,230],2081:[,230],2082:[,230],2083:[,230],2085:[,230],2086:[,230],2087:[,230],2089:[,230],2090:[,230],2091:[,230],2092:[,230],2093:[,230],2137:[,220],2138:[,220],2139:[,220],2276:[,230],2277:[,230],2278:[,220],2279:[,230],2280:[,230],2281:[,220],2282:[,230],2283:[,230],2284:[,230],2285:[,220],2286:[,220],2287:[,220],2288:[,27],2289:[,28],2290:[,29],2291:[,230],2292:[,230],2293:[,230],2294:[,220],2295:[,230],2296:[,230],2297:[,220],2298:[,220],2299:[,230],2300:[,230],2301:[,230],2302:[,230],2303:[,230]},2304:{2344:[,,{2364:2345}],2345:[[2344,2364]],2352:[,,{2364:2353}],2353:[[2352,2364]],2355:[,,{2364:2356}],2356:[[2355,2364]],2364:[,7],2381:[,9],2385:[,230],2386:[,220],2387:[,230],2388:[,230],2392:[[2325,2364],512],2393:[[2326,2364],512],2394:[[2327,2364],512],2395:[[2332,2364],512],2396:[[2337,2364],512],2397:[[2338,2364],512],2398:[[2347,2364],512],2399:[[2351,2364],512],2492:[,7],2503:[,,{2494:2507,2519:2508}],2507:[[2503,2494]],2508:[[2503,2519]],2509:[,9],2524:[[2465,2492],512],2525:[[2466,2492],512],2527:[[2479,2492],512]},2560:{2611:[[2610,2620],512],2614:[[2616,2620],512],2620:[,7],2637:[,9],2649:[[2582,2620],512],2650:[[2583,2620],512],2651:[[2588,2620],512],2654:[[2603,2620],512],2748:[,7],2765:[,9],68109:[,220],68111:[,230],68152:[,230],68153:[,1],68154:[,220],68159:[,9],68325:[,230],68326:[,220]},2816:{2876:[,7],2887:[,,{2878:2891,2902:2888,2903:2892}],2888:[[2887,2902]],2891:[[2887,2878]],2892:[[2887,2903]],2893:[,9],2908:[[2849,2876],512],2909:[[2850,2876],512],2962:[,,{3031:2964}],2964:[[2962,3031]],3014:[,,{3006:3018,3031:3020}],3015:[,,{3006:3019}],3018:[[3014,3006]],3019:[[3015,3006]],3020:[[3014,3031]],3021:[,9]},3072:{3142:[,,{3158:3144}],3144:[[3142,3158]],3149:[,9],3157:[,84],3158:[,91],3260:[,7],3263:[,,{3285:3264}],3264:[[3263,3285]],3270:[,,{3266:3274,3285:3271,3286:3272}],3271:[[3270,3285]],3272:[[3270,3286]],3274:[[3270,3266],,{3285:3275}],3275:[[3274,3285]],3277:[,9]},3328:{3398:[,,{3390:3402,3415:3404}],3399:[,,{3390:3403}],3402:[[3398,3390]],3403:[[3399,3390]],3404:[[3398,3415]],3405:[,9],3530:[,9],3545:[,,{3530:3546,3535:3548,3551:3550}],3546:[[3545,3530]],3548:[[3545,3535],,{3530:3549}],3549:[[3548,3530]],3550:[[3545,3551]]},3584:{3635:[[3661,3634],256],3640:[,103],3641:[,103],3642:[,9],3656:[,107],3657:[,107],3658:[,107],3659:[,107],3763:[[3789,3762],256],3768:[,118],3769:[,118],3784:[,122],3785:[,122],3786:[,122],3787:[,122],3804:[[3755,3737],256],3805:[[3755,3745],256]},3840:{3852:[[3851],256],3864:[,220],3865:[,220],3893:[,220],3895:[,220],3897:[,216],3907:[[3906,4023],512],3917:[[3916,4023],512],3922:[[3921,4023],512],3927:[[3926,4023],512],3932:[[3931,4023],512],3945:[[3904,4021],512],3953:[,129],3954:[,130],3955:[[3953,3954],512],3956:[,132],3957:[[3953,3956],512],3958:[[4018,3968],512],3959:[[4018,3969],256],3960:[[4019,3968],512],3961:[[4019,3969],256],3962:[,130],3963:[,130],3964:[,130],3965:[,130],3968:[,130],3969:[[3953,3968],512],3970:[,230],3971:[,230],3972:[,9],3974:[,230],3975:[,230],3987:[[3986,4023],512],3997:[[3996,4023],512],4002:[[4001,4023],512],4007:[[4006,4023],512],4012:[[4011,4023],512],4025:[[3984,4021],512],4038:[,220]},4096:{4133:[,,{4142:4134}],4134:[[4133,4142]],4151:[,7],4153:[,9],4154:[,9],4237:[,220],4348:[[4316],256],69702:[,9],69759:[,9],69785:[,,{69818:69786}],69786:[[69785,69818]],69787:[,,{69818:69788}],69788:[[69787,69818]],69797:[,,{69818:69803}],69803:[[69797,69818]],69817:[,9],69818:[,7]},4352:{69888:[,230],69889:[,230],69890:[,230],69934:[[69937,69927]],69935:[[69938,69927]],69937:[,,{69927:69934}],69938:[,,{69927:69935}],69939:[,9],69940:[,9],70003:[,7],70080:[,9]},4608:{70197:[,9],70198:[,7],70377:[,7],70378:[,9]},4864:{4957:[,230],4958:[,230],4959:[,230],70460:[,7],70471:[,,{70462:70475,70487:70476}],70475:[[70471,70462]],70476:[[70471,70487]],70477:[,9],70502:[,230],70503:[,230],70504:[,230],70505:[,230],70506:[,230],70507:[,230],70508:[,230],70512:[,230],70513:[,230],70514:[,230],70515:[,230],70516:[,230]},5120:{70841:[,,{70832:70844,70842:70843,70845:70846}],70843:[[70841,70842]],70844:[[70841,70832]],70846:[[70841,70845]],70850:[,9],70851:[,7]},5376:{71096:[,,{71087:71098}],71097:[,,{71087:71099}],71098:[[71096,71087]],71099:[[71097,71087]],71103:[,9],71104:[,7]},5632:{71231:[,9],71350:[,9],71351:[,7]},5888:{5908:[,9],5940:[,9],6098:[,9],6109:[,230]},6144:{6313:[,228]},6400:{6457:[,222],6458:[,230],6459:[,220]},6656:{6679:[,230],6680:[,220],6752:[,9],6773:[,230],6774:[,230],6775:[,230],6776:[,230],6777:[,230],6778:[,230],6779:[,230],6780:[,230],6783:[,220],6832:[,230],6833:[,230],6834:[,230],6835:[,230],6836:[,230],6837:[,220],6838:[,220],6839:[,220],6840:[,220],6841:[,220],6842:[,220],6843:[,230],6844:[,230],6845:[,220]},6912:{6917:[,,{6965:6918}],6918:[[6917,6965]],6919:[,,{6965:6920}],6920:[[6919,6965]],6921:[,,{6965:6922}],6922:[[6921,6965]],6923:[,,{6965:6924}],6924:[[6923,6965]],6925:[,,{6965:6926}],6926:[[6925,6965]],6929:[,,{6965:6930}],6930:[[6929,6965]],6964:[,7],6970:[,,{6965:6971}],6971:[[6970,6965]],6972:[,,{6965:6973}],6973:[[6972,6965]],6974:[,,{6965:6976}],6975:[,,{6965:6977}],6976:[[6974,6965]],6977:[[6975,6965]],6978:[,,{6965:6979}],6979:[[6978,6965]],6980:[,9],7019:[,230],7020:[,220],7021:[,230],7022:[,230],7023:[,230],7024:[,230],7025:[,230],7026:[,230],7027:[,230],7082:[,9],7083:[,9],7142:[,7],7154:[,9],7155:[,9]},7168:{7223:[,7],7376:[,230],7377:[,230],7378:[,230],7380:[,1],7381:[,220],7382:[,220],7383:[,220],7384:[,220],7385:[,220],7386:[,230],7387:[,230],7388:[,220],7389:[,220],7390:[,220],7391:[,220],7392:[,230],7394:[,1],7395:[,1],7396:[,1],7397:[,1],7398:[,1],7399:[,1],7400:[,1],7405:[,220],7412:[,230],7416:[,230],7417:[,230]},7424:{7468:[[65],256],7469:[[198],256],7470:[[66],256],7472:[[68],256],7473:[[69],256],7474:[[398],256],7475:[[71],256],7476:[[72],256],7477:[[73],256],7478:[[74],256],7479:[[75],256],7480:[[76],256],7481:[[77],256],7482:[[78],256],7484:[[79],256],7485:[[546],256],7486:[[80],256],7487:[[82],256],7488:[[84],256],7489:[[85],256],7490:[[87],256],7491:[[97],256],7492:[[592],256],7493:[[593],256],7494:[[7426],256],7495:[[98],256],7496:[[100],256],7497:[[101],256],7498:[[601],256],7499:[[603],256],7500:[[604],256],7501:[[103],256],7503:[[107],256],7504:[[109],256],7505:[[331],256],7506:[[111],256],7507:[[596],256],7508:[[7446],256],7509:[[7447],256],7510:[[112],256],7511:[[116],256],7512:[[117],256],7513:[[7453],256],7514:[[623],256],7515:[[118],256],7516:[[7461],256],7517:[[946],256],7518:[[947],256],7519:[[948],256],7520:[[966],256],7521:[[967],256],7522:[[105],256],7523:[[114],256],7524:[[117],256],7525:[[118],256],7526:[[946],256],7527:[[947],256],7528:[[961],256],7529:[[966],256],7530:[[967],256],7544:[[1085],256],7579:[[594],256],7580:[[99],256],7581:[[597],256],7582:[[240],256],7583:[[604],256],7584:[[102],256],7585:[[607],256],7586:[[609],256],7587:[[613],256],7588:[[616],256],7589:[[617],256],7590:[[618],256],7591:[[7547],256],7592:[[669],256],7593:[[621],256],7594:[[7557],256],7595:[[671],256],7596:[[625],256],7597:[[624],256],7598:[[626],256],7599:[[627],256],7600:[[628],256],7601:[[629],256],7602:[[632],256],7603:[[642],256],7604:[[643],256],7605:[[427],256],7606:[[649],256],7607:[[650],256],7608:[[7452],256],7609:[[651],256],7610:[[652],256],7611:[[122],256],7612:[[656],256],7613:[[657],256],7614:[[658],256],7615:[[952],256],7616:[,230],7617:[,230],7618:[,220],7619:[,230],7620:[,230],7621:[,230],7622:[,230],7623:[,230],7624:[,230],7625:[,230],7626:[,220],7627:[,230],7628:[,230],7629:[,234],7630:[,214],7631:[,220],7632:[,202],7633:[,230],7634:[,230],7635:[,230],7636:[,230],7637:[,230],7638:[,230],7639:[,230],7640:[,230],7641:[,230],7642:[,230],7643:[,230],7644:[,230],7645:[,230],7646:[,230],7647:[,230],7648:[,230],7649:[,230],7650:[,230],7651:[,230],7652:[,230],7653:[,230],7654:[,230],7655:[,230],7656:[,230],7657:[,230],7658:[,230],7659:[,230],7660:[,230],7661:[,230],7662:[,230],7663:[,230],7664:[,230],7665:[,230],7666:[,230],7667:[,230],7668:[,230],7669:[,230],7676:[,233],7677:[,220],7678:[,230],7679:[,220]},7680:{7680:[[65,805]],7681:[[97,805]],7682:[[66,775]],7683:[[98,775]],7684:[[66,803]],7685:[[98,803]],7686:[[66,817]],7687:[[98,817]],7688:[[199,769]],7689:[[231,769]],7690:[[68,775]],7691:[[100,775]],7692:[[68,803]],7693:[[100,803]],7694:[[68,817]],7695:[[100,817]],7696:[[68,807]],7697:[[100,807]],7698:[[68,813]],7699:[[100,813]],7700:[[274,768]],7701:[[275,768]],7702:[[274,769]],7703:[[275,769]],7704:[[69,813]],7705:[[101,813]],7706:[[69,816]],7707:[[101,816]],7708:[[552,774]],7709:[[553,774]],7710:[[70,775]],7711:[[102,775]],7712:[[71,772]],7713:[[103,772]],7714:[[72,775]],7715:[[104,775]],7716:[[72,803]],7717:[[104,803]],7718:[[72,776]],7719:[[104,776]],7720:[[72,807]],7721:[[104,807]],7722:[[72,814]],7723:[[104,814]],7724:[[73,816]],7725:[[105,816]],7726:[[207,769]],7727:[[239,769]],7728:[[75,769]],7729:[[107,769]],7730:[[75,803]],7731:[[107,803]],7732:[[75,817]],7733:[[107,817]],7734:[[76,803],,{772:7736}],7735:[[108,803],,{772:7737}],7736:[[7734,772]],7737:[[7735,772]],7738:[[76,817]],7739:[[108,817]],7740:[[76,813]],7741:[[108,813]],7742:[[77,769]],7743:[[109,769]],7744:[[77,775]],7745:[[109,775]],7746:[[77,803]],7747:[[109,803]],7748:[[78,775]],7749:[[110,775]],7750:[[78,803]],7751:[[110,803]],7752:[[78,817]],7753:[[110,817]],7754:[[78,813]],7755:[[110,813]],7756:[[213,769]],7757:[[245,769]],7758:[[213,776]],7759:[[245,776]],7760:[[332,768]],7761:[[333,768]],7762:[[332,769]],7763:[[333,769]],7764:[[80,769]],7765:[[112,769]],7766:[[80,775]],7767:[[112,775]],7768:[[82,775]],7769:[[114,775]],7770:[[82,803],,{772:7772}],7771:[[114,803],,{772:7773}],7772:[[7770,772]],7773:[[7771,772]],7774:[[82,817]],7775:[[114,817]],7776:[[83,775]],7777:[[115,775]],7778:[[83,803],,{775:7784}],7779:[[115,803],,{775:7785}],7780:[[346,775]],7781:[[347,775]],7782:[[352,775]],7783:[[353,775]],7784:[[7778,775]],7785:[[7779,775]],7786:[[84,775]],7787:[[116,775]],7788:[[84,803]],7789:[[116,803]],7790:[[84,817]],7791:[[116,817]],7792:[[84,813]],7793:[[116,813]],7794:[[85,804]],7795:[[117,804]],7796:[[85,816]],7797:[[117,816]],7798:[[85,813]],7799:[[117,813]],7800:[[360,769]],7801:[[361,769]],7802:[[362,776]],7803:[[363,776]],7804:[[86,771]],7805:[[118,771]],7806:[[86,803]],7807:[[118,803]],7808:[[87,768]],7809:[[119,768]],7810:[[87,769]],7811:[[119,769]],7812:[[87,776]],7813:[[119,776]],7814:[[87,775]],7815:[[119,775]],7816:[[87,803]],7817:[[119,803]],7818:[[88,775]],7819:[[120,775]],7820:[[88,776]],7821:[[120,776]],7822:[[89,775]],7823:[[121,775]],7824:[[90,770]],7825:[[122,770]],7826:[[90,803]],7827:[[122,803]],7828:[[90,817]],7829:[[122,817]],7830:[[104,817]],7831:[[116,776]],7832:[[119,778]],7833:[[121,778]],7834:[[97,702],256],7835:[[383,775]],7840:[[65,803],,{770:7852,774:7862}],7841:[[97,803],,{770:7853,774:7863}],7842:[[65,777]],7843:[[97,777]],7844:[[194,769]],7845:[[226,769]],7846:[[194,768]],7847:[[226,768]],7848:[[194,777]],7849:[[226,777]],7850:[[194,771]],7851:[[226,771]],7852:[[7840,770]],7853:[[7841,770]],7854:[[258,769]],7855:[[259,769]],7856:[[258,768]],7857:[[259,768]],7858:[[258,777]],7859:[[259,777]],7860:[[258,771]],7861:[[259,771]],7862:[[7840,774]],7863:[[7841,774]],7864:[[69,803],,{770:7878}],7865:[[101,803],,{770:7879}],7866:[[69,777]],7867:[[101,777]],7868:[[69,771]],7869:[[101,771]],7870:[[202,769]],7871:[[234,769]],7872:[[202,768]],7873:[[234,768]],7874:[[202,777]],7875:[[234,777]],7876:[[202,771]],7877:[[234,771]],7878:[[7864,770]],7879:[[7865,770]],7880:[[73,777]],7881:[[105,777]],7882:[[73,803]],7883:[[105,803]],7884:[[79,803],,{770:7896}],7885:[[111,803],,{770:7897}],7886:[[79,777]],7887:[[111,777]],7888:[[212,769]],7889:[[244,769]],7890:[[212,768]],7891:[[244,768]],7892:[[212,777]],7893:[[244,777]],7894:[[212,771]],7895:[[244,771]],7896:[[7884,770]],7897:[[7885,770]],7898:[[416,769]],7899:[[417,769]],7900:[[416,768]],7901:[[417,768]],7902:[[416,777]],7903:[[417,777]],7904:[[416,771]],7905:[[417,771]],7906:[[416,803]],7907:[[417,803]],7908:[[85,803]],7909:[[117,803]],7910:[[85,777]],7911:[[117,777]],7912:[[431,769]],7913:[[432,769]],7914:[[431,768]],7915:[[432,768]],7916:[[431,777]],7917:[[432,777]],7918:[[431,771]],7919:[[432,771]],7920:[[431,803]],7921:[[432,803]],7922:[[89,768]],7923:[[121,768]],7924:[[89,803]],7925:[[121,803]],7926:[[89,777]],7927:[[121,777]],7928:[[89,771]],7929:[[121,771]]},7936:{7936:[[945,787],,{768:7938,769:7940,834:7942,837:8064}],7937:[[945,788],,{768:7939,769:7941,834:7943,837:8065}],7938:[[7936,768],,{837:8066}],7939:[[7937,768],,{837:8067}],7940:[[7936,769],,{837:8068}],7941:[[7937,769],,{837:8069}],7942:[[7936,834],,{837:8070}],7943:[[7937,834],,{837:8071}],7944:[[913,787],,{768:7946,769:7948,834:7950,837:8072}],7945:[[913,788],,{768:7947,769:7949,834:7951,837:8073}],7946:[[7944,768],,{837:8074}],7947:[[7945,768],,{837:8075}],7948:[[7944,769],,{837:8076}],7949:[[7945,769],,{837:8077}],7950:[[7944,834],,{837:8078}],7951:[[7945,834],,{837:8079}],7952:[[949,787],,{768:7954,769:7956}],7953:[[949,788],,{768:7955,769:7957}],7954:[[7952,768]],7955:[[7953,768]],7956:[[7952,769]],7957:[[7953,769]],7960:[[917,787],,{768:7962,769:7964}],7961:[[917,788],,{768:7963,769:7965}],7962:[[7960,768]],7963:[[7961,768]],7964:[[7960,769]],7965:[[7961,769]],7968:[[951,787],,{768:7970,769:7972,834:7974,837:8080}],7969:[[951,788],,{768:7971,769:7973,834:7975,837:8081}],7970:[[7968,768],,{837:8082}],7971:[[7969,768],,{837:8083}],7972:[[7968,769],,{837:8084}],7973:[[7969,769],,{837:8085}],7974:[[7968,834],,{837:8086}],7975:[[7969,834],,{837:8087}],7976:[[919,787],,{768:7978,769:7980,834:7982,837:8088}],7977:[[919,788],,{768:7979,769:7981,834:7983,837:8089}],7978:[[7976,768],,{837:8090}],7979:[[7977,768],,{837:8091}],7980:[[7976,769],,{837:8092}],7981:[[7977,769],,{837:8093}],7982:[[7976,834],,{837:8094}],7983:[[7977,834],,{837:8095}],7984:[[953,787],,{768:7986,769:7988,834:7990}],7985:[[953,788],,{768:7987,769:7989,834:7991}],7986:[[7984,768]],7987:[[7985,768]],7988:[[7984,769]],7989:[[7985,769]],7990:[[7984,834]],7991:[[7985,834]],7992:[[921,787],,{768:7994,769:7996,834:7998}],7993:[[921,788],,{768:7995,769:7997,834:7999}],7994:[[7992,768]],7995:[[7993,768]],7996:[[7992,769]],7997:[[7993,769]],7998:[[7992,834]],7999:[[7993,834]],8e3:[[959,787],,{768:8002,769:8004}],8001:[[959,788],,{768:8003,769:8005}],8002:[[8e3,768]],8003:[[8001,768]],8004:[[8e3,769]],8005:[[8001,769]],8008:[[927,787],,{768:8010,769:8012}],8009:[[927,788],,{768:8011,769:8013}],8010:[[8008,768]],8011:[[8009,768]],8012:[[8008,769]],8013:[[8009,769]],8016:[[965,787],,{768:8018,769:8020,834:8022}],8017:[[965,788],,{768:8019,769:8021,834:8023}],8018:[[8016,768]],8019:[[8017,768]],8020:[[8016,769]],8021:[[8017,769]],8022:[[8016,834]],8023:[[8017,834]],8025:[[933,788],,{768:8027,769:8029,834:8031}],8027:[[8025,768]],8029:[[8025,769]],8031:[[8025,834]],8032:[[969,787],,{768:8034,769:8036,834:8038,837:8096}],8033:[[969,788],,{768:8035,769:8037,834:8039,837:8097}],8034:[[8032,768],,{837:8098}],8035:[[8033,768],,{837:8099}],8036:[[8032,769],,{837:8100}],8037:[[8033,769],,{837:8101}],8038:[[8032,834],,{837:8102}],8039:[[8033,834],,{837:8103}],8040:[[937,787],,{768:8042,769:8044,834:8046,837:8104}],8041:[[937,788],,{768:8043,769:8045,834:8047,837:8105}],8042:[[8040,768],,{837:8106}],8043:[[8041,768],,{837:8107}],8044:[[8040,769],,{837:8108}],8045:[[8041,769],,{837:8109}],8046:[[8040,834],,{837:8110}],8047:[[8041,834],,{837:8111}],8048:[[945,768],,{837:8114}],8049:[[940]],8050:[[949,768]],8051:[[941]],8052:[[951,768],,{837:8130}],8053:[[942]],8054:[[953,768]],8055:[[943]],8056:[[959,768]],8057:[[972]],8058:[[965,768]],8059:[[973]],8060:[[969,768],,{837:8178}],8061:[[974]],8064:[[7936,837]],8065:[[7937,837]],8066:[[7938,837]],8067:[[7939,837]],8068:[[7940,837]],8069:[[7941,837]],8070:[[7942,837]],8071:[[7943,837]],8072:[[7944,837]],8073:[[7945,837]],8074:[[7946,837]],8075:[[7947,837]],8076:[[7948,837]],8077:[[7949,837]],8078:[[7950,837]],8079:[[7951,837]],8080:[[7968,837]],8081:[[7969,837]],8082:[[7970,837]],8083:[[7971,837]],8084:[[7972,837]],8085:[[7973,837]],8086:[[7974,837]],8087:[[7975,837]],8088:[[7976,837]],8089:[[7977,837]],8090:[[7978,837]],8091:[[7979,837]],8092:[[7980,837]],8093:[[7981,837]],8094:[[7982,837]],8095:[[7983,837]],8096:[[8032,837]],8097:[[8033,837]],8098:[[8034,837]],8099:[[8035,837]],8100:[[8036,837]],8101:[[8037,837]],8102:[[8038,837]],8103:[[8039,837]],8104:[[8040,837]],8105:[[8041,837]],8106:[[8042,837]],8107:[[8043,837]],8108:[[8044,837]],8109:[[8045,837]],8110:[[8046,837]],8111:[[8047,837]],8112:[[945,774]],8113:[[945,772]],8114:[[8048,837]],8115:[[945,837]],8116:[[940,837]],8118:[[945,834],,{837:8119}],8119:[[8118,837]],8120:[[913,774]],8121:[[913,772]],8122:[[913,768]],8123:[[902]],8124:[[913,837]],8125:[[32,787],256],8126:[[953]],8127:[[32,787],256,{768:8141,769:8142,834:8143}],8128:[[32,834],256],8129:[[168,834]],8130:[[8052,837]],8131:[[951,837]],8132:[[942,837]],8134:[[951,834],,{837:8135}],8135:[[8134,837]],8136:[[917,768]],8137:[[904]],8138:[[919,768]],8139:[[905]],8140:[[919,837]],8141:[[8127,768]],8142:[[8127,769]],8143:[[8127,834]],8144:[[953,774]],8145:[[953,772]],8146:[[970,768]],8147:[[912]],8150:[[953,834]],8151:[[970,834]],8152:[[921,774]],8153:[[921,772]],8154:[[921,768]],8155:[[906]],8157:[[8190,768]],8158:[[8190,769]],8159:[[8190,834]],8160:[[965,774]],8161:[[965,772]],8162:[[971,768]],8163:[[944]],8164:[[961,787]],8165:[[961,788]],8166:[[965,834]],8167:[[971,834]],8168:[[933,774]],8169:[[933,772]],8170:[[933,768]],8171:[[910]],8172:[[929,788]],8173:[[168,768]],8174:[[901]],8175:[[96]],8178:[[8060,837]],8179:[[969,837]],8180:[[974,837]],8182:[[969,834],,{837:8183}],8183:[[8182,837]],8184:[[927,768]],8185:[[908]],8186:[[937,768]],8187:[[911]],8188:[[937,837]],8189:[[180]],8190:[[32,788],256,{768:8157,769:8158,834:8159}]},8192:{8192:[[8194]],8193:[[8195]],8194:[[32],256],8195:[[32],256],8196:[[32],256],8197:[[32],256],8198:[[32],256],8199:[[32],256],8200:[[32],256],8201:[[32],256],8202:[[32],256],8209:[[8208],256],8215:[[32,819],256],8228:[[46],256],8229:[[46,46],256],8230:[[46,46,46],256],8239:[[32],256],8243:[[8242,8242],256],8244:[[8242,8242,8242],256],8246:[[8245,8245],256],8247:[[8245,8245,8245],256],8252:[[33,33],256],8254:[[32,773],256],8263:[[63,63],256],8264:[[63,33],256],8265:[[33,63],256],8279:[[8242,8242,8242,8242],256],8287:[[32],256],8304:[[48],256],8305:[[105],256],8308:[[52],256],8309:[[53],256],8310:[[54],256],8311:[[55],256],8312:[[56],256],8313:[[57],256],8314:[[43],256],8315:[[8722],256],8316:[[61],256],8317:[[40],256],8318:[[41],256],8319:[[110],256],8320:[[48],256],8321:[[49],256],8322:[[50],256],8323:[[51],256],8324:[[52],256],8325:[[53],256],8326:[[54],256],8327:[[55],256],8328:[[56],256],8329:[[57],256],8330:[[43],256],8331:[[8722],256],8332:[[61],256],8333:[[40],256],8334:[[41],256],8336:[[97],256],8337:[[101],256],8338:[[111],256],8339:[[120],256],8340:[[601],256],8341:[[104],256],8342:[[107],256],8343:[[108],256],8344:[[109],256],8345:[[110],256],8346:[[112],256],8347:[[115],256],8348:[[116],256],8360:[[82,115],256],8400:[,230],8401:[,230],8402:[,1],8403:[,1],8404:[,230],8405:[,230],8406:[,230],8407:[,230],8408:[,1],8409:[,1],8410:[,1],8411:[,230],8412:[,230],8417:[,230],8421:[,1],8422:[,1],8423:[,230],8424:[,220],8425:[,230],8426:[,1],8427:[,1],8428:[,220],8429:[,220],8430:[,220],8431:[,220],8432:[,230]},8448:{8448:[[97,47,99],256],8449:[[97,47,115],256],8450:[[67],256],8451:[[176,67],256],8453:[[99,47,111],256],8454:[[99,47,117],256],8455:[[400],256],8457:[[176,70],256],8458:[[103],256],8459:[[72],256],8460:[[72],256],8461:[[72],256],8462:[[104],256],8463:[[295],256],8464:[[73],256],8465:[[73],256],8466:[[76],256],8467:[[108],256],8469:[[78],256],8470:[[78,111],256],8473:[[80],256],8474:[[81],256],8475:[[82],256],8476:[[82],256],8477:[[82],256],8480:[[83,77],256],8481:[[84,69,76],256],8482:[[84,77],256],8484:[[90],256],8486:[[937]],8488:[[90],256],8490:[[75]],8491:[[197]],8492:[[66],256],8493:[[67],256],8495:[[101],256],8496:[[69],256],8497:[[70],256],8499:[[77],256],8500:[[111],256],8501:[[1488],256],8502:[[1489],256],8503:[[1490],256],8504:[[1491],256],8505:[[105],256],8507:[[70,65,88],256],8508:[[960],256],8509:[[947],256],8510:[[915],256],8511:[[928],256],8512:[[8721],256],8517:[[68],256],8518:[[100],256],8519:[[101],256],8520:[[105],256],8521:[[106],256],8528:[[49,8260,55],256],8529:[[49,8260,57],256],8530:[[49,8260,49,48],256],8531:[[49,8260,51],256],8532:[[50,8260,51],256],8533:[[49,8260,53],256],8534:[[50,8260,53],256],8535:[[51,8260,53],256],8536:[[52,8260,53],256],8537:[[49,8260,54],256],8538:[[53,8260,54],256],8539:[[49,8260,56],256],8540:[[51,8260,56],256],8541:[[53,8260,56],256],8542:[[55,8260,56],256],8543:[[49,8260],256],8544:[[73],256],8545:[[73,73],256],8546:[[73,73,73],256],8547:[[73,86],256],8548:[[86],256],8549:[[86,73],256],8550:[[86,73,73],256],8551:[[86,73,73,73],256],8552:[[73,88],256],8553:[[88],256],8554:[[88,73],256],8555:[[88,73,73],256],8556:[[76],256],8557:[[67],256],8558:[[68],256],8559:[[77],256],8560:[[105],256],8561:[[105,105],256],8562:[[105,105,105],256],8563:[[105,118],256],8564:[[118],256],8565:[[118,105],256],8566:[[118,105,105],256],8567:[[118,105,105,105],256],8568:[[105,120],256],8569:[[120],256],8570:[[120,105],256],8571:[[120,105,105],256],8572:[[108],256],8573:[[99],256],8574:[[100],256],8575:[[109],256],8585:[[48,8260,51],256],8592:[,,{824:8602}],8594:[,,{824:8603}],8596:[,,{824:8622}],8602:[[8592,824]],8603:[[8594,824]],8622:[[8596,824]],8653:[[8656,824]],8654:[[8660,824]],8655:[[8658,824]],8656:[,,{824:8653}],8658:[,,{824:8655}],8660:[,,{824:8654}]},8704:{8707:[,,{824:8708}],8708:[[8707,824]],8712:[,,{824:8713}],8713:[[8712,824]],8715:[,,{824:8716}],8716:[[8715,824]],8739:[,,{824:8740}],8740:[[8739,824]],8741:[,,{824:8742}],8742:[[8741,824]],8748:[[8747,8747],256],8749:[[8747,8747,8747],256],8751:[[8750,8750],256],8752:[[8750,8750,8750],256],8764:[,,{824:8769}],8769:[[8764,824]],8771:[,,{824:8772}],8772:[[8771,824]],8773:[,,{824:8775}],8775:[[8773,824]],8776:[,,{824:8777}],8777:[[8776,824]],8781:[,,{824:8813}],8800:[[61,824]],8801:[,,{824:8802}],8802:[[8801,824]],8804:[,,{824:8816}],8805:[,,{824:8817}],8813:[[8781,824]],8814:[[60,824]],8815:[[62,824]],8816:[[8804,824]],8817:[[8805,824]],8818:[,,{824:8820}],8819:[,,{824:8821}],8820:[[8818,824]],8821:[[8819,824]],8822:[,,{824:8824}],8823:[,,{824:8825}],8824:[[8822,824]],8825:[[8823,824]],8826:[,,{824:8832}],8827:[,,{824:8833}],8828:[,,{824:8928}],8829:[,,{824:8929}],8832:[[8826,824]],8833:[[8827,824]],8834:[,,{824:8836}],8835:[,,{824:8837}],8836:[[8834,824]],8837:[[8835,824]],8838:[,,{824:8840}],8839:[,,{824:8841}],8840:[[8838,824]],8841:[[8839,824]],8849:[,,{824:8930}],8850:[,,{824:8931}],8866:[,,{824:8876}],8872:[,,{824:8877}],8873:[,,{824:8878}],8875:[,,{824:8879}],8876:[[8866,824]],8877:[[8872,824]],8878:[[8873,824]],8879:[[8875,824]],8882:[,,{824:8938}],8883:[,,{824:8939}],8884:[,,{824:8940}],8885:[,,{824:8941}],8928:[[8828,824]],8929:[[8829,824]],8930:[[8849,824]],8931:[[8850,824]],8938:[[8882,824]],8939:[[8883,824]],8940:[[8884,824]],8941:[[8885,824]]},8960:{9001:[[12296]],9002:[[12297]]},9216:{9312:[[49],256],9313:[[50],256],9314:[[51],256],9315:[[52],256],9316:[[53],256],9317:[[54],256],9318:[[55],256],9319:[[56],256],9320:[[57],256],9321:[[49,48],256],9322:[[49,49],256],9323:[[49,50],256],9324:[[49,51],256],9325:[[49,52],256],9326:[[49,53],256],9327:[[49,54],256],9328:[[49,55],256],9329:[[49,56],256],9330:[[49,57],256],9331:[[50,48],256],9332:[[40,49,41],256],9333:[[40,50,41],256],9334:[[40,51,41],256],9335:[[40,52,41],256],9336:[[40,53,41],256],9337:[[40,54,41],256],9338:[[40,55,41],256],9339:[[40,56,41],256],9340:[[40,57,41],256],9341:[[40,49,48,41],256],9342:[[40,49,49,41],256],9343:[[40,49,50,41],256],9344:[[40,49,51,41],256],9345:[[40,49,52,41],256],9346:[[40,49,53,41],256],9347:[[40,49,54,41],256],9348:[[40,49,55,41],256],9349:[[40,49,56,41],256],9350:[[40,49,57,41],256],9351:[[40,50,48,41],256],9352:[[49,46],256],9353:[[50,46],256],9354:[[51,46],256],9355:[[52,46],256],9356:[[53,46],256],9357:[[54,46],256],9358:[[55,46],256],9359:[[56,46],256],9360:[[57,46],256],9361:[[49,48,46],256],9362:[[49,49,46],256],9363:[[49,50,46],256],9364:[[49,51,46],256],9365:[[49,52,46],256],9366:[[49,53,46],256],9367:[[49,54,46],256],9368:[[49,55,46],256],9369:[[49,56,46],256],9370:[[49,57,46],256],9371:[[50,48,46],256],9372:[[40,97,41],256],9373:[[40,98,41],256],9374:[[40,99,41],256],9375:[[40,100,41],256],9376:[[40,101,41],256],9377:[[40,102,41],256],9378:[[40,103,41],256],9379:[[40,104,41],256],9380:[[40,105,41],256],9381:[[40,106,41],256],9382:[[40,107,41],256],9383:[[40,108,41],256],9384:[[40,109,41],256],9385:[[40,110,41],256],9386:[[40,111,41],256],9387:[[40,112,41],256],9388:[[40,113,41],256],9389:[[40,114,41],256],9390:[[40,115,41],256],9391:[[40,116,41],256],9392:[[40,117,41],256],9393:[[40,118,41],256],9394:[[40,119,41],256],9395:[[40,120,41],256],9396:[[40,121,41],256],9397:[[40,122,41],256],9398:[[65],256],9399:[[66],256],9400:[[67],256],9401:[[68],256],9402:[[69],256],9403:[[70],256],9404:[[71],256],9405:[[72],256],9406:[[73],256],9407:[[74],256],9408:[[75],256],9409:[[76],256],9410:[[77],256],9411:[[78],256],9412:[[79],256],9413:[[80],256],9414:[[81],256],9415:[[82],256],9416:[[83],256],9417:[[84],256],9418:[[85],256],9419:[[86],256],9420:[[87],256],9421:[[88],256],9422:[[89],256],9423:[[90],256],9424:[[97],256],9425:[[98],256],9426:[[99],256],9427:[[100],256],9428:[[101],256],9429:[[102],256],9430:[[103],256],9431:[[104],256],9432:[[105],256],9433:[[106],256],9434:[[107],256],9435:[[108],256],9436:[[109],256],9437:[[110],256],9438:[[111],256],9439:[[112],256],9440:[[113],256],9441:[[114],256],9442:[[115],256],9443:[[116],256],9444:[[117],256],9445:[[118],256],9446:[[119],256],9447:[[120],256],9448:[[121],256],9449:[[122],256],9450:[[48],256]},10752:{10764:[[8747,8747,8747,8747],256],10868:[[58,58,61],256],10869:[[61,61],256],10870:[[61,61,61],256],10972:[[10973,824],512]},11264:{11388:[[106],256],11389:[[86],256],11503:[,230],11504:[,230],11505:[,230]},11520:{11631:[[11617],256],11647:[,9],11744:[,230],11745:[,230],11746:[,230],11747:[,230],11748:[,230],11749:[,230],11750:[,230],11751:[,230],11752:[,230],11753:[,230],11754:[,230],11755:[,230],11756:[,230],11757:[,230],11758:[,230],11759:[,230],11760:[,230],11761:[,230],11762:[,230],11763:[,230],11764:[,230],11765:[,230],11766:[,230],11767:[,230],11768:[,230],11769:[,230],11770:[,230],11771:[,230],11772:[,230],11773:[,230],11774:[,230],11775:[,230]},11776:{11935:[[27597],256],12019:[[40863],256]},12032:{12032:[[19968],256],12033:[[20008],256],12034:[[20022],256],12035:[[20031],256],12036:[[20057],256],12037:[[20101],256],12038:[[20108],256],12039:[[20128],256],12040:[[20154],256],12041:[[20799],256],12042:[[20837],256],12043:[[20843],256],12044:[[20866],256],12045:[[20886],256],12046:[[20907],256],12047:[[20960],256],12048:[[20981],256],12049:[[20992],256],12050:[[21147],256],12051:[[21241],256],12052:[[21269],256],12053:[[21274],256],12054:[[21304],256],12055:[[21313],256],12056:[[21340],256],12057:[[21353],256],12058:[[21378],256],12059:[[21430],256],12060:[[21448],256],12061:[[21475],256],12062:[[22231],256],12063:[[22303],256],12064:[[22763],256],12065:[[22786],256],12066:[[22794],256],12067:[[22805],256],12068:[[22823],256],12069:[[22899],256],12070:[[23376],256],12071:[[23424],256],12072:[[23544],256],12073:[[23567],256],12074:[[23586],256],12075:[[23608],256],12076:[[23662],256],12077:[[23665],256],12078:[[24027],256],12079:[[24037],256],12080:[[24049],256],12081:[[24062],256],12082:[[24178],256],12083:[[24186],256],12084:[[24191],256],12085:[[24308],256],12086:[[24318],256],12087:[[24331],256],12088:[[24339],256],12089:[[24400],256],12090:[[24417],256],12091:[[24435],256],12092:[[24515],256],12093:[[25096],256],12094:[[25142],256],12095:[[25163],256],12096:[[25903],256],12097:[[25908],256],12098:[[25991],256],12099:[[26007],256],12100:[[26020],256],12101:[[26041],256],12102:[[26080],256],12103:[[26085],256],12104:[[26352],256],12105:[[26376],256],12106:[[26408],256],12107:[[27424],256],12108:[[27490],256],12109:[[27513],256],12110:[[27571],256],12111:[[27595],256],12112:[[27604],256],12113:[[27611],256],12114:[[27663],256],12115:[[27668],256],12116:[[27700],256],12117:[[28779],256],12118:[[29226],256],12119:[[29238],256],12120:[[29243],256],12121:[[29247],256],12122:[[29255],256],12123:[[29273],256],12124:[[29275],256],12125:[[29356],256],12126:[[29572],256],12127:[[29577],256],12128:[[29916],256],12129:[[29926],256],12130:[[29976],256],12131:[[29983],256],12132:[[29992],256],12133:[[3e4],256],12134:[[30091],256],12135:[[30098],256],12136:[[30326],256],12137:[[30333],256],12138:[[30382],256],12139:[[30399],256],12140:[[30446],256],12141:[[30683],256],12142:[[30690],256],12143:[[30707],256],12144:[[31034],256],12145:[[31160],256],12146:[[31166],256],12147:[[31348],256],12148:[[31435],256],12149:[[31481],256],12150:[[31859],256],12151:[[31992],256],12152:[[32566],256],12153:[[32593],256],12154:[[32650],256],12155:[[32701],256],12156:[[32769],256],12157:[[32780],256],12158:[[32786],256],12159:[[32819],256],12160:[[32895],256],12161:[[32905],256],12162:[[33251],256],12163:[[33258],256],12164:[[33267],256],12165:[[33276],256],12166:[[33292],256],12167:[[33307],256],12168:[[33311],256],12169:[[33390],256],12170:[[33394],256],12171:[[33400],256],12172:[[34381],256],12173:[[34411],256],12174:[[34880],256],12175:[[34892],256],12176:[[34915],256],12177:[[35198],256],12178:[[35211],256],12179:[[35282],256],12180:[[35328],256],12181:[[35895],256],12182:[[35910],256],12183:[[35925],256],12184:[[35960],256],12185:[[35997],256],12186:[[36196],256],12187:[[36208],256],12188:[[36275],256],12189:[[36523],256],12190:[[36554],256],12191:[[36763],256],12192:[[36784],256],12193:[[36789],256],12194:[[37009],256],12195:[[37193],256],12196:[[37318],256],12197:[[37324],256],12198:[[37329],256],12199:[[38263],256],12200:[[38272],256],12201:[[38428],256],12202:[[38582],256],12203:[[38585],256],12204:[[38632],256],12205:[[38737],256],12206:[[38750],256],12207:[[38754],256],12208:[[38761],256],12209:[[38859],256],12210:[[38893],256],12211:[[38899],256],12212:[[38913],256],12213:[[39080],256],12214:[[39131],256],12215:[[39135],256],12216:[[39318],256],12217:[[39321],256],12218:[[39340],256],12219:[[39592],256],12220:[[39640],256],12221:[[39647],256],12222:[[39717],256],12223:[[39727],256],12224:[[39730],256],12225:[[39740],256],12226:[[39770],256],12227:[[40165],256],12228:[[40565],256],12229:[[40575],256],12230:[[40613],256],12231:[[40635],256],12232:[[40643],256],12233:[[40653],256],12234:[[40657],256],12235:[[40697],256],12236:[[40701],256],12237:[[40718],256],12238:[[40723],256],12239:[[40736],256],12240:[[40763],256],12241:[[40778],256],12242:[[40786],256],12243:[[40845],256],12244:[[40860],256],12245:[[40864],256]},12288:{12288:[[32],256],12330:[,218],12331:[,228],12332:[,232],12333:[,222],12334:[,224],12335:[,224],12342:[[12306],256],12344:[[21313],256],12345:[[21316],256],12346:[[21317],256],12358:[,,{12441:12436}],12363:[,,{12441:12364}],12364:[[12363,12441]],12365:[,,{12441:12366}],12366:[[12365,12441]],12367:[,,{12441:12368}],12368:[[12367,12441]],12369:[,,{12441:12370}],12370:[[12369,12441]],12371:[,,{12441:12372}],12372:[[12371,12441]],12373:[,,{12441:12374}],12374:[[12373,12441]],12375:[,,{12441:12376}],12376:[[12375,12441]],12377:[,,{12441:12378}],12378:[[12377,12441]],12379:[,,{12441:12380}],12380:[[12379,12441]],12381:[,,{12441:12382}],12382:[[12381,12441]],12383:[,,{12441:12384}],12384:[[12383,12441]],12385:[,,{12441:12386}],12386:[[12385,12441]],12388:[,,{12441:12389}],12389:[[12388,12441]],12390:[,,{12441:12391}],12391:[[12390,12441]],12392:[,,{12441:12393}],12393:[[12392,12441]],12399:[,,{12441:12400,12442:12401}],12400:[[12399,12441]],12401:[[12399,12442]],12402:[,,{12441:12403,12442:12404}],12403:[[12402,12441]],12404:[[12402,12442]],12405:[,,{12441:12406,12442:12407}],12406:[[12405,12441]],12407:[[12405,12442]],12408:[,,{12441:12409,12442:12410}],12409:[[12408,12441]],12410:[[12408,12442]],12411:[,,{12441:12412,12442:12413}],12412:[[12411,12441]],12413:[[12411,12442]],12436:[[12358,12441]],12441:[,8],12442:[,8],12443:[[32,12441],256],12444:[[32,12442],256],12445:[,,{12441:12446}],12446:[[12445,12441]],12447:[[12424,12426],256],12454:[,,{12441:12532}],12459:[,,{12441:12460}],12460:[[12459,12441]],12461:[,,{12441:12462}],12462:[[12461,12441]],12463:[,,{12441:12464}],12464:[[12463,12441]],12465:[,,{12441:12466}],12466:[[12465,12441]],12467:[,,{12441:12468}],12468:[[12467,12441]],12469:[,,{12441:12470}],12470:[[12469,12441]],12471:[,,{12441:12472}],12472:[[12471,12441]],12473:[,,{12441:12474}],12474:[[12473,12441]],12475:[,,{12441:12476}],12476:[[12475,12441]],12477:[,,{12441:12478}],12478:[[12477,12441]],12479:[,,{12441:12480}],12480:[[12479,12441]],12481:[,,{12441:12482}],12482:[[12481,12441]],12484:[,,{12441:12485}],12485:[[12484,12441]],12486:[,,{12441:12487}],12487:[[12486,12441]],12488:[,,{12441:12489}],12489:[[12488,12441]],12495:[,,{12441:12496,12442:12497}],12496:[[12495,12441]],12497:[[12495,12442]],12498:[,,{12441:12499,12442:12500}],12499:[[12498,12441]],12500:[[12498,12442]],12501:[,,{12441:12502,12442:12503}],12502:[[12501,12441]],12503:[[12501,12442]],12504:[,,{12441:12505,12442:12506}],12505:[[12504,12441]],12506:[[12504,12442]],12507:[,,{12441:12508,12442:12509}],12508:[[12507,12441]],12509:[[12507,12442]],12527:[,,{12441:12535}],12528:[,,{12441:12536}],12529:[,,{12441:12537}],12530:[,,{12441:12538}],12532:[[12454,12441]],12535:[[12527,12441]],12536:[[12528,12441]],12537:[[12529,12441]],12538:[[12530,12441]],12541:[,,{12441:12542}],12542:[[12541,12441]],12543:[[12467,12488],256]},12544:{12593:[[4352],256],12594:[[4353],256],12595:[[4522],256],12596:[[4354],256],12597:[[4524],256],12598:[[4525],256],12599:[[4355],256],12600:[[4356],256],12601:[[4357],256],12602:[[4528],256],12603:[[4529],256],12604:[[4530],256],12605:[[4531],256],12606:[[4532],256],12607:[[4533],256],12608:[[4378],256],12609:[[4358],256],12610:[[4359],256],12611:[[4360],256],12612:[[4385],256],12613:[[4361],256],12614:[[4362],256],12615:[[4363],256],12616:[[4364],256],12617:[[4365],256],12618:[[4366],256],12619:[[4367],256],12620:[[4368],256],12621:[[4369],256],12622:[[4370],256],12623:[[4449],256],12624:[[4450],256],12625:[[4451],256],12626:[[4452],256],12627:[[4453],256],12628:[[4454],256],12629:[[4455],256],12630:[[4456],256],12631:[[4457],256],12632:[[4458],256],12633:[[4459],256],12634:[[4460],256],12635:[[4461],256],12636:[[4462],256],12637:[[4463],256],12638:[[4464],256],12639:[[4465],256],12640:[[4466],256],12641:[[4467],256],12642:[[4468],256],12643:[[4469],256],12644:[[4448],256],12645:[[4372],256],12646:[[4373],256],12647:[[4551],256],12648:[[4552],256],12649:[[4556],256],12650:[[4558],256],12651:[[4563],256],12652:[[4567],256],12653:[[4569],256],12654:[[4380],256],12655:[[4573],256],12656:[[4575],256],12657:[[4381],256],12658:[[4382],256],12659:[[4384],256],12660:[[4386],256],12661:[[4387],256],12662:[[4391],256],12663:[[4393],256],12664:[[4395],256],12665:[[4396],256],12666:[[4397],256],12667:[[4398],256],12668:[[4399],256],12669:[[4402],256],12670:[[4406],256],12671:[[4416],256],12672:[[4423],256],12673:[[4428],256],12674:[[4593],256],12675:[[4594],256],12676:[[4439],256],12677:[[4440],256],12678:[[4441],256],12679:[[4484],256],12680:[[4485],256],12681:[[4488],256],12682:[[4497],256],12683:[[4498],256],12684:[[4500],256],12685:[[4510],256],12686:[[4513],256],12690:[[19968],256],12691:[[20108],256],12692:[[19977],256],12693:[[22235],256],12694:[[19978],256],12695:[[20013],256],12696:[[19979],256],12697:[[30002],256],12698:[[20057],256],12699:[[19993],256],12700:[[19969],256],12701:[[22825],256],12702:[[22320],256],12703:[[20154],256]},12800:{12800:[[40,4352,41],256],12801:[[40,4354,41],256],12802:[[40,4355,41],256],12803:[[40,4357,41],256],12804:[[40,4358,41],256],12805:[[40,4359,41],256],12806:[[40,4361,41],256],12807:[[40,4363,41],256],12808:[[40,4364,41],256],12809:[[40,4366,41],256],12810:[[40,4367,41],256],12811:[[40,4368,41],256],12812:[[40,4369,41],256],12813:[[40,4370,41],256],12814:[[40,4352,4449,41],256],12815:[[40,4354,4449,41],256],12816:[[40,4355,4449,41],256],12817:[[40,4357,4449,41],256],12818:[[40,4358,4449,41],256],12819:[[40,4359,4449,41],256],12820:[[40,4361,4449,41],256],12821:[[40,4363,4449,41],256],12822:[[40,4364,4449,41],256],12823:[[40,4366,4449,41],256],12824:[[40,4367,4449,41],256],12825:[[40,4368,4449,41],256],12826:[[40,4369,4449,41],256],12827:[[40,4370,4449,41],256],12828:[[40,4364,4462,41],256],12829:[[40,4363,4457,4364,4453,4523,41],256],12830:[[40,4363,4457,4370,4462,41],256],12832:[[40,19968,41],256],12833:[[40,20108,41],256],12834:[[40,19977,41],256],12835:[[40,22235,41],256],12836:[[40,20116,41],256],12837:[[40,20845,41],256],12838:[[40,19971,41],256],12839:[[40,20843,41],256],12840:[[40,20061,41],256],12841:[[40,21313,41],256],12842:[[40,26376,41],256],12843:[[40,28779,41],256],12844:[[40,27700,41],256],12845:[[40,26408,41],256],12846:[[40,37329,41],256],12847:[[40,22303,41],256],12848:[[40,26085,41],256],12849:[[40,26666,41],256],12850:[[40,26377,41],256],12851:[[40,31038,41],256],12852:[[40,21517,41],256],12853:[[40,29305,41],256],12854:[[40,36001,41],256],12855:[[40,31069,41],256],12856:[[40,21172,41],256],12857:[[40,20195,41],256],12858:[[40,21628,41],256],12859:[[40,23398,41],256],12860:[[40,30435,41],256],12861:[[40,20225,41],256],12862:[[40,36039,41],256],12863:[[40,21332,41],256],12864:[[40,31085,41],256],12865:[[40,20241,41],256],12866:[[40,33258,41],256],12867:[[40,33267,41],256],12868:[[21839],256],12869:[[24188],256],12870:[[25991],256],12871:[[31631],256],12880:[[80,84,69],256],12881:[[50,49],256],12882:[[50,50],256],12883:[[50,51],256],12884:[[50,52],256],12885:[[50,53],256],12886:[[50,54],256],12887:[[50,55],256],12888:[[50,56],256],12889:[[50,57],256],12890:[[51,48],256],12891:[[51,49],256],12892:[[51,50],256],12893:[[51,51],256],12894:[[51,52],256],12895:[[51,53],256],12896:[[4352],256],12897:[[4354],256],12898:[[4355],256],12899:[[4357],256],12900:[[4358],256],12901:[[4359],256],12902:[[4361],256],12903:[[4363],256],12904:[[4364],256],12905:[[4366],256],12906:[[4367],256],12907:[[4368],256],12908:[[4369],256],12909:[[4370],256],12910:[[4352,4449],256],12911:[[4354,4449],256],12912:[[4355,4449],256],12913:[[4357,4449],256],12914:[[4358,4449],256],12915:[[4359,4449],256],12916:[[4361,4449],256],12917:[[4363,4449],256],12918:[[4364,4449],256],12919:[[4366,4449],256],12920:[[4367,4449],256],12921:[[4368,4449],256],12922:[[4369,4449],256],12923:[[4370,4449],256],12924:[[4366,4449,4535,4352,4457],256],12925:[[4364,4462,4363,4468],256],12926:[[4363,4462],256],12928:[[19968],256],12929:[[20108],256],12930:[[19977],256],12931:[[22235],256],12932:[[20116],256],12933:[[20845],256],12934:[[19971],256],12935:[[20843],256],12936:[[20061],256],12937:[[21313],256],12938:[[26376],256],12939:[[28779],256],12940:[[27700],256],12941:[[26408],256],12942:[[37329],256],12943:[[22303],256],12944:[[26085],256],12945:[[26666],256],12946:[[26377],256],12947:[[31038],256],12948:[[21517],256],12949:[[29305],256],12950:[[36001],256],12951:[[31069],256],12952:[[21172],256],12953:[[31192],256],12954:[[30007],256],12955:[[22899],256],12956:[[36969],256],12957:[[20778],256],12958:[[21360],256],12959:[[27880],256],12960:[[38917],256],12961:[[20241],256],12962:[[20889],256],12963:[[27491],256],12964:[[19978],256],12965:[[20013],256],12966:[[19979],256],12967:[[24038],256],12968:[[21491],256],12969:[[21307],256],12970:[[23447],256],12971:[[23398],256],12972:[[30435],256],12973:[[20225],256],12974:[[36039],256],12975:[[21332],256],12976:[[22812],256],12977:[[51,54],256],12978:[[51,55],256],12979:[[51,56],256],12980:[[51,57],256],12981:[[52,48],256],12982:[[52,49],256],12983:[[52,50],256],12984:[[52,51],256],12985:[[52,52],256],12986:[[52,53],256],12987:[[52,54],256],12988:[[52,55],256],12989:[[52,56],256],12990:[[52,57],256],12991:[[53,48],256],12992:[[49,26376],256],12993:[[50,26376],256],12994:[[51,26376],256],12995:[[52,26376],256],12996:[[53,26376],256],12997:[[54,26376],256],12998:[[55,26376],256],12999:[[56,26376],256],13e3:[[57,26376],256],13001:[[49,48,26376],256],13002:[[49,49,26376],256],13003:[[49,50,26376],256],13004:[[72,103],256],13005:[[101,114,103],256],13006:[[101,86],256],13007:[[76,84,68],256],13008:[[12450],256],13009:[[12452],256],13010:[[12454],256],13011:[[12456],256],13012:[[12458],256],13013:[[12459],256],13014:[[12461],256],13015:[[12463],256],13016:[[12465],256],13017:[[12467],256],13018:[[12469],256],13019:[[12471],256],13020:[[12473],256],13021:[[12475],256],13022:[[12477],256],13023:[[12479],256],13024:[[12481],256],13025:[[12484],256],13026:[[12486],256],13027:[[12488],256],13028:[[12490],256],13029:[[12491],256],13030:[[12492],256],13031:[[12493],256],13032:[[12494],256],13033:[[12495],256],13034:[[12498],256],13035:[[12501],256],13036:[[12504],256],13037:[[12507],256],13038:[[12510],256],13039:[[12511],256],13040:[[12512],256],13041:[[12513],256],13042:[[12514],256],13043:[[12516],256],13044:[[12518],256],13045:[[12520],256],13046:[[12521],256],13047:[[12522],256],13048:[[12523],256],13049:[[12524],256],13050:[[12525],256],13051:[[12527],256],13052:[[12528],256],13053:[[12529],256],13054:[[12530],256]},13056:{13056:[[12450,12497,12540,12488],256],13057:[[12450,12523,12501,12449],256],13058:[[12450,12531,12506,12450],256],13059:[[12450,12540,12523],256],13060:[[12452,12491,12531,12464],256],13061:[[12452,12531,12481],256],13062:[[12454,12457,12531],256],13063:[[12456,12473,12463,12540,12489],256],13064:[[12456,12540,12459,12540],256],13065:[[12458,12531,12473],256],13066:[[12458,12540,12512],256],13067:[[12459,12452,12522],256],13068:[[12459,12521,12483,12488],256],13069:[[12459,12525,12522,12540],256],13070:[[12460,12525,12531],256],13071:[[12460,12531,12510],256],13072:[[12462,12460],256],13073:[[12462,12491,12540],256],13074:[[12461,12517,12522,12540],256],13075:[[12462,12523,12480,12540],256],13076:[[12461,12525],256],13077:[[12461,12525,12464,12521,12512],256],13078:[[12461,12525,12513,12540,12488,12523],256],13079:[[12461,12525,12527,12483,12488],256],13080:[[12464,12521,12512],256],13081:[[12464,12521,12512,12488,12531],256],13082:[[12463,12523,12476,12452,12525],256],13083:[[12463,12525,12540,12493],256],13084:[[12465,12540,12473],256],13085:[[12467,12523,12490],256],13086:[[12467,12540,12509],256],13087:[[12469,12452,12463,12523],256],13088:[[12469,12531,12481,12540,12512],256],13089:[[12471,12522,12531,12464],256],13090:[[12475,12531,12481],256],13091:[[12475,12531,12488],256],13092:[[12480,12540,12473],256],13093:[[12487,12471],256],13094:[[12489,12523],256],13095:[[12488,12531],256],13096:[[12490,12494],256],13097:[[12494,12483,12488],256],13098:[[12495,12452,12484],256],13099:[[12497,12540,12475,12531,12488],256],13100:[[12497,12540,12484],256],13101:[[12496,12540,12524,12523],256],13102:[[12500,12450,12473,12488,12523],256],13103:[[12500,12463,12523],256],13104:[[12500,12467],256],13105:[[12499,12523],256],13106:[[12501,12449,12521,12483,12489],256],13107:[[12501,12451,12540,12488],256],13108:[[12502,12483,12471,12455,12523],256],13109:[[12501,12521,12531],256],13110:[[12504,12463,12479,12540,12523],256],13111:[[12506,12477],256],13112:[[12506,12491,12498],256],13113:[[12504,12523,12484],256],13114:[[12506,12531,12473],256],13115:[[12506,12540,12472],256],13116:[[12505,12540,12479],256],13117:[[12509,12452,12531,12488],256],13118:[[12508,12523,12488],256],13119:[[12507,12531],256],13120:[[12509,12531,12489],256],13121:[[12507,12540,12523],256],13122:[[12507,12540,12531],256],13123:[[12510,12452,12463,12525],256],13124:[[12510,12452,12523],256],13125:[[12510,12483,12495],256],13126:[[12510,12523,12463],256],13127:[[12510,12531,12471,12519,12531],256],13128:[[12511,12463,12525,12531],256],13129:[[12511,12522],256],13130:[[12511,12522,12496,12540,12523],256],13131:[[12513,12460],256],13132:[[12513,12460,12488,12531],256],13133:[[12513,12540,12488,12523],256],13134:[[12516,12540,12489],256],13135:[[12516,12540,12523],256],13136:[[12518,12450,12531],256],13137:[[12522,12483,12488,12523],256],13138:[[12522,12521],256],13139:[[12523,12500,12540],256],13140:[[12523,12540,12502,12523],256],13141:[[12524,12512],256],13142:[[12524,12531,12488,12466,12531],256],13143:[[12527,12483,12488],256],13144:[[48,28857],256],13145:[[49,28857],256],13146:[[50,28857],256],13147:[[51,28857],256],13148:[[52,28857],256],13149:[[53,28857],256],13150:[[54,28857],256],13151:[[55,28857],256],13152:[[56,28857],256],13153:[[57,28857],256],13154:[[49,48,28857],256],13155:[[49,49,28857],256],13156:[[49,50,28857],256],13157:[[49,51,28857],256],13158:[[49,52,28857],256],13159:[[49,53,28857],256],13160:[[49,54,28857],256],13161:[[49,55,28857],256],13162:[[49,56,28857],256],13163:[[49,57,28857],256],13164:[[50,48,28857],256],13165:[[50,49,28857],256],13166:[[50,50,28857],256],13167:[[50,51,28857],256],13168:[[50,52,28857],256],13169:[[104,80,97],256],13170:[[100,97],256],13171:[[65,85],256],13172:[[98,97,114],256],13173:[[111,86],256],13174:[[112,99],256],13175:[[100,109],256],13176:[[100,109,178],256],13177:[[100,109,179],256],13178:[[73,85],256],13179:[[24179,25104],256],13180:[[26157,21644],256],13181:[[22823,27491],256],13182:[[26126,27835],256],13183:[[26666,24335,20250,31038],256],13184:[[112,65],256],13185:[[110,65],256],13186:[[956,65],256],13187:[[109,65],256],13188:[[107,65],256],13189:[[75,66],256],13190:[[77,66],256],13191:[[71,66],256],13192:[[99,97,108],256],13193:[[107,99,97,108],256],13194:[[112,70],256],13195:[[110,70],256],13196:[[956,70],256],13197:[[956,103],256],13198:[[109,103],256],13199:[[107,103],256],13200:[[72,122],256],13201:[[107,72,122],256],13202:[[77,72,122],256],13203:[[71,72,122],256],13204:[[84,72,122],256],13205:[[956,8467],256],13206:[[109,8467],256],13207:[[100,8467],256],13208:[[107,8467],256],13209:[[102,109],256],13210:[[110,109],256],13211:[[956,109],256],13212:[[109,109],256],13213:[[99,109],256],13214:[[107,109],256],13215:[[109,109,178],256],13216:[[99,109,178],256],13217:[[109,178],256],13218:[[107,109,178],256],13219:[[109,109,179],256],13220:[[99,109,179],256],13221:[[109,179],256],13222:[[107,109,179],256],13223:[[109,8725,115],256],13224:[[109,8725,115,178],256],13225:[[80,97],256],13226:[[107,80,97],256],13227:[[77,80,97],256],13228:[[71,80,97],256],13229:[[114,97,100],256],13230:[[114,97,100,8725,115],256],13231:[[114,97,100,8725,115,178],256],13232:[[112,115],256],13233:[[110,115],256],13234:[[956,115],256],13235:[[109,115],256],13236:[[112,86],256],13237:[[110,86],256],13238:[[956,86],256],13239:[[109,86],256],13240:[[107,86],256],13241:[[77,86],256],13242:[[112,87],256],13243:[[110,87],256],13244:[[956,87],256],13245:[[109,87],256],13246:[[107,87],256],13247:[[77,87],256],13248:[[107,937],256],13249:[[77,937],256],13250:[[97,46,109,46],256],13251:[[66,113],256],13252:[[99,99],256],13253:[[99,100],256],13254:[[67,8725,107,103],256],13255:[[67,111,46],256],13256:[[100,66],256],13257:[[71,121],256],13258:[[104,97],256],13259:[[72,80],256],13260:[[105,110],256],13261:[[75,75],256],13262:[[75,77],256],13263:[[107,116],256],13264:[[108,109],256],13265:[[108,110],256],13266:[[108,111,103],256],13267:[[108,120],256],13268:[[109,98],256],13269:[[109,105,108],256],13270:[[109,111,108],256],13271:[[80,72],256],13272:[[112,46,109,46],256],13273:[[80,80,77],256],13274:[[80,82],256],13275:[[115,114],256],13276:[[83,118],256],13277:[[87,98],256],13278:[[86,8725,109],256],13279:[[65,8725,109],256],13280:[[49,26085],256],13281:[[50,26085],256],13282:[[51,26085],256],13283:[[52,26085],256],13284:[[53,26085],256],13285:[[54,26085],256],13286:[[55,26085],256],13287:[[56,26085],256],13288:[[57,26085],256],13289:[[49,48,26085],256],13290:[[49,49,26085],256],13291:[[49,50,26085],256],13292:[[49,51,26085],256],13293:[[49,52,26085],256],13294:[[49,53,26085],256],13295:[[49,54,26085],256],13296:[[49,55,26085],256],13297:[[49,56,26085],256],13298:[[49,57,26085],256],13299:[[50,48,26085],256],13300:[[50,49,26085],256],13301:[[50,50,26085],256],13302:[[50,51,26085],256],13303:[[50,52,26085],256],13304:[[50,53,26085],256],13305:[[50,54,26085],256],13306:[[50,55,26085],256],13307:[[50,56,26085],256],13308:[[50,57,26085],256],13309:[[51,48,26085],256],13310:[[51,49,26085],256],13311:[[103,97,108],256]},27136:{92912:[,1],92913:[,1],92914:[,1],92915:[,1],92916:[,1]},27392:{92976:[,230],92977:[,230],92978:[,230],92979:[,230],92980:[,230],92981:[,230],92982:[,230]},42496:{42607:[,230],42612:[,230],42613:[,230],42614:[,230],42615:[,230],42616:[,230],42617:[,230],42618:[,230],42619:[,230],42620:[,230],42621:[,230],42652:[[1098],256],42653:[[1100],256],42655:[,230],42736:[,230],42737:[,230]},42752:{42864:[[42863],256],43e3:[[294],256],43001:[[339],256]},43008:{43014:[,9],43204:[,9],43232:[,230],43233:[,230],43234:[,230],43235:[,230],43236:[,230],43237:[,230],43238:[,230],43239:[,230],43240:[,230],43241:[,230],43242:[,230],43243:[,230],43244:[,230],43245:[,230],43246:[,230],43247:[,230],43248:[,230],43249:[,230]},43264:{43307:[,220],43308:[,220],43309:[,220],43347:[,9],43443:[,7],43456:[,9]},43520:{43696:[,230],43698:[,230],43699:[,230],43700:[,220],43703:[,230],43704:[,230],43710:[,230],43711:[,230],43713:[,230],43766:[,9]},43776:{43868:[[42791],256],43869:[[43831],256],43870:[[619],256],43871:[[43858],256],44013:[,9]},48128:{113822:[,1]},53504:{119134:[[119127,119141],512],119135:[[119128,119141],512],119136:[[119135,119150],512],119137:[[119135,119151],512],119138:[[119135,119152],512],119139:[[119135,119153],512],119140:[[119135,119154],512],119141:[,216],119142:[,216],119143:[,1],119144:[,1],119145:[,1],119149:[,226],119150:[,216],119151:[,216],119152:[,216],119153:[,216],119154:[,216],119163:[,220],119164:[,220],119165:[,220],119166:[,220],119167:[,220],119168:[,220],119169:[,220],119170:[,220],119173:[,230],119174:[,230],119175:[,230],119176:[,230],119177:[,230],119178:[,220],119179:[,220],119210:[,230],119211:[,230],119212:[,230],119213:[,230],119227:[[119225,119141],512],119228:[[119226,119141],512],119229:[[119227,119150],512],119230:[[119228,119150],512],119231:[[119227,119151],512],119232:[[119228,119151],512]},53760:{119362:[,230],119363:[,230],119364:[,230]},54272:{119808:[[65],256],119809:[[66],256],119810:[[67],256],119811:[[68],256],119812:[[69],256],119813:[[70],256],119814:[[71],256],119815:[[72],256],119816:[[73],256],119817:[[74],256],119818:[[75],256],119819:[[76],256],119820:[[77],256],119821:[[78],256],119822:[[79],256],119823:[[80],256],119824:[[81],256],119825:[[82],256],119826:[[83],256],119827:[[84],256],119828:[[85],256],119829:[[86],256],119830:[[87],256],119831:[[88],256],119832:[[89],256],119833:[[90],256],119834:[[97],256],119835:[[98],256],119836:[[99],256],119837:[[100],256],119838:[[101],256],119839:[[102],256],119840:[[103],256],119841:[[104],256],119842:[[105],256],119843:[[106],256],119844:[[107],256],119845:[[108],256],119846:[[109],256],119847:[[110],256],119848:[[111],256],119849:[[112],256],119850:[[113],256],119851:[[114],256],119852:[[115],256],119853:[[116],256],119854:[[117],256],119855:[[118],256],119856:[[119],256],119857:[[120],256],119858:[[121],256],119859:[[122],256],119860:[[65],256],119861:[[66],256],119862:[[67],256],119863:[[68],256],119864:[[69],256],119865:[[70],256],119866:[[71],256],119867:[[72],256],119868:[[73],256],119869:[[74],256],119870:[[75],256],119871:[[76],256],119872:[[77],256],119873:[[78],256],119874:[[79],256],119875:[[80],256],119876:[[81],256],119877:[[82],256],119878:[[83],256],119879:[[84],256],119880:[[85],256],119881:[[86],256],119882:[[87],256],119883:[[88],256],119884:[[89],256],119885:[[90],256],119886:[[97],256],119887:[[98],256],119888:[[99],256],119889:[[100],256],119890:[[101],256],119891:[[102],256],119892:[[103],256],119894:[[105],256],119895:[[106],256],119896:[[107],256],119897:[[108],256],119898:[[109],256],119899:[[110],256],119900:[[111],256],119901:[[112],256],119902:[[113],256],119903:[[114],256],119904:[[115],256],119905:[[116],256],119906:[[117],256],119907:[[118],256],119908:[[119],256],119909:[[120],256],119910:[[121],256],119911:[[122],256],119912:[[65],256],119913:[[66],256],119914:[[67],256],119915:[[68],256],119916:[[69],256],119917:[[70],256],119918:[[71],256],119919:[[72],256],119920:[[73],256],119921:[[74],256],119922:[[75],256],119923:[[76],256],119924:[[77],256],119925:[[78],256],119926:[[79],256],119927:[[80],256],119928:[[81],256],119929:[[82],256],119930:[[83],256],119931:[[84],256],119932:[[85],256],119933:[[86],256],119934:[[87],256],119935:[[88],256],119936:[[89],256],119937:[[90],256],119938:[[97],256],119939:[[98],256],119940:[[99],256],119941:[[100],256],119942:[[101],256],119943:[[102],256],119944:[[103],256],119945:[[104],256],119946:[[105],256],119947:[[106],256],119948:[[107],256],119949:[[108],256],119950:[[109],256],119951:[[110],256],119952:[[111],256],119953:[[112],256],119954:[[113],256],119955:[[114],256],119956:[[115],256],119957:[[116],256],119958:[[117],256],119959:[[118],256],119960:[[119],256],119961:[[120],256],119962:[[121],256],119963:[[122],256],119964:[[65],256],119966:[[67],256],119967:[[68],256],119970:[[71],256],119973:[[74],256],119974:[[75],256],119977:[[78],256],119978:[[79],256],119979:[[80],256],119980:[[81],256],119982:[[83],256],119983:[[84],256],119984:[[85],256],119985:[[86],256],119986:[[87],256],119987:[[88],256],119988:[[89],256],119989:[[90],256],119990:[[97],256],119991:[[98],256],119992:[[99],256],119993:[[100],256],119995:[[102],256],119997:[[104],256],119998:[[105],256],119999:[[106],256],12e4:[[107],256],120001:[[108],256],120002:[[109],256],120003:[[110],256],120005:[[112],256],120006:[[113],256],120007:[[114],256],120008:[[115],256],120009:[[116],256],120010:[[117],256],120011:[[118],256],120012:[[119],256],120013:[[120],256],120014:[[121],256],120015:[[122],256],120016:[[65],256],120017:[[66],256],120018:[[67],256],120019:[[68],256],120020:[[69],256],120021:[[70],256],120022:[[71],256],120023:[[72],256],120024:[[73],256],120025:[[74],256],120026:[[75],256],120027:[[76],256],120028:[[77],256],120029:[[78],256],120030:[[79],256],120031:[[80],256],120032:[[81],256],120033:[[82],256],120034:[[83],256],120035:[[84],256],120036:[[85],256],120037:[[86],256],120038:[[87],256],120039:[[88],256],120040:[[89],256],120041:[[90],256],120042:[[97],256],120043:[[98],256],120044:[[99],256],120045:[[100],256],120046:[[101],256],120047:[[102],256],120048:[[103],256],120049:[[104],256],120050:[[105],256],120051:[[106],256],120052:[[107],256],120053:[[108],256],120054:[[109],256],120055:[[110],256],120056:[[111],256],120057:[[112],256],120058:[[113],256],120059:[[114],256],120060:[[115],256],120061:[[116],256],120062:[[117],256],120063:[[118],256]},54528:{120064:[[119],256],120065:[[120],256],120066:[[121],256],120067:[[122],256],120068:[[65],256],120069:[[66],256],120071:[[68],256],120072:[[69],256],120073:[[70],256],120074:[[71],256],120077:[[74],256],120078:[[75],256],120079:[[76],256],120080:[[77],256],120081:[[78],256],120082:[[79],256],120083:[[80],256],120084:[[81],256],120086:[[83],256],120087:[[84],256],120088:[[85],256],120089:[[86],256],120090:[[87],256],120091:[[88],256],120092:[[89],256],120094:[[97],256],120095:[[98],256],120096:[[99],256],120097:[[100],256],120098:[[101],256],120099:[[102],256],120100:[[103],256],120101:[[104],256],120102:[[105],256],120103:[[106],256],120104:[[107],256],120105:[[108],256],120106:[[109],256],120107:[[110],256],120108:[[111],256],120109:[[112],256],120110:[[113],256],120111:[[114],256],120112:[[115],256],120113:[[116],256],120114:[[117],256],120115:[[118],256],120116:[[119],256],120117:[[120],256],120118:[[121],256],120119:[[122],256],120120:[[65],256],120121:[[66],256],120123:[[68],256],120124:[[69],256],120125:[[70],256],120126:[[71],256],120128:[[73],256],120129:[[74],256],120130:[[75],256],120131:[[76],256],120132:[[77],256],120134:[[79],256],120138:[[83],256],120139:[[84],256],120140:[[85],256],120141:[[86],256],120142:[[87],256],120143:[[88],256],120144:[[89],256],120146:[[97],256],120147:[[98],256],120148:[[99],256],120149:[[100],256],120150:[[101],256],120151:[[102],256],120152:[[103],256],120153:[[104],256],120154:[[105],256],120155:[[106],256],120156:[[107],256],120157:[[108],256],120158:[[109],256],120159:[[110],256],120160:[[111],256],120161:[[112],256],120162:[[113],256],120163:[[114],256],120164:[[115],256],120165:[[116],256],120166:[[117],256],120167:[[118],256],120168:[[119],256],120169:[[120],256],120170:[[121],256],120171:[[122],256],120172:[[65],256],120173:[[66],256],120174:[[67],256],120175:[[68],256],120176:[[69],256],120177:[[70],256],120178:[[71],256],120179:[[72],256],120180:[[73],256],120181:[[74],256],120182:[[75],256],120183:[[76],256],120184:[[77],256],120185:[[78],256],120186:[[79],256],120187:[[80],256],120188:[[81],256],120189:[[82],256],120190:[[83],256],120191:[[84],256],120192:[[85],256],120193:[[86],256],120194:[[87],256],120195:[[88],256],120196:[[89],256],120197:[[90],256],120198:[[97],256],120199:[[98],256],120200:[[99],256],120201:[[100],256],120202:[[101],256],120203:[[102],256],120204:[[103],256],120205:[[104],256],120206:[[105],256],120207:[[106],256],120208:[[107],256],120209:[[108],256],120210:[[109],256],120211:[[110],256],120212:[[111],256],120213:[[112],256],120214:[[113],256],120215:[[114],256],120216:[[115],256],120217:[[116],256],120218:[[117],256],120219:[[118],256],120220:[[119],256],120221:[[120],256],120222:[[121],256],120223:[[122],256],120224:[[65],256],120225:[[66],256],120226:[[67],256],120227:[[68],256],120228:[[69],256],120229:[[70],256],120230:[[71],256],120231:[[72],256],120232:[[73],256],120233:[[74],256],120234:[[75],256],120235:[[76],256],120236:[[77],256],120237:[[78],256],120238:[[79],256],120239:[[80],256],120240:[[81],256],120241:[[82],256],120242:[[83],256],120243:[[84],256],120244:[[85],256],120245:[[86],256],120246:[[87],256],120247:[[88],256],120248:[[89],256],120249:[[90],256],120250:[[97],256],120251:[[98],256],120252:[[99],256],120253:[[100],256],120254:[[101],256],120255:[[102],256],120256:[[103],256],120257:[[104],256],120258:[[105],256],120259:[[106],256],120260:[[107],256],120261:[[108],256],120262:[[109],256],120263:[[110],256],120264:[[111],256],120265:[[112],256],120266:[[113],256],120267:[[114],256],120268:[[115],256],120269:[[116],256],120270:[[117],256],120271:[[118],256],120272:[[119],256],120273:[[120],256],120274:[[121],256],120275:[[122],256],120276:[[65],256],120277:[[66],256],120278:[[67],256],120279:[[68],256],120280:[[69],256],120281:[[70],256],120282:[[71],256],120283:[[72],256],120284:[[73],256],120285:[[74],256],120286:[[75],256],120287:[[76],256],120288:[[77],256],120289:[[78],256],120290:[[79],256],120291:[[80],256],120292:[[81],256],120293:[[82],256],120294:[[83],256],120295:[[84],256],120296:[[85],256],120297:[[86],256],120298:[[87],256],120299:[[88],256],120300:[[89],256],120301:[[90],256],120302:[[97],256],120303:[[98],256],120304:[[99],256],120305:[[100],256],120306:[[101],256],120307:[[102],256],120308:[[103],256],120309:[[104],256],120310:[[105],256],120311:[[106],256],120312:[[107],256],120313:[[108],256],120314:[[109],256],120315:[[110],256],120316:[[111],256],120317:[[112],256],120318:[[113],256],120319:[[114],256]},54784:{120320:[[115],256],120321:[[116],256],120322:[[117],256],120323:[[118],256],120324:[[119],256],120325:[[120],256],120326:[[121],256],120327:[[122],256],120328:[[65],256],120329:[[66],256],120330:[[67],256],120331:[[68],256],120332:[[69],256],120333:[[70],256],120334:[[71],256],120335:[[72],256],120336:[[73],256],120337:[[74],256],120338:[[75],256],120339:[[76],256],120340:[[77],256],120341:[[78],256],120342:[[79],256],120343:[[80],256],120344:[[81],256],120345:[[82],256],120346:[[83],256],120347:[[84],256],120348:[[85],256],120349:[[86],256],120350:[[87],256],120351:[[88],256],120352:[[89],256],120353:[[90],256],120354:[[97],256],120355:[[98],256],120356:[[99],256],120357:[[100],256],120358:[[101],256],120359:[[102],256],120360:[[103],256],120361:[[104],256],120362:[[105],256],120363:[[106],256],120364:[[107],256],120365:[[108],256],120366:[[109],256],120367:[[110],256],120368:[[111],256],120369:[[112],256],120370:[[113],256],120371:[[114],256],120372:[[115],256],120373:[[116],256],120374:[[117],256],120375:[[118],256],120376:[[119],256],120377:[[120],256],120378:[[121],256],120379:[[122],256],120380:[[65],256],120381:[[66],256],120382:[[67],256],120383:[[68],256],120384:[[69],256],120385:[[70],256],120386:[[71],256],120387:[[72],256],120388:[[73],256],120389:[[74],256],120390:[[75],256],120391:[[76],256],120392:[[77],256],120393:[[78],256],120394:[[79],256],120395:[[80],256],120396:[[81],256],120397:[[82],256],120398:[[83],256],120399:[[84],256],120400:[[85],256],120401:[[86],256],120402:[[87],256],120403:[[88],256],120404:[[89],256],120405:[[90],256],120406:[[97],256],120407:[[98],256],120408:[[99],256],120409:[[100],256],120410:[[101],256],120411:[[102],256],120412:[[103],256],120413:[[104],256],120414:[[105],256],120415:[[106],256],120416:[[107],256],120417:[[108],256],120418:[[109],256],120419:[[110],256],120420:[[111],256],120421:[[112],256],120422:[[113],256],120423:[[114],256],120424:[[115],256],120425:[[116],256],120426:[[117],256],120427:[[118],256],120428:[[119],256],120429:[[120],256],120430:[[121],256],120431:[[122],256],120432:[[65],256],120433:[[66],256],120434:[[67],256],120435:[[68],256],120436:[[69],256],120437:[[70],256],120438:[[71],256],120439:[[72],256],120440:[[73],256],120441:[[74],256],120442:[[75],256],120443:[[76],256],120444:[[77],256],120445:[[78],256],120446:[[79],256],120447:[[80],256],120448:[[81],256],120449:[[82],256],120450:[[83],256],120451:[[84],256],120452:[[85],256],120453:[[86],256],120454:[[87],256],120455:[[88],256],120456:[[89],256],120457:[[90],256],120458:[[97],256],120459:[[98],256],120460:[[99],256],120461:[[100],256],120462:[[101],256],120463:[[102],256],120464:[[103],256],120465:[[104],256],120466:[[105],256],120467:[[106],256],120468:[[107],256],120469:[[108],256],120470:[[109],256],120471:[[110],256],120472:[[111],256],120473:[[112],256],120474:[[113],256],120475:[[114],256],120476:[[115],256],120477:[[116],256],120478:[[117],256],120479:[[118],256],120480:[[119],256],120481:[[120],256],120482:[[121],256],120483:[[122],256],120484:[[305],256],120485:[[567],256],120488:[[913],256],120489:[[914],256],120490:[[915],256],120491:[[916],256],120492:[[917],256],120493:[[918],256],120494:[[919],256],120495:[[920],256],120496:[[921],256],120497:[[922],256],120498:[[923],256],120499:[[924],256],120500:[[925],256],120501:[[926],256],120502:[[927],256],120503:[[928],256],120504:[[929],256],120505:[[1012],256],120506:[[931],256],120507:[[932],256],120508:[[933],256],120509:[[934],256],120510:[[935],256],120511:[[936],256],120512:[[937],256],120513:[[8711],256],120514:[[945],256],120515:[[946],256],120516:[[947],256],120517:[[948],256],120518:[[949],256],120519:[[950],256],120520:[[951],256],120521:[[952],256],120522:[[953],256],120523:[[954],256],120524:[[955],256],120525:[[956],256],120526:[[957],256],120527:[[958],256],120528:[[959],256],120529:[[960],256],120530:[[961],256],120531:[[962],256],120532:[[963],256],120533:[[964],256],120534:[[965],256],120535:[[966],256],120536:[[967],256],120537:[[968],256],120538:[[969],256],120539:[[8706],256],120540:[[1013],256],120541:[[977],256],120542:[[1008],256],120543:[[981],256],120544:[[1009],256],120545:[[982],256],120546:[[913],256],120547:[[914],256],120548:[[915],256],120549:[[916],256],120550:[[917],256],120551:[[918],256],120552:[[919],256],120553:[[920],256],120554:[[921],256],120555:[[922],256],120556:[[923],256],120557:[[924],256],120558:[[925],256],120559:[[926],256],120560:[[927],256],120561:[[928],256],120562:[[929],256],120563:[[1012],256],120564:[[931],256],120565:[[932],256],120566:[[933],256],120567:[[934],256],120568:[[935],256],120569:[[936],256],120570:[[937],256],120571:[[8711],256],120572:[[945],256],120573:[[946],256],120574:[[947],256],120575:[[948],256]},55040:{120576:[[949],256],120577:[[950],256],120578:[[951],256],120579:[[952],256],120580:[[953],256],120581:[[954],256],120582:[[955],256],120583:[[956],256],120584:[[957],256],120585:[[958],256],120586:[[959],256],120587:[[960],256],120588:[[961],256],120589:[[962],256],120590:[[963],256],120591:[[964],256],120592:[[965],256],120593:[[966],256],120594:[[967],256],120595:[[968],256],120596:[[969],256],120597:[[8706],256],120598:[[1013],256],120599:[[977],256],120600:[[1008],256],120601:[[981],256],120602:[[1009],256],120603:[[982],256],120604:[[913],256],120605:[[914],256],120606:[[915],256],120607:[[916],256],120608:[[917],256],120609:[[918],256],120610:[[919],256],120611:[[920],256],120612:[[921],256],120613:[[922],256],120614:[[923],256],120615:[[924],256],120616:[[925],256],120617:[[926],256],120618:[[927],256],120619:[[928],256],120620:[[929],256],120621:[[1012],256],120622:[[931],256],120623:[[932],256],120624:[[933],256],120625:[[934],256],120626:[[935],256],120627:[[936],256],120628:[[937],256],120629:[[8711],256],120630:[[945],256],120631:[[946],256],120632:[[947],256],120633:[[948],256],120634:[[949],256],120635:[[950],256],120636:[[951],256],120637:[[952],256],120638:[[953],256],120639:[[954],256],120640:[[955],256],120641:[[956],256],120642:[[957],256],120643:[[958],256],120644:[[959],256],120645:[[960],256],120646:[[961],256],120647:[[962],256],120648:[[963],256],120649:[[964],256],120650:[[965],256],120651:[[966],256],120652:[[967],256],120653:[[968],256],120654:[[969],256],120655:[[8706],256],120656:[[1013],256],120657:[[977],256],120658:[[1008],256],120659:[[981],256],120660:[[1009],256],120661:[[982],256],120662:[[913],256],120663:[[914],256],120664:[[915],256],120665:[[916],256],120666:[[917],256],120667:[[918],256],120668:[[919],256],120669:[[920],256],120670:[[921],256],120671:[[922],256],120672:[[923],256],120673:[[924],256],120674:[[925],256],120675:[[926],256],120676:[[927],256],120677:[[928],256],120678:[[929],256],120679:[[1012],256],120680:[[931],256],120681:[[932],256],120682:[[933],256],120683:[[934],256],120684:[[935],256],120685:[[936],256],120686:[[937],256],120687:[[8711],256],120688:[[945],256],120689:[[946],256],120690:[[947],256],120691:[[948],256],120692:[[949],256],120693:[[950],256],120694:[[951],256],120695:[[952],256],120696:[[953],256],120697:[[954],256],120698:[[955],256],120699:[[956],256],120700:[[957],256],120701:[[958],256],120702:[[959],256],120703:[[960],256],120704:[[961],256],120705:[[962],256],120706:[[963],256],120707:[[964],256],120708:[[965],256],120709:[[966],256],120710:[[967],256],120711:[[968],256],120712:[[969],256],120713:[[8706],256],120714:[[1013],256],120715:[[977],256],120716:[[1008],256],120717:[[981],256],120718:[[1009],256],120719:[[982],256],120720:[[913],256],120721:[[914],256],120722:[[915],256],120723:[[916],256],120724:[[917],256],120725:[[918],256],120726:[[919],256],120727:[[920],256],120728:[[921],256],120729:[[922],256],120730:[[923],256],120731:[[924],256],120732:[[925],256],120733:[[926],256],120734:[[927],256],120735:[[928],256],120736:[[929],256],120737:[[1012],256],120738:[[931],256],120739:[[932],256],120740:[[933],256],120741:[[934],256],120742:[[935],256],120743:[[936],256],120744:[[937],256],120745:[[8711],256],120746:[[945],256],120747:[[946],256],120748:[[947],256],120749:[[948],256],120750:[[949],256],120751:[[950],256],120752:[[951],256],120753:[[952],256],120754:[[953],256],120755:[[954],256],120756:[[955],256],120757:[[956],256],120758:[[957],256],120759:[[958],256],120760:[[959],256],120761:[[960],256],120762:[[961],256],120763:[[962],256],120764:[[963],256],120765:[[964],256],120766:[[965],256],120767:[[966],256],120768:[[967],256],120769:[[968],256],120770:[[969],256],120771:[[8706],256],120772:[[1013],256],120773:[[977],256],120774:[[1008],256],120775:[[981],256],120776:[[1009],256],120777:[[982],256],120778:[[988],256],120779:[[989],256],120782:[[48],256],120783:[[49],256],120784:[[50],256],120785:[[51],256],120786:[[52],256],120787:[[53],256],120788:[[54],256],120789:[[55],256],120790:[[56],256],120791:[[57],256],120792:[[48],256],120793:[[49],256],120794:[[50],256],120795:[[51],256],120796:[[52],256],120797:[[53],256],120798:[[54],256],120799:[[55],256],120800:[[56],256],120801:[[57],256],120802:[[48],256],120803:[[49],256],120804:[[50],256],120805:[[51],256],120806:[[52],256],120807:[[53],256],120808:[[54],256],120809:[[55],256],120810:[[56],256],120811:[[57],256],120812:[[48],256],120813:[[49],256],120814:[[50],256],120815:[[51],256],120816:[[52],256],120817:[[53],256],120818:[[54],256],120819:[[55],256],120820:[[56],256],120821:[[57],256],120822:[[48],256],120823:[[49],256],120824:[[50],256],120825:[[51],256],120826:[[52],256],120827:[[53],256],120828:[[54],256],120829:[[55],256],120830:[[56],256],120831:[[57],256]},59392:{125136:[,220],125137:[,220],125138:[,220],125139:[,220],125140:[,220],125141:[,220],125142:[,220]},60928:{126464:[[1575],256],126465:[[1576],256],126466:[[1580],256],126467:[[1583],256],126469:[[1608],256],126470:[[1586],256],126471:[[1581],256],126472:[[1591],256],126473:[[1610],256],126474:[[1603],256],126475:[[1604],256],126476:[[1605],256],126477:[[1606],256],126478:[[1587],256],126479:[[1593],256],126480:[[1601],256],126481:[[1589],256],126482:[[1602],256],126483:[[1585],256],126484:[[1588],256],126485:[[1578],256],126486:[[1579],256],126487:[[1582],256],126488:[[1584],256],126489:[[1590],256],126490:[[1592],256],126491:[[1594],256],126492:[[1646],256],126493:[[1722],256],126494:[[1697],256],126495:[[1647],256],126497:[[1576],256],126498:[[1580],256],126500:[[1607],256],126503:[[1581],256],126505:[[1610],256],126506:[[1603],256],126507:[[1604],256],126508:[[1605],256],126509:[[1606],256],126510:[[1587],256],126511:[[1593],256],126512:[[1601],256],126513:[[1589],256],126514:[[1602],256],126516:[[1588],256],126517:[[1578],256],126518:[[1579],256],126519:[[1582],256],126521:[[1590],256],126523:[[1594],256],126530:[[1580],256],126535:[[1581],256],126537:[[1610],256],126539:[[1604],256],126541:[[1606],256],126542:[[1587],256],126543:[[1593],256],126545:[[1589],256],126546:[[1602],256],126548:[[1588],256],126551:[[1582],256],126553:[[1590],256],126555:[[1594],256],126557:[[1722],256],126559:[[1647],256],126561:[[1576],256],126562:[[1580],256],126564:[[1607],256],126567:[[1581],256],126568:[[1591],256],126569:[[1610],256],126570:[[1603],256],126572:[[1605],256],126573:[[1606],256],126574:[[1587],256],126575:[[1593],256],126576:[[1601],256],126577:[[1589],256],126578:[[1602],256],126580:[[1588],256],126581:[[1578],256],126582:[[1579],256],126583:[[1582],256],126585:[[1590],256],126586:[[1592],256],126587:[[1594],256],126588:[[1646],256],126590:[[1697],256],126592:[[1575],256],126593:[[1576],256],126594:[[1580],256],126595:[[1583],256],126596:[[1607],256],126597:[[1608],256],126598:[[1586],256],126599:[[1581],256],126600:[[1591],256],126601:[[1610],256],126603:[[1604],256],126604:[[1605],256],126605:[[1606],256],126606:[[1587],256],126607:[[1593],256],126608:[[1601],256],126609:[[1589],256],126610:[[1602],256],126611:[[1585],256],126612:[[1588],256],126613:[[1578],256],126614:[[1579],256],126615:[[1582],256],126616:[[1584],256],126617:[[1590],256],126618:[[1592],256],126619:[[1594],256],126625:[[1576],256],126626:[[1580],256],126627:[[1583],256],126629:[[1608],256],126630:[[1586],256],126631:[[1581],256],126632:[[1591],256],126633:[[1610],256],126635:[[1604],256],126636:[[1605],256],126637:[[1606],256],126638:[[1587],256],126639:[[1593],256],126640:[[1601],256],126641:[[1589],256],126642:[[1602],256],126643:[[1585],256],126644:[[1588],256],126645:[[1578],256],126646:[[1579],256],126647:[[1582],256],126648:[[1584],256],126649:[[1590],256],126650:[[1592],256],126651:[[1594],256]},61696:{127232:[[48,46],256],127233:[[48,44],256],127234:[[49,44],256],127235:[[50,44],256],127236:[[51,44],256],127237:[[52,44],256],127238:[[53,44],256],127239:[[54,44],256],127240:[[55,44],256],127241:[[56,44],256],127242:[[57,44],256],127248:[[40,65,41],256],127249:[[40,66,41],256],127250:[[40,67,41],256],127251:[[40,68,41],256],127252:[[40,69,41],256],127253:[[40,70,41],256],127254:[[40,71,41],256],127255:[[40,72,41],256],127256:[[40,73,41],256],127257:[[40,74,41],256],127258:[[40,75,41],256],127259:[[40,76,41],256],127260:[[40,77,41],256],127261:[[40,78,41],256],127262:[[40,79,41],256],127263:[[40,80,41],256],127264:[[40,81,41],256],127265:[[40,82,41],256],127266:[[40,83,41],256],127267:[[40,84,41],256],127268:[[40,85,41],256],127269:[[40,86,41],256],127270:[[40,87,41],256],127271:[[40,88,41],256],127272:[[40,89,41],256],127273:[[40,90,41],256],127274:[[12308,83,12309],256],127275:[[67],256],127276:[[82],256],127277:[[67,68],256],127278:[[87,90],256],127280:[[65],256],127281:[[66],256],127282:[[67],256],127283:[[68],256],127284:[[69],256],127285:[[70],256],127286:[[71],256],127287:[[72],256],127288:[[73],256],127289:[[74],256],127290:[[75],256],127291:[[76],256],127292:[[77],256],127293:[[78],256],127294:[[79],256],127295:[[80],256],127296:[[81],256],127297:[[82],256],127298:[[83],256],127299:[[84],256],127300:[[85],256],127301:[[86],256],127302:[[87],256],127303:[[88],256],127304:[[89],256],127305:[[90],256],127306:[[72,86],256],127307:[[77,86],256],127308:[[83,68],256],127309:[[83,83],256],127310:[[80,80,86],256],127311:[[87,67],256],127338:[[77,67],256],127339:[[77,68],256],127376:[[68,74],256]},61952:{127488:[[12411,12363],256],127489:[[12467,12467],256],127490:[[12469],256],127504:[[25163],256],127505:[[23383],256],127506:[[21452],256],127507:[[12487],256],127508:[[20108],256],127509:[[22810],256],127510:[[35299],256],127511:[[22825],256],127512:[[20132],256],127513:[[26144],256],127514:[[28961],256],127515:[[26009],256],127516:[[21069],256],127517:[[24460],256],127518:[[20877],256],127519:[[26032],256],127520:[[21021],256],127521:[[32066],256],127522:[[29983],256],127523:[[36009],256],127524:[[22768],256],127525:[[21561],256],127526:[[28436],256],127527:[[25237],256],127528:[[25429],256],127529:[[19968],256],127530:[[19977],256],127531:[[36938],256],127532:[[24038],256],127533:[[20013],256],127534:[[21491],256],127535:[[25351],256],127536:[[36208],256],127537:[[25171],256],127538:[[31105],256],127539:[[31354],256],127540:[[21512],256],127541:[[28288],256],127542:[[26377],256],127543:[[26376],256],127544:[[30003],256],127545:[[21106],256],127546:[[21942],256],127552:[[12308,26412,12309],256],127553:[[12308,19977,12309],256],127554:[[12308,20108,12309],256],127555:[[12308,23433,12309],256],127556:[[12308,28857,12309],256],127557:[[12308,25171,12309],256],127558:[[12308,30423,12309],256],127559:[[12308,21213,12309],256],127560:[[12308,25943,12309],256],127568:[[24471],256],127569:[[21487],256]},63488:{194560:[[20029]],194561:[[20024]],194562:[[20033]],194563:[[131362]],194564:[[20320]],194565:[[20398]],194566:[[20411]],194567:[[20482]],194568:[[20602]],194569:[[20633]],194570:[[20711]],194571:[[20687]],194572:[[13470]],194573:[[132666]],194574:[[20813]],194575:[[20820]],194576:[[20836]],194577:[[20855]],194578:[[132380]],194579:[[13497]],194580:[[20839]],194581:[[20877]],194582:[[132427]],194583:[[20887]],194584:[[20900]],194585:[[20172]],194586:[[20908]],194587:[[20917]],194588:[[168415]],194589:[[20981]],194590:[[20995]],194591:[[13535]],194592:[[21051]],194593:[[21062]],194594:[[21106]],194595:[[21111]],194596:[[13589]],194597:[[21191]],194598:[[21193]],194599:[[21220]],194600:[[21242]],194601:[[21253]],194602:[[21254]],194603:[[21271]],194604:[[21321]],194605:[[21329]],194606:[[21338]],194607:[[21363]],194608:[[21373]],194609:[[21375]],194610:[[21375]],194611:[[21375]],194612:[[133676]],194613:[[28784]],194614:[[21450]],194615:[[21471]],194616:[[133987]],194617:[[21483]],194618:[[21489]],194619:[[21510]],194620:[[21662]],194621:[[21560]],194622:[[21576]],194623:[[21608]],194624:[[21666]],194625:[[21750]],194626:[[21776]],194627:[[21843]],194628:[[21859]],194629:[[21892]],194630:[[21892]],194631:[[21913]],194632:[[21931]],194633:[[21939]],194634:[[21954]],194635:[[22294]],194636:[[22022]],194637:[[22295]],194638:[[22097]],194639:[[22132]],194640:[[20999]],194641:[[22766]],194642:[[22478]],194643:[[22516]],194644:[[22541]],194645:[[22411]],194646:[[22578]],194647:[[22577]],194648:[[22700]],194649:[[136420]],194650:[[22770]],194651:[[22775]],194652:[[22790]],194653:[[22810]],194654:[[22818]],194655:[[22882]],194656:[[136872]],194657:[[136938]],194658:[[23020]],194659:[[23067]],194660:[[23079]],194661:[[23e3]],194662:[[23142]],194663:[[14062]],194664:[[14076]],194665:[[23304]],194666:[[23358]],194667:[[23358]],194668:[[137672]],194669:[[23491]],194670:[[23512]],194671:[[23527]],194672:[[23539]],194673:[[138008]],194674:[[23551]],194675:[[23558]],194676:[[24403]],194677:[[23586]],194678:[[14209]],194679:[[23648]],194680:[[23662]],194681:[[23744]],194682:[[23693]],194683:[[138724]],194684:[[23875]],194685:[[138726]],194686:[[23918]],194687:[[23915]],194688:[[23932]],194689:[[24033]],194690:[[24034]],194691:[[14383]],194692:[[24061]],194693:[[24104]],194694:[[24125]],194695:[[24169]],194696:[[14434]],194697:[[139651]],194698:[[14460]],194699:[[24240]],194700:[[24243]],194701:[[24246]],194702:[[24266]],194703:[[172946]],194704:[[24318]],194705:[[140081]],194706:[[140081]],194707:[[33281]],194708:[[24354]],194709:[[24354]],194710:[[14535]],194711:[[144056]],194712:[[156122]],194713:[[24418]],194714:[[24427]],194715:[[14563]],194716:[[24474]],194717:[[24525]],194718:[[24535]],194719:[[24569]],194720:[[24705]],194721:[[14650]],194722:[[14620]],194723:[[24724]],194724:[[141012]],194725:[[24775]],194726:[[24904]],194727:[[24908]],194728:[[24910]],194729:[[24908]],194730:[[24954]],194731:[[24974]],194732:[[25010]],194733:[[24996]],194734:[[25007]],194735:[[25054]],194736:[[25074]],194737:[[25078]],194738:[[25104]],194739:[[25115]],194740:[[25181]],194741:[[25265]],194742:[[25300]],194743:[[25424]],194744:[[142092]],194745:[[25405]],194746:[[25340]],194747:[[25448]],194748:[[25475]],194749:[[25572]],194750:[[142321]],194751:[[25634]],194752:[[25541]],194753:[[25513]],194754:[[14894]],194755:[[25705]],194756:[[25726]],194757:[[25757]],194758:[[25719]],194759:[[14956]],194760:[[25935]],194761:[[25964]],194762:[[143370]],194763:[[26083]],194764:[[26360]],194765:[[26185]],194766:[[15129]],194767:[[26257]],194768:[[15112]],194769:[[15076]],194770:[[20882]],194771:[[20885]],194772:[[26368]],194773:[[26268]],194774:[[32941]],194775:[[17369]],194776:[[26391]],194777:[[26395]],194778:[[26401]],194779:[[26462]],194780:[[26451]],194781:[[144323]],194782:[[15177]],194783:[[26618]],194784:[[26501]],194785:[[26706]],194786:[[26757]],194787:[[144493]],194788:[[26766]],194789:[[26655]],194790:[[26900]],194791:[[15261]],194792:[[26946]],194793:[[27043]],194794:[[27114]],194795:[[27304]],194796:[[145059]],194797:[[27355]],194798:[[15384]],194799:[[27425]],194800:[[145575]],194801:[[27476]],194802:[[15438]],194803:[[27506]],194804:[[27551]],194805:[[27578]],194806:[[27579]],194807:[[146061]],194808:[[138507]],194809:[[146170]],194810:[[27726]],194811:[[146620]],194812:[[27839]],194813:[[27853]],194814:[[27751]],194815:[[27926]]},63744:{63744:[[35912]],63745:[[26356]],63746:[[36554]],63747:[[36040]],63748:[[28369]],63749:[[20018]],63750:[[21477]],63751:[[40860]],63752:[[40860]],63753:[[22865]],63754:[[37329]],63755:[[21895]],63756:[[22856]],63757:[[25078]],63758:[[30313]],63759:[[32645]],63760:[[34367]],63761:[[34746]],63762:[[35064]],63763:[[37007]],63764:[[27138]],63765:[[27931]],63766:[[28889]],63767:[[29662]],63768:[[33853]],63769:[[37226]],63770:[[39409]],63771:[[20098]],63772:[[21365]],63773:[[27396]],63774:[[29211]],63775:[[34349]],63776:[[40478]],63777:[[23888]],63778:[[28651]],63779:[[34253]],63780:[[35172]],63781:[[25289]],63782:[[33240]],63783:[[34847]],63784:[[24266]],63785:[[26391]],63786:[[28010]],63787:[[29436]],63788:[[37070]],63789:[[20358]],63790:[[20919]],63791:[[21214]],63792:[[25796]],63793:[[27347]],63794:[[29200]],63795:[[30439]],63796:[[32769]],63797:[[34310]],63798:[[34396]],63799:[[36335]],63800:[[38706]],63801:[[39791]],63802:[[40442]],63803:[[30860]],63804:[[31103]],63805:[[32160]],63806:[[33737]],63807:[[37636]],63808:[[40575]],63809:[[35542]],63810:[[22751]],63811:[[24324]],63812:[[31840]],63813:[[32894]],63814:[[29282]],63815:[[30922]],63816:[[36034]],63817:[[38647]],63818:[[22744]],63819:[[23650]],63820:[[27155]],63821:[[28122]],63822:[[28431]],63823:[[32047]],63824:[[32311]],63825:[[38475]],63826:[[21202]],63827:[[32907]],63828:[[20956]],63829:[[20940]],63830:[[31260]],63831:[[32190]],63832:[[33777]],63833:[[38517]],63834:[[35712]],63835:[[25295]],63836:[[27138]],63837:[[35582]],63838:[[20025]],63839:[[23527]],63840:[[24594]],63841:[[29575]],63842:[[30064]],63843:[[21271]],63844:[[30971]],63845:[[20415]],63846:[[24489]],63847:[[19981]],63848:[[27852]],63849:[[25976]],63850:[[32034]],63851:[[21443]],63852:[[22622]],63853:[[30465]],63854:[[33865]],63855:[[35498]],63856:[[27578]],63857:[[36784]],63858:[[27784]],63859:[[25342]],63860:[[33509]],63861:[[25504]],63862:[[30053]],63863:[[20142]],63864:[[20841]],63865:[[20937]],63866:[[26753]],63867:[[31975]],63868:[[33391]],63869:[[35538]],63870:[[37327]],63871:[[21237]],63872:[[21570]],63873:[[22899]],63874:[[24300]],63875:[[26053]],63876:[[28670]],63877:[[31018]],63878:[[38317]],63879:[[39530]],63880:[[40599]],63881:[[40654]],63882:[[21147]],63883:[[26310]],63884:[[27511]],63885:[[36706]],63886:[[24180]],63887:[[24976]],63888:[[25088]],63889:[[25754]],63890:[[28451]],63891:[[29001]],63892:[[29833]],63893:[[31178]],63894:[[32244]],63895:[[32879]],63896:[[36646]],63897:[[34030]],63898:[[36899]],63899:[[37706]],63900:[[21015]],63901:[[21155]],63902:[[21693]],63903:[[28872]],63904:[[35010]],63905:[[35498]],63906:[[24265]],63907:[[24565]],63908:[[25467]],63909:[[27566]],63910:[[31806]],63911:[[29557]],63912:[[20196]],63913:[[22265]],63914:[[23527]],63915:[[23994]],63916:[[24604]],63917:[[29618]],63918:[[29801]],63919:[[32666]],63920:[[32838]],63921:[[37428]],63922:[[38646]],63923:[[38728]],63924:[[38936]],63925:[[20363]],63926:[[31150]],63927:[[37300]],63928:[[38584]],63929:[[24801]],63930:[[20102]],63931:[[20698]],63932:[[23534]],63933:[[23615]],63934:[[26009]],63935:[[27138]],63936:[[29134]],63937:[[30274]],63938:[[34044]],63939:[[36988]],63940:[[40845]],63941:[[26248]],63942:[[38446]],63943:[[21129]],63944:[[26491]],63945:[[26611]],63946:[[27969]],63947:[[28316]],63948:[[29705]],63949:[[30041]],63950:[[30827]],63951:[[32016]],63952:[[39006]],63953:[[20845]],63954:[[25134]],63955:[[38520]],63956:[[20523]],63957:[[23833]],63958:[[28138]],63959:[[36650]],63960:[[24459]],63961:[[24900]],63962:[[26647]],63963:[[29575]],63964:[[38534]],63965:[[21033]],63966:[[21519]],63967:[[23653]],63968:[[26131]],63969:[[26446]],63970:[[26792]],63971:[[27877]],63972:[[29702]],63973:[[30178]],63974:[[32633]],63975:[[35023]],63976:[[35041]],63977:[[37324]],63978:[[38626]],63979:[[21311]],63980:[[28346]],63981:[[21533]],63982:[[29136]],63983:[[29848]],63984:[[34298]],63985:[[38563]],63986:[[40023]],63987:[[40607]],63988:[[26519]],63989:[[28107]],63990:[[33256]],63991:[[31435]],63992:[[31520]],63993:[[31890]],63994:[[29376]],63995:[[28825]],63996:[[35672]],63997:[[20160]],63998:[[33590]],63999:[[21050]],194816:[[27966]],194817:[[28023]],194818:[[27969]],194819:[[28009]],194820:[[28024]],194821:[[28037]],194822:[[146718]],194823:[[27956]],194824:[[28207]],194825:[[28270]],194826:[[15667]],194827:[[28363]],194828:[[28359]],194829:[[147153]],194830:[[28153]],194831:[[28526]],194832:[[147294]],194833:[[147342]],194834:[[28614]],194835:[[28729]],194836:[[28702]],194837:[[28699]],194838:[[15766]],194839:[[28746]],194840:[[28797]],194841:[[28791]],194842:[[28845]],194843:[[132389]],194844:[[28997]],194845:[[148067]],194846:[[29084]],194847:[[148395]],194848:[[29224]],194849:[[29237]],194850:[[29264]],194851:[[149e3]],194852:[[29312]],194853:[[29333]],194854:[[149301]],194855:[[149524]],194856:[[29562]],194857:[[29579]],194858:[[16044]],194859:[[29605]],194860:[[16056]],194861:[[16056]],194862:[[29767]],194863:[[29788]],194864:[[29809]],194865:[[29829]],194866:[[29898]],194867:[[16155]],194868:[[29988]],194869:[[150582]],194870:[[30014]],194871:[[150674]],194872:[[30064]],194873:[[139679]],194874:[[30224]],194875:[[151457]],194876:[[151480]],194877:[[151620]],194878:[[16380]],194879:[[16392]],194880:[[30452]],194881:[[151795]],194882:[[151794]],194883:[[151833]],194884:[[151859]],194885:[[30494]],194886:[[30495]],194887:[[30495]],194888:[[30538]],194889:[[16441]],194890:[[30603]],194891:[[16454]],194892:[[16534]],194893:[[152605]],194894:[[30798]],194895:[[30860]],194896:[[30924]],194897:[[16611]],194898:[[153126]],194899:[[31062]],194900:[[153242]],194901:[[153285]],194902:[[31119]],194903:[[31211]],194904:[[16687]],194905:[[31296]],194906:[[31306]],194907:[[31311]],194908:[[153980]],194909:[[154279]],194910:[[154279]],194911:[[31470]],194912:[[16898]],194913:[[154539]],194914:[[31686]],194915:[[31689]],194916:[[16935]],194917:[[154752]],194918:[[31954]],194919:[[17056]],194920:[[31976]],194921:[[31971]],194922:[[32e3]],194923:[[155526]],194924:[[32099]],194925:[[17153]],194926:[[32199]],194927:[[32258]],194928:[[32325]],194929:[[17204]],194930:[[156200]],194931:[[156231]],194932:[[17241]],194933:[[156377]],194934:[[32634]],194935:[[156478]],194936:[[32661]],194937:[[32762]],194938:[[32773]],194939:[[156890]],194940:[[156963]],194941:[[32864]],194942:[[157096]],194943:[[32880]],194944:[[144223]],194945:[[17365]],194946:[[32946]],194947:[[33027]],194948:[[17419]],194949:[[33086]],194950:[[23221]],194951:[[157607]],194952:[[157621]],194953:[[144275]],194954:[[144284]],194955:[[33281]],194956:[[33284]],194957:[[36766]],194958:[[17515]],194959:[[33425]],194960:[[33419]],194961:[[33437]],194962:[[21171]],194963:[[33457]],194964:[[33459]],194965:[[33469]],194966:[[33510]],194967:[[158524]],194968:[[33509]],194969:[[33565]],194970:[[33635]],194971:[[33709]],194972:[[33571]],194973:[[33725]],194974:[[33767]],194975:[[33879]],194976:[[33619]],194977:[[33738]],194978:[[33740]],194979:[[33756]],194980:[[158774]],194981:[[159083]],194982:[[158933]],194983:[[17707]],194984:[[34033]],194985:[[34035]],194986:[[34070]],194987:[[160714]],194988:[[34148]],194989:[[159532]],194990:[[17757]],194991:[[17761]],194992:[[159665]],194993:[[159954]],194994:[[17771]],194995:[[34384]],194996:[[34396]],194997:[[34407]],194998:[[34409]],194999:[[34473]],195e3:[[34440]],195001:[[34574]],195002:[[34530]],195003:[[34681]],195004:[[34600]],195005:[[34667]],195006:[[34694]],195007:[[17879]],195008:[[34785]],195009:[[34817]],195010:[[17913]],195011:[[34912]],195012:[[34915]],195013:[[161383]],195014:[[35031]],195015:[[35038]],195016:[[17973]],195017:[[35066]],195018:[[13499]],195019:[[161966]],195020:[[162150]],195021:[[18110]],195022:[[18119]],195023:[[35488]],195024:[[35565]],195025:[[35722]],195026:[[35925]],195027:[[162984]],195028:[[36011]],195029:[[36033]],195030:[[36123]],195031:[[36215]],195032:[[163631]],195033:[[133124]],195034:[[36299]],195035:[[36284]],195036:[[36336]],195037:[[133342]],195038:[[36564]],195039:[[36664]],195040:[[165330]],195041:[[165357]],195042:[[37012]],195043:[[37105]],195044:[[37137]],195045:[[165678]],195046:[[37147]],195047:[[37432]],195048:[[37591]],195049:[[37592]],195050:[[37500]],195051:[[37881]],195052:[[37909]],195053:[[166906]],195054:[[38283]],195055:[[18837]],195056:[[38327]],195057:[[167287]],195058:[[18918]],195059:[[38595]],195060:[[23986]],195061:[[38691]],195062:[[168261]],195063:[[168474]],195064:[[19054]],195065:[[19062]],195066:[[38880]],195067:[[168970]],195068:[[19122]],195069:[[169110]],195070:[[38923]],195071:[[38923]]},64e3:{64e3:[[20999]],64001:[[24230]],64002:[[25299]],64003:[[31958]],64004:[[23429]],64005:[[27934]],64006:[[26292]],64007:[[36667]],64008:[[34892]],64009:[[38477]],64010:[[35211]],64011:[[24275]],64012:[[20800]],64013:[[21952]],64016:[[22618]],64018:[[26228]],64021:[[20958]],64022:[[29482]],64023:[[30410]],64024:[[31036]],64025:[[31070]],64026:[[31077]],64027:[[31119]],64028:[[38742]],64029:[[31934]],64030:[[32701]],64032:[[34322]],64034:[[35576]],64037:[[36920]],64038:[[37117]],64042:[[39151]],64043:[[39164]],64044:[[39208]],64045:[[40372]],64046:[[37086]],64047:[[38583]],64048:[[20398]],64049:[[20711]],64050:[[20813]],64051:[[21193]],64052:[[21220]],64053:[[21329]],64054:[[21917]],64055:[[22022]],64056:[[22120]],64057:[[22592]],64058:[[22696]],64059:[[23652]],64060:[[23662]],64061:[[24724]],64062:[[24936]],64063:[[24974]],64064:[[25074]],64065:[[25935]],64066:[[26082]],64067:[[26257]],64068:[[26757]],64069:[[28023]],64070:[[28186]],64071:[[28450]],64072:[[29038]],64073:[[29227]],64074:[[29730]],64075:[[30865]],64076:[[31038]],64077:[[31049]],64078:[[31048]],64079:[[31056]],64080:[[31062]],64081:[[31069]],64082:[[31117]],64083:[[31118]],64084:[[31296]],64085:[[31361]],64086:[[31680]],64087:[[32244]],64088:[[32265]],64089:[[32321]],64090:[[32626]],64091:[[32773]],64092:[[33261]],64093:[[33401]],64094:[[33401]],64095:[[33879]],64096:[[35088]],64097:[[35222]],64098:[[35585]],64099:[[35641]],64100:[[36051]],64101:[[36104]],64102:[[36790]],64103:[[36920]],64104:[[38627]],64105:[[38911]],64106:[[38971]],64107:[[24693]],64108:[[148206]],64109:[[33304]],64112:[[20006]],64113:[[20917]],64114:[[20840]],64115:[[20352]],64116:[[20805]],64117:[[20864]],64118:[[21191]],64119:[[21242]],64120:[[21917]],64121:[[21845]],64122:[[21913]],64123:[[21986]],64124:[[22618]],64125:[[22707]],64126:[[22852]],64127:[[22868]],64128:[[23138]],64129:[[23336]],64130:[[24274]],64131:[[24281]],64132:[[24425]],64133:[[24493]],64134:[[24792]],64135:[[24910]],64136:[[24840]],64137:[[24974]],64138:[[24928]],64139:[[25074]],64140:[[25140]],64141:[[25540]],64142:[[25628]],64143:[[25682]],64144:[[25942]],64145:[[26228]],64146:[[26391]],64147:[[26395]],64148:[[26454]],64149:[[27513]],64150:[[27578]],64151:[[27969]],64152:[[28379]],64153:[[28363]],64154:[[28450]],64155:[[28702]],64156:[[29038]],64157:[[30631]],64158:[[29237]],64159:[[29359]],64160:[[29482]],64161:[[29809]],64162:[[29958]],64163:[[30011]],64164:[[30237]],64165:[[30239]],64166:[[30410]],64167:[[30427]],64168:[[30452]],64169:[[30538]],64170:[[30528]],64171:[[30924]],64172:[[31409]],64173:[[31680]],64174:[[31867]],64175:[[32091]],64176:[[32244]],64177:[[32574]],64178:[[32773]],64179:[[33618]],64180:[[33775]],64181:[[34681]],64182:[[35137]],64183:[[35206]],64184:[[35222]],64185:[[35519]],64186:[[35576]],64187:[[35531]],64188:[[35585]],64189:[[35582]],64190:[[35565]],64191:[[35641]],64192:[[35722]],64193:[[36104]],64194:[[36664]],64195:[[36978]],64196:[[37273]],64197:[[37494]],64198:[[38524]],64199:[[38627]],64200:[[38742]],64201:[[38875]],64202:[[38911]],64203:[[38923]],64204:[[38971]],64205:[[39698]],64206:[[40860]],64207:[[141386]],64208:[[141380]],64209:[[144341]],64210:[[15261]],64211:[[16408]],64212:[[16441]],64213:[[152137]],64214:[[154832]],64215:[[163539]],64216:[[40771]],64217:[[40846]],195072:[[38953]],195073:[[169398]],195074:[[39138]],195075:[[19251]],195076:[[39209]],195077:[[39335]],195078:[[39362]],195079:[[39422]],195080:[[19406]],195081:[[170800]],195082:[[39698]],195083:[[4e4]],195084:[[40189]],195085:[[19662]],195086:[[19693]],195087:[[40295]],195088:[[172238]],195089:[[19704]],195090:[[172293]],195091:[[172558]],195092:[[172689]],195093:[[40635]],195094:[[19798]],195095:[[40697]],195096:[[40702]],195097:[[40709]],195098:[[40719]],195099:[[40726]],195100:[[40763]],195101:[[173568]]},64256:{64256:[[102,102],256],64257:[[102,105],256],64258:[[102,108],256],64259:[[102,102,105],256],64260:[[102,102,108],256],64261:[[383,116],256],64262:[[115,116],256],64275:[[1396,1398],256],64276:[[1396,1381],256],64277:[[1396,1387],256],64278:[[1406,1398],256],64279:[[1396,1389],256],64285:[[1497,1460],512],64286:[,26],64287:[[1522,1463],512],64288:[[1506],256],64289:[[1488],256],64290:[[1491],256],64291:[[1492],256],64292:[[1499],256],64293:[[1500],256],64294:[[1501],256],64295:[[1512],256],64296:[[1514],256],64297:[[43],256],64298:[[1513,1473],512],64299:[[1513,1474],512],64300:[[64329,1473],512],64301:[[64329,1474],512],64302:[[1488,1463],512],64303:[[1488,1464],512],64304:[[1488,1468],512],64305:[[1489,1468],512],64306:[[1490,1468],512],64307:[[1491,1468],512],64308:[[1492,1468],512],64309:[[1493,1468],512],64310:[[1494,1468],512],64312:[[1496,1468],512],64313:[[1497,1468],512],64314:[[1498,1468],512],64315:[[1499,1468],512],64316:[[1500,1468],512],64318:[[1502,1468],512],64320:[[1504,1468],512],64321:[[1505,1468],512],64323:[[1507,1468],512],64324:[[1508,1468],512],64326:[[1510,1468],512],64327:[[1511,1468],512],64328:[[1512,1468],512],64329:[[1513,1468],512],64330:[[1514,1468],512],64331:[[1493,1465],512],64332:[[1489,1471],512],64333:[[1499,1471],512],64334:[[1508,1471],512],64335:[[1488,1500],256],64336:[[1649],256],64337:[[1649],256],64338:[[1659],256],64339:[[1659],256],64340:[[1659],256],64341:[[1659],256],64342:[[1662],256],64343:[[1662],256],64344:[[1662],256],64345:[[1662],256],64346:[[1664],256],64347:[[1664],256],64348:[[1664],256],64349:[[1664],256],64350:[[1658],256],64351:[[1658],256],64352:[[1658],256],64353:[[1658],256],64354:[[1663],256],64355:[[1663],256],64356:[[1663],256],64357:[[1663],256],64358:[[1657],256],64359:[[1657],256],64360:[[1657],256],64361:[[1657],256],64362:[[1700],256],64363:[[1700],256],64364:[[1700],256],64365:[[1700],256],64366:[[1702],256],64367:[[1702],256],64368:[[1702],256],64369:[[1702],256],64370:[[1668],256],64371:[[1668],256],64372:[[1668],256],64373:[[1668],256],64374:[[1667],256],64375:[[1667],256],64376:[[1667],256],64377:[[1667],256],64378:[[1670],256],64379:[[1670],256],64380:[[1670],256],64381:[[1670],256],64382:[[1671],256],64383:[[1671],256],64384:[[1671],256],64385:[[1671],256],64386:[[1677],256],64387:[[1677],256],64388:[[1676],256],64389:[[1676],256],64390:[[1678],256],64391:[[1678],256],64392:[[1672],256],64393:[[1672],256],64394:[[1688],256],64395:[[1688],256],64396:[[1681],256],64397:[[1681],256],64398:[[1705],256],64399:[[1705],256],64400:[[1705],256],64401:[[1705],256],64402:[[1711],256],64403:[[1711],256],64404:[[1711],256],64405:[[1711],256],64406:[[1715],256],64407:[[1715],256],64408:[[1715],256],64409:[[1715],256],64410:[[1713],256],64411:[[1713],256],64412:[[1713],256],64413:[[1713],256],64414:[[1722],256],64415:[[1722],256],64416:[[1723],256],64417:[[1723],256],64418:[[1723],256],64419:[[1723],256],64420:[[1728],256],64421:[[1728],256],64422:[[1729],256],64423:[[1729],256],64424:[[1729],256],64425:[[1729],256],64426:[[1726],256],64427:[[1726],256],64428:[[1726],256],64429:[[1726],256],64430:[[1746],256],64431:[[1746],256],64432:[[1747],256],64433:[[1747],256],64467:[[1709],256],64468:[[1709],256],64469:[[1709],256],64470:[[1709],256],64471:[[1735],256],64472:[[1735],256],64473:[[1734],256],64474:[[1734],256],64475:[[1736],256],64476:[[1736],256],64477:[[1655],256],64478:[[1739],256],64479:[[1739],256],64480:[[1733],256],64481:[[1733],256],64482:[[1737],256],64483:[[1737],256],64484:[[1744],256],64485:[[1744],256],64486:[[1744],256],64487:[[1744],256],64488:[[1609],256],64489:[[1609],256],64490:[[1574,1575],256],64491:[[1574,1575],256],64492:[[1574,1749],256],64493:[[1574,1749],256],64494:[[1574,1608],256],64495:[[1574,1608],256],64496:[[1574,1735],256],64497:[[1574,1735],256],64498:[[1574,1734],256],64499:[[1574,1734],256],64500:[[1574,1736],256],64501:[[1574,1736],256],64502:[[1574,1744],256],64503:[[1574,1744],256],64504:[[1574,1744],256],64505:[[1574,1609],256],64506:[[1574,1609],256],64507:[[1574,1609],256],64508:[[1740],256],64509:[[1740],256],64510:[[1740],256],64511:[[1740],256]},64512:{64512:[[1574,1580],256],64513:[[1574,1581],256],64514:[[1574,1605],256],64515:[[1574,1609],256],64516:[[1574,1610],256],64517:[[1576,1580],256],64518:[[1576,1581],256],64519:[[1576,1582],256],64520:[[1576,1605],256],64521:[[1576,1609],256],64522:[[1576,1610],256],64523:[[1578,1580],256],64524:[[1578,1581],256],64525:[[1578,1582],256],64526:[[1578,1605],256],64527:[[1578,1609],256],64528:[[1578,1610],256],64529:[[1579,1580],256],64530:[[1579,1605],256],64531:[[1579,1609],256],64532:[[1579,1610],256],64533:[[1580,1581],256],64534:[[1580,1605],256],64535:[[1581,1580],256],64536:[[1581,1605],256],64537:[[1582,1580],256],64538:[[1582,1581],256],64539:[[1582,1605],256],64540:[[1587,1580],256],64541:[[1587,1581],256],64542:[[1587,1582],256],64543:[[1587,1605],256],64544:[[1589,1581],256],64545:[[1589,1605],256],64546:[[1590,1580],256],64547:[[1590,1581],256],64548:[[1590,1582],256],64549:[[1590,1605],256],64550:[[1591,1581],256],64551:[[1591,1605],256],64552:[[1592,1605],256],64553:[[1593,1580],256],64554:[[1593,1605],256],64555:[[1594,1580],256],64556:[[1594,1605],256],64557:[[1601,1580],256],64558:[[1601,1581],256],64559:[[1601,1582],256],64560:[[1601,1605],256],64561:[[1601,1609],256],64562:[[1601,1610],256],64563:[[1602,1581],256],64564:[[1602,1605],256],64565:[[1602,1609],256],64566:[[1602,1610],256],64567:[[1603,1575],256],64568:[[1603,1580],256],64569:[[1603,1581],256],64570:[[1603,1582],256],64571:[[1603,1604],256],64572:[[1603,1605],256],64573:[[1603,1609],256],64574:[[1603,1610],256],64575:[[1604,1580],256],64576:[[1604,1581],256],64577:[[1604,1582],256],64578:[[1604,1605],256],64579:[[1604,1609],256],64580:[[1604,1610],256],64581:[[1605,1580],256],64582:[[1605,1581],256],64583:[[1605,1582],256],64584:[[1605,1605],256],64585:[[1605,1609],256],64586:[[1605,1610],256],64587:[[1606,1580],256],64588:[[1606,1581],256],64589:[[1606,1582],256],64590:[[1606,1605],256],64591:[[1606,1609],256],64592:[[1606,1610],256],64593:[[1607,1580],256],64594:[[1607,1605],256],64595:[[1607,1609],256],64596:[[1607,1610],256],64597:[[1610,1580],256],64598:[[1610,1581],256],64599:[[1610,1582],256],64600:[[1610,1605],256],64601:[[1610,1609],256],64602:[[1610,1610],256],64603:[[1584,1648],256],64604:[[1585,1648],256],64605:[[1609,1648],256],64606:[[32,1612,1617],256],64607:[[32,1613,1617],256],64608:[[32,1614,1617],256],64609:[[32,1615,1617],256],64610:[[32,1616,1617],256],64611:[[32,1617,1648],256],64612:[[1574,1585],256],64613:[[1574,1586],256],64614:[[1574,1605],256],64615:[[1574,1606],256],64616:[[1574,1609],256],64617:[[1574,1610],256],64618:[[1576,1585],256],64619:[[1576,1586],256],64620:[[1576,1605],256],64621:[[1576,1606],256],64622:[[1576,1609],256],64623:[[1576,1610],256],64624:[[1578,1585],256],64625:[[1578,1586],256],64626:[[1578,1605],256],64627:[[1578,1606],256],64628:[[1578,1609],256],64629:[[1578,1610],256],64630:[[1579,1585],256],64631:[[1579,1586],256],64632:[[1579,1605],256],64633:[[1579,1606],256],64634:[[1579,1609],256],64635:[[1579,1610],256],64636:[[1601,1609],256],64637:[[1601,1610],256],64638:[[1602,1609],256],64639:[[1602,1610],256],64640:[[1603,1575],256],64641:[[1603,1604],256],64642:[[1603,1605],256],64643:[[1603,1609],256],64644:[[1603,1610],256],64645:[[1604,1605],256],64646:[[1604,1609],256],64647:[[1604,1610],256],64648:[[1605,1575],256],64649:[[1605,1605],256],64650:[[1606,1585],256],64651:[[1606,1586],256],64652:[[1606,1605],256],64653:[[1606,1606],256],64654:[[1606,1609],256],64655:[[1606,1610],256],64656:[[1609,1648],256],64657:[[1610,1585],256],64658:[[1610,1586],256],64659:[[1610,1605],256],64660:[[1610,1606],256],64661:[[1610,1609],256],64662:[[1610,1610],256],64663:[[1574,1580],256],64664:[[1574,1581],256],64665:[[1574,1582],256],64666:[[1574,1605],256],64667:[[1574,1607],256],64668:[[1576,1580],256],64669:[[1576,1581],256],64670:[[1576,1582],256],64671:[[1576,1605],256],64672:[[1576,1607],256],64673:[[1578,1580],256],64674:[[1578,1581],256],64675:[[1578,1582],256],64676:[[1578,1605],256],64677:[[1578,1607],256],64678:[[1579,1605],256],64679:[[1580,1581],256],64680:[[1580,1605],256],64681:[[1581,1580],256],64682:[[1581,1605],256],64683:[[1582,1580],256],64684:[[1582,1605],256],64685:[[1587,1580],256],64686:[[1587,1581],256],64687:[[1587,1582],256],64688:[[1587,1605],256],64689:[[1589,1581],256],64690:[[1589,1582],256],64691:[[1589,1605],256],64692:[[1590,1580],256],64693:[[1590,1581],256],64694:[[1590,1582],256],64695:[[1590,1605],256],64696:[[1591,1581],256],64697:[[1592,1605],256],64698:[[1593,1580],256],64699:[[1593,1605],256],64700:[[1594,1580],256],64701:[[1594,1605],256],64702:[[1601,1580],256],64703:[[1601,1581],256],64704:[[1601,1582],256],64705:[[1601,1605],256],64706:[[1602,1581],256],64707:[[1602,1605],256],64708:[[1603,1580],256],64709:[[1603,1581],256],64710:[[1603,1582],256],64711:[[1603,1604],256],64712:[[1603,1605],256],64713:[[1604,1580],256],64714:[[1604,1581],256],64715:[[1604,1582],256],64716:[[1604,1605],256],64717:[[1604,1607],256],64718:[[1605,1580],256],64719:[[1605,1581],256],64720:[[1605,1582],256],64721:[[1605,1605],256],64722:[[1606,1580],256],64723:[[1606,1581],256],64724:[[1606,1582],256],64725:[[1606,1605],256],64726:[[1606,1607],256],64727:[[1607,1580],256],64728:[[1607,1605],256],64729:[[1607,1648],256],64730:[[1610,1580],256],64731:[[1610,1581],256],64732:[[1610,1582],256],64733:[[1610,1605],256],64734:[[1610,1607],256],64735:[[1574,1605],256],64736:[[1574,1607],256],64737:[[1576,1605],256],64738:[[1576,1607],256],64739:[[1578,1605],256],64740:[[1578,1607],256],64741:[[1579,1605],256],64742:[[1579,1607],256],64743:[[1587,1605],256],64744:[[1587,1607],256],64745:[[1588,1605],256],64746:[[1588,1607],256],64747:[[1603,1604],256],64748:[[1603,1605],256],64749:[[1604,1605],256],64750:[[1606,1605],256],64751:[[1606,1607],256],64752:[[1610,1605],256],64753:[[1610,1607],256],64754:[[1600,1614,1617],256],64755:[[1600,1615,1617],256],64756:[[1600,1616,1617],256],64757:[[1591,1609],256],64758:[[1591,1610],256],64759:[[1593,1609],256],64760:[[1593,1610],256],64761:[[1594,1609],256],64762:[[1594,1610],256],64763:[[1587,1609],256],64764:[[1587,1610],256],64765:[[1588,1609],256],64766:[[1588,1610],256],64767:[[1581,1609],256]},64768:{64768:[[1581,1610],256],64769:[[1580,1609],256],64770:[[1580,1610],256],64771:[[1582,1609],256],64772:[[1582,1610],256],64773:[[1589,1609],256],64774:[[1589,1610],256],64775:[[1590,1609],256],64776:[[1590,1610],256],64777:[[1588,1580],256],64778:[[1588,1581],256],64779:[[1588,1582],256],64780:[[1588,1605],256],64781:[[1588,1585],256],64782:[[1587,1585],256],64783:[[1589,1585],256],64784:[[1590,1585],256],64785:[[1591,1609],256],64786:[[1591,1610],256],64787:[[1593,1609],256],64788:[[1593,1610],256],64789:[[1594,1609],256],64790:[[1594,1610],256],64791:[[1587,1609],256],64792:[[1587,1610],256],64793:[[1588,1609],256],64794:[[1588,1610],256],64795:[[1581,1609],256],64796:[[1581,1610],256],64797:[[1580,1609],256],64798:[[1580,1610],256],64799:[[1582,1609],256],64800:[[1582,1610],256],64801:[[1589,1609],256],64802:[[1589,1610],256],64803:[[1590,1609],256],64804:[[1590,1610],256],64805:[[1588,1580],256],64806:[[1588,1581],256],64807:[[1588,1582],256],64808:[[1588,1605],256],64809:[[1588,1585],256],64810:[[1587,1585],256],64811:[[1589,1585],256],64812:[[1590,1585],256],64813:[[1588,1580],256],64814:[[1588,1581],256],64815:[[1588,1582],256],64816:[[1588,1605],256],64817:[[1587,1607],256],64818:[[1588,1607],256],64819:[[1591,1605],256],64820:[[1587,1580],256],64821:[[1587,1581],256],64822:[[1587,1582],256],64823:[[1588,1580],256],64824:[[1588,1581],256],64825:[[1588,1582],256],64826:[[1591,1605],256],64827:[[1592,1605],256],64828:[[1575,1611],256],64829:[[1575,1611],256],64848:[[1578,1580,1605],256],64849:[[1578,1581,1580],256],64850:[[1578,1581,1580],256],64851:[[1578,1581,1605],256],64852:[[1578,1582,1605],256],64853:[[1578,1605,1580],256],64854:[[1578,1605,1581],256],64855:[[1578,1605,1582],256],64856:[[1580,1605,1581],256],64857:[[1580,1605,1581],256],64858:[[1581,1605,1610],256],64859:[[1581,1605,1609],256],64860:[[1587,1581,1580],256],64861:[[1587,1580,1581],256],64862:[[1587,1580,1609],256],64863:[[1587,1605,1581],256],64864:[[1587,1605,1581],256],64865:[[1587,1605,1580],256],64866:[[1587,1605,1605],256],64867:[[1587,1605,1605],256],64868:[[1589,1581,1581],256],64869:[[1589,1581,1581],256],64870:[[1589,1605,1605],256],64871:[[1588,1581,1605],256],64872:[[1588,1581,1605],256],64873:[[1588,1580,1610],256],64874:[[1588,1605,1582],256],64875:[[1588,1605,1582],256],64876:[[1588,1605,1605],256],64877:[[1588,1605,1605],256],64878:[[1590,1581,1609],256],64879:[[1590,1582,1605],256],64880:[[1590,1582,1605],256],64881:[[1591,1605,1581],256],64882:[[1591,1605,1581],256],64883:[[1591,1605,1605],256],64884:[[1591,1605,1610],256],64885:[[1593,1580,1605],256],64886:[[1593,1605,1605],256],64887:[[1593,1605,1605],256],64888:[[1593,1605,1609],256],64889:[[1594,1605,1605],256],64890:[[1594,1605,1610],256],64891:[[1594,1605,1609],256],64892:[[1601,1582,1605],256],64893:[[1601,1582,1605],256],64894:[[1602,1605,1581],256],64895:[[1602,1605,1605],256],64896:[[1604,1581,1605],256],64897:[[1604,1581,1610],256],64898:[[1604,1581,1609],256],64899:[[1604,1580,1580],256],64900:[[1604,1580,1580],256],64901:[[1604,1582,1605],256],64902:[[1604,1582,1605],256],64903:[[1604,1605,1581],256],64904:[[1604,1605,1581],256],64905:[[1605,1581,1580],256],64906:[[1605,1581,1605],256],64907:[[1605,1581,1610],256],64908:[[1605,1580,1581],256],64909:[[1605,1580,1605],256],64910:[[1605,1582,1580],256],64911:[[1605,1582,1605],256],64914:[[1605,1580,1582],256],64915:[[1607,1605,1580],256],64916:[[1607,1605,1605],256],64917:[[1606,1581,1605],256],64918:[[1606,1581,1609],256],64919:[[1606,1580,1605],256],64920:[[1606,1580,1605],256],64921:[[1606,1580,1609],256],64922:[[1606,1605,1610],256],64923:[[1606,1605,1609],256],64924:[[1610,1605,1605],256],64925:[[1610,1605,1605],256],64926:[[1576,1582,1610],256],64927:[[1578,1580,1610],256],64928:[[1578,1580,1609],256],64929:[[1578,1582,1610],256],64930:[[1578,1582,1609],256],64931:[[1578,1605,1610],256],64932:[[1578,1605,1609],256],64933:[[1580,1605,1610],256],64934:[[1580,1581,1609],256],64935:[[1580,1605,1609],256],64936:[[1587,1582,1609],256],64937:[[1589,1581,1610],256],64938:[[1588,1581,1610],256],64939:[[1590,1581,1610],256],64940:[[1604,1580,1610],256],64941:[[1604,1605,1610],256],64942:[[1610,1581,1610],256],64943:[[1610,1580,1610],256],64944:[[1610,1605,1610],256],64945:[[1605,1605,1610],256],64946:[[1602,1605,1610],256],64947:[[1606,1581,1610],256],64948:[[1602,1605,1581],256],64949:[[1604,1581,1605],256],64950:[[1593,1605,1610],256],64951:[[1603,1605,1610],256],64952:[[1606,1580,1581],256],64953:[[1605,1582,1610],256],64954:[[1604,1580,1605],256],64955:[[1603,1605,1605],256],64956:[[1604,1580,1605],256],64957:[[1606,1580,1581],256],64958:[[1580,1581,1610],256],64959:[[1581,1580,1610],256],64960:[[1605,1580,1610],256],64961:[[1601,1605,1610],256],64962:[[1576,1581,1610],256],64963:[[1603,1605,1605],256],64964:[[1593,1580,1605],256],64965:[[1589,1605,1605],256],64966:[[1587,1582,1610],256],64967:[[1606,1580,1610],256],65008:[[1589,1604,1746],256],65009:[[1602,1604,1746],256],65010:[[1575,1604,1604,1607],256],65011:[[1575,1603,1576,1585],256],65012:[[1605,1581,1605,1583],256],65013:[[1589,1604,1593,1605],256],65014:[[1585,1587,1608,1604],256],65015:[[1593,1604,1610,1607],256],65016:[[1608,1587,1604,1605],256],65017:[[1589,1604,1609],256],65018:[[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605],256],65019:[[1580,1604,32,1580,1604,1575,1604,1607],256],65020:[[1585,1740,1575,1604],256]},65024:{65040:[[44],256],65041:[[12289],256],65042:[[12290],256],65043:[[58],256],65044:[[59],256],65045:[[33],256],65046:[[63],256],65047:[[12310],256],65048:[[12311],256],65049:[[8230],256],65056:[,230],65057:[,230],65058:[,230],65059:[,230],65060:[,230],65061:[,230],65062:[,230],65063:[,220],65064:[,220],65065:[,220],65066:[,220],65067:[,220],65068:[,220],65069:[,220],65072:[[8229],256],65073:[[8212],256],65074:[[8211],256],65075:[[95],256],65076:[[95],256],65077:[[40],256],65078:[[41],256],65079:[[123],256],65080:[[125],256],65081:[[12308],256],65082:[[12309],256],65083:[[12304],256],65084:[[12305],256],65085:[[12298],256],65086:[[12299],256],65087:[[12296],256],65088:[[12297],256],65089:[[12300],256],65090:[[12301],256],65091:[[12302],256],65092:[[12303],256],65095:[[91],256],65096:[[93],256],65097:[[8254],256],65098:[[8254],256],65099:[[8254],256],65100:[[8254],256],65101:[[95],256],65102:[[95],256],65103:[[95],256],65104:[[44],256],65105:[[12289],256],65106:[[46],256],65108:[[59],256],65109:[[58],256],65110:[[63],256],65111:[[33],256],65112:[[8212],256],65113:[[40],256],65114:[[41],256],65115:[[123],256],65116:[[125],256],65117:[[12308],256],65118:[[12309],256],65119:[[35],256],65120:[[38],256],65121:[[42],256],65122:[[43],256],65123:[[45],256],65124:[[60],256],65125:[[62],256],65126:[[61],256],65128:[[92],256],65129:[[36],256],65130:[[37],256],65131:[[64],256],65136:[[32,1611],256],65137:[[1600,1611],256],65138:[[32,1612],256],65140:[[32,1613],256],65142:[[32,1614],256],65143:[[1600,1614],256],65144:[[32,1615],256],65145:[[1600,1615],256],65146:[[32,1616],256],65147:[[1600,1616],256],65148:[[32,1617],256],65149:[[1600,1617],256],65150:[[32,1618],256],65151:[[1600,1618],256],65152:[[1569],256],65153:[[1570],256],65154:[[1570],256],65155:[[1571],256],65156:[[1571],256],65157:[[1572],256],65158:[[1572],256],65159:[[1573],256],65160:[[1573],256],65161:[[1574],256],65162:[[1574],256],65163:[[1574],256],65164:[[1574],256],65165:[[1575],256],65166:[[1575],256],65167:[[1576],256],65168:[[1576],256],65169:[[1576],256],65170:[[1576],256],65171:[[1577],256],65172:[[1577],256],65173:[[1578],256],65174:[[1578],256],65175:[[1578],256],65176:[[1578],256],65177:[[1579],256],65178:[[1579],256],65179:[[1579],256],65180:[[1579],256],65181:[[1580],256],65182:[[1580],256],65183:[[1580],256],65184:[[1580],256],65185:[[1581],256],65186:[[1581],256],65187:[[1581],256],65188:[[1581],256],65189:[[1582],256],65190:[[1582],256],65191:[[1582],256],65192:[[1582],256],65193:[[1583],256],65194:[[1583],256],65195:[[1584],256],65196:[[1584],256],65197:[[1585],256],65198:[[1585],256],65199:[[1586],256],65200:[[1586],256],65201:[[1587],256],65202:[[1587],256],65203:[[1587],256],65204:[[1587],256],65205:[[1588],256],65206:[[1588],256],65207:[[1588],256],65208:[[1588],256],65209:[[1589],256],65210:[[1589],256],65211:[[1589],256],65212:[[1589],256],65213:[[1590],256],65214:[[1590],256],65215:[[1590],256],65216:[[1590],256],65217:[[1591],256],65218:[[1591],256],65219:[[1591],256],65220:[[1591],256],65221:[[1592],256],65222:[[1592],256],65223:[[1592],256],65224:[[1592],256],65225:[[1593],256],65226:[[1593],256],65227:[[1593],256],65228:[[1593],256],65229:[[1594],256],65230:[[1594],256],65231:[[1594],256],65232:[[1594],256],65233:[[1601],256],65234:[[1601],256],65235:[[1601],256],65236:[[1601],256],65237:[[1602],256],65238:[[1602],256],65239:[[1602],256],65240:[[1602],256],65241:[[1603],256],65242:[[1603],256],65243:[[1603],256],65244:[[1603],256],65245:[[1604],256],65246:[[1604],256],65247:[[1604],256],65248:[[1604],256],65249:[[1605],256],65250:[[1605],256],65251:[[1605],256],65252:[[1605],256],65253:[[1606],256],65254:[[1606],256],65255:[[1606],256],65256:[[1606],256],65257:[[1607],256],65258:[[1607],256],65259:[[1607],256],65260:[[1607],256],65261:[[1608],256],65262:[[1608],256],65263:[[1609],256],65264:[[1609],256],65265:[[1610],256],65266:[[1610],256],65267:[[1610],256],65268:[[1610],256],65269:[[1604,1570],256],65270:[[1604,1570],256],65271:[[1604,1571],256],65272:[[1604,1571],256],65273:[[1604,1573],256],65274:[[1604,1573],256],65275:[[1604,1575],256],65276:[[1604,1575],256]},65280:{65281:[[33],256],65282:[[34],256],65283:[[35],256],65284:[[36],256],65285:[[37],256],65286:[[38],256],65287:[[39],256],65288:[[40],256],65289:[[41],256],65290:[[42],256],65291:[[43],256],65292:[[44],256],65293:[[45],256],65294:[[46],256],65295:[[47],256],65296:[[48],256],65297:[[49],256],65298:[[50],256],65299:[[51],256],65300:[[52],256],65301:[[53],256],65302:[[54],256],65303:[[55],256],65304:[[56],256],65305:[[57],256],65306:[[58],256],65307:[[59],256],65308:[[60],256],65309:[[61],256],65310:[[62],256],65311:[[63],256],65312:[[64],256],65313:[[65],256],65314:[[66],256],65315:[[67],256],65316:[[68],256],65317:[[69],256],65318:[[70],256],65319:[[71],256],65320:[[72],256],65321:[[73],256],65322:[[74],256],65323:[[75],256],65324:[[76],256],65325:[[77],256],65326:[[78],256],65327:[[79],256],65328:[[80],256],65329:[[81],256],65330:[[82],256],65331:[[83],256],65332:[[84],256],65333:[[85],256],65334:[[86],256],65335:[[87],256],65336:[[88],256],65337:[[89],256],65338:[[90],256],65339:[[91],256],65340:[[92],256],65341:[[93],256],65342:[[94],256],65343:[[95],256],65344:[[96],256],65345:[[97],256],65346:[[98],256],65347:[[99],256],65348:[[100],256],65349:[[101],256],65350:[[102],256],65351:[[103],256],65352:[[104],256],65353:[[105],256],65354:[[106],256],65355:[[107],256],65356:[[108],256],65357:[[109],256],65358:[[110],256],65359:[[111],256],65360:[[112],256],65361:[[113],256],65362:[[114],256],65363:[[115],256],65364:[[116],256],65365:[[117],256],65366:[[118],256],65367:[[119],256],65368:[[120],256],65369:[[121],256],65370:[[122],256],65371:[[123],256],65372:[[124],256],65373:[[125],256],65374:[[126],256],65375:[[10629],256],65376:[[10630],256],65377:[[12290],256],65378:[[12300],256],65379:[[12301],256],65380:[[12289],256],65381:[[12539],256],65382:[[12530],256],65383:[[12449],256],65384:[[12451],256],65385:[[12453],256],65386:[[12455],256],65387:[[12457],256],65388:[[12515],256],65389:[[12517],256],65390:[[12519],256],65391:[[12483],256],65392:[[12540],256],65393:[[12450],256],65394:[[12452],256],65395:[[12454],256],65396:[[12456],256],65397:[[12458],256],65398:[[12459],256],65399:[[12461],256],65400:[[12463],256],65401:[[12465],256],65402:[[12467],256],65403:[[12469],256],65404:[[12471],256],65405:[[12473],256],65406:[[12475],256],65407:[[12477],256],65408:[[12479],256],65409:[[12481],256],65410:[[12484],256],65411:[[12486],256],65412:[[12488],256],65413:[[12490],256],65414:[[12491],256],65415:[[12492],256],65416:[[12493],256],65417:[[12494],256],65418:[[12495],256],65419:[[12498],256],65420:[[12501],256],65421:[[12504],256],65422:[[12507],256],65423:[[12510],256],65424:[[12511],256],65425:[[12512],256],65426:[[12513],256],65427:[[12514],256],65428:[[12516],256],65429:[[12518],256],65430:[[12520],256],65431:[[12521],256],65432:[[12522],256],65433:[[12523],256],65434:[[12524],256],65435:[[12525],256],65436:[[12527],256],65437:[[12531],256],65438:[[12441],256],65439:[[12442],256],65440:[[12644],256],65441:[[12593],256],65442:[[12594],256],65443:[[12595],256],65444:[[12596],256],65445:[[12597],256],65446:[[12598],256],65447:[[12599],256],65448:[[12600],256],65449:[[12601],256],65450:[[12602],256],65451:[[12603],256],65452:[[12604],256],65453:[[12605],256],65454:[[12606],256],65455:[[12607],256],65456:[[12608],256],65457:[[12609],256],65458:[[12610],256],65459:[[12611],256],65460:[[12612],256],65461:[[12613],256],65462:[[12614],256],65463:[[12615],256],65464:[[12616],256],65465:[[12617],256],65466:[[12618],256],65467:[[12619],256],65468:[[12620],256],65469:[[12621],256],65470:[[12622],256],65474:[[12623],256],65475:[[12624],256],65476:[[12625],256],65477:[[12626],256],65478:[[12627],256],65479:[[12628],256],65482:[[12629],256],65483:[[12630],256],65484:[[12631],256],65485:[[12632],256],65486:[[12633],256],65487:[[12634],256],65490:[[12635],256],65491:[[12636],256],65492:[[12637],256],65493:[[12638],256],65494:[[12639],256],65495:[[12640],256],65498:[[12641],256],65499:[[12642],256],65500:[[12643],256],65504:[[162],256],65505:[[163],256],65506:[[172],256],65507:[[175],256],65508:[[166],256],65509:[[165],256],65510:[[8361],256],65512:[[9474],256],65513:[[8592],256],65514:[[8593],256],65515:[[8594],256],65516:[[8595],256],65517:[[9632],256],65518:[[9675],256]}};var _={nfc:f,nfd:O,nfkc:d,nfkd:y};typeof Z4=="object"?Z4.exports=_:typeof define=="function"&&define.amd?define("unorm",function(){return _}):e.unorm=_,_.shimApplied=!1,String.prototype.normalize||(String.prototype.normalize=function(x){var b=""+this;if(x=x===void 0?"NFC":x,x==="NFC")return _.nfc(b);if(x==="NFD")return _.nfd(b);if(x==="NFKC")return _.nfkc(b);if(x==="NFKD")return _.nfkd(b);throw new RangeError("Invalid normalization form: "+x)},_.shimApplied=!0)})($B)});var eM=k((_5e,QB)=>{"use strict";v();var JB=cr();function Yre(e,t,r,i){var n=64;if(i>(Math.pow(2,32)-1)*n)throw Error("Requested key length too long");if(typeof e!="string"&&!h.Buffer.isBuffer(e))throw new TypeError("key must a string or Buffer");if(typeof t!="string"&&!h.Buffer.isBuffer(t))throw new TypeError("salt must a string or Buffer");typeof e=="string"&&(e=h.Buffer.from(e)),typeof t=="string"&&(t=h.Buffer.from(t));var o=h.Buffer.alloc(i),a=h.Buffer.alloc(n),s=h.Buffer.alloc(n),u=h.Buffer.alloc(t.length+4),c=Math.ceil(i/n),l=i-(c-1)*n;t.copy(u,0,0,t.length);for(var m=1;m<=c;m++){u[t.length+0]=m>>24&255,u[t.length+1]=m>>16&255,u[t.length+2]=m>>8&255,u[t.length+3]=m>>0&255,a=JB.sha512hmac(u,e),a.copy(s,0,0,n);for(var w=1;w<r;w++){a=JB.sha512hmac(a,e);for(var E=0;E<n;E++)s[E]^=a[E]}var P=(m-1)*n,M=m===c?l:n;s.copy(o,P,0,M)}return o}QB.exports=Yre});var iM=k((S5e,rM)=>{"use strict";v();var tM=_r();function $re(e,t,r,i){var n=64;if(i>(Math.pow(2,32)-1)*n)throw Error("Requested key length too long");if(typeof e!="string"&&!h.Buffer.isBuffer(e))throw new TypeError("key must a string or Buffer");if(typeof t!="string"&&!h.Buffer.isBuffer(t))throw new TypeError("salt must a string or Buffer");typeof e=="string"&&(e=h.Buffer.from(e)),typeof t=="string"&&(t=h.Buffer.from(t));var o=h.Buffer.alloc(i),a=h.Buffer.alloc(n),s=h.Buffer.alloc(n),u=h.Buffer.alloc(t.length+4),c=Math.ceil(i/n),l=i-(c-1)*n;t.copy(u,0,0,t.length);for(var m=1;m<=c;m++){u[t.length+0]=m>>24&255,u[t.length+1]=m>>16&255,u[t.length+2]=m>>8&255,u[t.length+3]=m>>0&255,a=tM.createHmac("sha512",e).update(u).digest(),a.copy(s,0,0,n);for(var w=1;w<r;w++){a=tM.createHmac("sha512",e).update(a).digest();for(var E=0;E<n;E++)s[E]^=a[E]}var P=(m-1)*n,M=m===c?l:n;s.copy(o,P,0,M)}return o}rM.exports=$re});var nM=k((E5e,W4)=>{v();A.default.browser?W4.exports=eM():W4.exports=iM()});var aM=k((I5e,oM)=>{"use strict";v();var Xre={name:"Mnemonic",message:"Internal Error on bsv-mnemonic module {0}",errors:[{name:"InvalidEntropy",message:"Entropy length must be an even multiple of 11 bits: {0}"},{name:"UnknownWordlist",message:"Could not detect the used word list: {0}"},{name:"InvalidMnemonic",message:"Mnemonic string is invalid: {0}"}]};oM.exports=Te().errors.extend(Xre)});var uM=k((P5e,sM)=>{"use strict";v();var Jre=["\u7684","\u4E00","\u662F","\u5728","\u4E0D","\u4E86","\u6709","\u548C","\u4EBA","\u8FD9","\u4E2D","\u5927","\u4E3A","\u4E0A","\u4E2A","\u56FD","\u6211","\u4EE5","\u8981","\u4ED6","\u65F6","\u6765","\u7528","\u4EEC","\u751F","\u5230","\u4F5C","\u5730","\u4E8E","\u51FA","\u5C31","\u5206","\u5BF9","\u6210","\u4F1A","\u53EF","\u4E3B","\u53D1","\u5E74","\u52A8","\u540C","\u5DE5","\u4E5F","\u80FD","\u4E0B","\u8FC7","\u5B50","\u8BF4","\u4EA7","\u79CD","\u9762","\u800C","\u65B9","\u540E","\u591A","\u5B9A","\u884C","\u5B66","\u6CD5","\u6240","\u6C11","\u5F97","\u7ECF","\u5341","\u4E09","\u4E4B","\u8FDB","\u7740","\u7B49","\u90E8","\u5EA6","\u5BB6","\u7535","\u529B","\u91CC","\u5982","\u6C34","\u5316","\u9AD8","\u81EA","\u4E8C","\u7406","\u8D77","\u5C0F","\u7269","\u73B0","\u5B9E","\u52A0","\u91CF","\u90FD","\u4E24","\u4F53","\u5236","\u673A","\u5F53","\u4F7F","\u70B9","\u4ECE","\u4E1A","\u672C","\u53BB","\u628A","\u6027","\u597D","\u5E94","\u5F00","\u5B83","\u5408","\u8FD8","\u56E0","\u7531","\u5176","\u4E9B","\u7136","\u524D","\u5916","\u5929","\u653F","\u56DB","\u65E5","\u90A3","\u793E","\u4E49","\u4E8B","\u5E73","\u5F62","\u76F8","\u5168","\u8868","\u95F4","\u6837","\u4E0E","\u5173","\u5404","\u91CD","\u65B0","\u7EBF","\u5185","\u6570","\u6B63","\u5FC3","\u53CD","\u4F60","\u660E","\u770B","\u539F","\u53C8","\u4E48","\u5229","\u6BD4","\u6216","\u4F46","\u8D28","\u6C14","\u7B2C","\u5411","\u9053","\u547D","\u6B64","\u53D8","\u6761","\u53EA","\u6CA1","\u7ED3","\u89E3","\u95EE","\u610F","\u5EFA","\u6708","\u516C","\u65E0","\u7CFB","\u519B","\u5F88","\u60C5","\u8005","\u6700","\u7ACB","\u4EE3","\u60F3","\u5DF2","\u901A","\u5E76","\u63D0","\u76F4","\u9898","\u515A","\u7A0B","\u5C55","\u4E94","\u679C","\u6599","\u8C61","\u5458","\u9769","\u4F4D","\u5165","\u5E38","\u6587","\u603B","\u6B21","\u54C1","\u5F0F","\u6D3B","\u8BBE","\u53CA","\u7BA1","\u7279","\u4EF6","\u957F","\u6C42","\u8001","\u5934","\u57FA","\u8D44","\u8FB9","\u6D41","\u8DEF","\u7EA7","\u5C11","\u56FE","\u5C71","\u7EDF","\u63A5","\u77E5","\u8F83","\u5C06","\u7EC4","\u89C1","\u8BA1","\u522B","\u5979","\u624B","\u89D2","\u671F","\u6839","\u8BBA","\u8FD0","\u519C","\u6307","\u51E0","\u4E5D","\u533A","\u5F3A","\u653E","\u51B3","\u897F","\u88AB","\u5E72","\u505A","\u5FC5","\u6218","\u5148","\u56DE","\u5219","\u4EFB","\u53D6","\u636E","\u5904","\u961F","\u5357","\u7ED9","\u8272","\u5149","\u95E8","\u5373","\u4FDD","\u6CBB","\u5317","\u9020","\u767E","\u89C4","\u70ED","\u9886","\u4E03","\u6D77","\u53E3","\u4E1C","\u5BFC","\u5668","\u538B","\u5FD7","\u4E16","\u91D1","\u589E","\u4E89","\u6D4E","\u9636","\u6CB9","\u601D","\u672F","\u6781","\u4EA4","\u53D7","\u8054","\u4EC0","\u8BA4","\u516D","\u5171","\u6743","\u6536","\u8BC1","\u6539","\u6E05","\u7F8E","\u518D","\u91C7","\u8F6C","\u66F4","\u5355","\u98CE","\u5207","\u6253","\u767D","\u6559","\u901F","\u82B1","\u5E26","\u5B89","\u573A","\u8EAB","\u8F66","\u4F8B","\u771F","\u52A1","\u5177","\u4E07","\u6BCF","\u76EE","\u81F3","\u8FBE","\u8D70","\u79EF","\u793A","\u8BAE","\u58F0","\u62A5","\u6597","\u5B8C","\u7C7B","\u516B","\u79BB","\u534E","\u540D","\u786E","\u624D","\u79D1","\u5F20","\u4FE1","\u9A6C","\u8282","\u8BDD","\u7C73","\u6574","\u7A7A","\u5143","\u51B5","\u4ECA","\u96C6","\u6E29","\u4F20","\u571F","\u8BB8","\u6B65","\u7FA4","\u5E7F","\u77F3","\u8BB0","\u9700","\u6BB5","\u7814","\u754C","\u62C9","\u6797","\u5F8B","\u53EB","\u4E14","\u7A76","\u89C2","\u8D8A","\u7EC7","\u88C5","\u5F71","\u7B97","\u4F4E","\u6301","\u97F3","\u4F17","\u4E66","\u5E03","\u590D","\u5BB9","\u513F","\u987B","\u9645","\u5546","\u975E","\u9A8C","\u8FDE","\u65AD","\u6DF1","\u96BE","\u8FD1","\u77FF","\u5343","\u5468","\u59D4","\u7D20","\u6280","\u5907","\u534A","\u529E","\u9752","\u7701","\u5217","\u4E60","\u54CD","\u7EA6","\u652F","\u822C","\u53F2","\u611F","\u52B3","\u4FBF","\u56E2","\u5F80","\u9178","\u5386","\u5E02","\u514B","\u4F55","\u9664","\u6D88","\u6784","\u5E9C","\u79F0","\u592A","\u51C6","\u7CBE","\u503C","\u53F7","\u7387","\u65CF","\u7EF4","\u5212","\u9009","\u6807","\u5199","\u5B58","\u5019","\u6BDB","\u4EB2","\u5FEB","\u6548","\u65AF","\u9662","\u67E5","\u6C5F","\u578B","\u773C","\u738B","\u6309","\u683C","\u517B","\u6613","\u7F6E","\u6D3E","\u5C42","\u7247","\u59CB","\u5374","\u4E13","\u72B6","\u80B2","\u5382","\u4EAC","\u8BC6","\u9002","\u5C5E","\u5706","\u5305","\u706B","\u4F4F","\u8C03","\u6EE1","\u53BF","\u5C40","\u7167","\u53C2","\u7EA2","\u7EC6","\u5F15","\u542C","\u8BE5","\u94C1","\u4EF7","\u4E25","\u9996","\u5E95","\u6DB2","\u5B98","\u5FB7","\u968F","\u75C5","\u82CF","\u5931","\u5C14","\u6B7B","\u8BB2","\u914D","\u5973","\u9EC4","\u63A8","\u663E","\u8C08","\u7F6A","\u795E","\u827A","\u5462","\u5E2D","\u542B","\u4F01","\u671B","\u5BC6","\u6279","\u8425","\u9879","\u9632","\u4E3E","\u7403","\u82F1","\u6C27","\u52BF","\u544A","\u674E","\u53F0","\u843D","\u6728","\u5E2E","\u8F6E","\u7834","\u4E9A","\u5E08","\u56F4","\u6CE8","\u8FDC","\u5B57","\u6750","\u6392","\u4F9B","\u6CB3","\u6001","\u5C01","\u53E6","\u65BD","\u51CF","\u6811","\u6EB6","\u600E","\u6B62","\u6848","\u8A00","\u58EB","\u5747","\u6B66","\u56FA","\u53F6","\u9C7C","\u6CE2","\u89C6","\u4EC5","\u8D39","\u7D27","\u7231","\u5DE6","\u7AE0","\u65E9","\u671D","\u5BB3","\u7EED","\u8F7B","\u670D","\u8BD5","\u98DF","\u5145","\u5175","\u6E90","\u5224","\u62A4","\u53F8","\u8DB3","\u67D0","\u7EC3","\u5DEE","\u81F4","\u677F","\u7530","\u964D","\u9ED1","\u72AF","\u8D1F","\u51FB","\u8303","\u7EE7","\u5174","\u4F3C","\u4F59","\u575A","\u66F2","\u8F93","\u4FEE","\u6545","\u57CE","\u592B","\u591F","\u9001","\u7B14","\u8239","\u5360","\u53F3","\u8D22","\u5403","\u5BCC","\u6625","\u804C","\u89C9","\u6C49","\u753B","\u529F","\u5DF4","\u8DDF","\u867D","\u6742","\u98DE","\u68C0","\u5438","\u52A9","\u5347","\u9633","\u4E92","\u521D","\u521B","\u6297","\u8003","\u6295","\u574F","\u7B56","\u53E4","\u5F84","\u6362","\u672A","\u8DD1","\u7559","\u94A2","\u66FE","\u7AEF","\u8D23","\u7AD9","\u7B80","\u8FF0","\u94B1","\u526F","\u5C3D","\u5E1D","\u5C04","\u8349","\u51B2","\u627F","\u72EC","\u4EE4","\u9650","\u963F","\u5BA3","\u73AF","\u53CC","\u8BF7","\u8D85","\u5FAE","\u8BA9","\u63A7","\u5DDE","\u826F","\u8F74","\u627E","\u5426","\u7EAA","\u76CA","\u4F9D","\u4F18","\u9876","\u7840","\u8F7D","\u5012","\u623F","\u7A81","\u5750","\u7C89","\u654C","\u7565","\u5BA2","\u8881","\u51B7","\u80DC","\u7EDD","\u6790","\u5757","\u5242","\u6D4B","\u4E1D","\u534F","\u8BC9","\u5FF5","\u9648","\u4ECD","\u7F57","\u76D0","\u53CB","\u6D0B","\u9519","\u82E6","\u591C","\u5211","\u79FB","\u9891","\u9010","\u9760","\u6DF7","\u6BCD","\u77ED","\u76AE","\u7EC8","\u805A","\u6C7D","\u6751","\u4E91","\u54EA","\u65E2","\u8DDD","\u536B","\u505C","\u70C8","\u592E","\u5BDF","\u70E7","\u8FC5","\u5883","\u82E5","\u5370","\u6D32","\u523B","\u62EC","\u6FC0","\u5B54","\u641E","\u751A","\u5BA4","\u5F85","\u6838","\u6821","\u6563","\u4FB5","\u5427","\u7532","\u6E38","\u4E45","\u83DC","\u5473","\u65E7","\u6A21","\u6E56","\u8D27","\u635F","\u9884","\u963B","\u6BEB","\u666E","\u7A33","\u4E59","\u5988","\u690D","\u606F","\u6269","\u94F6","\u8BED","\u6325","\u9152","\u5B88","\u62FF","\u5E8F","\u7EB8","\u533B","\u7F3A","\u96E8","\u5417","\u9488","\u5218","\u554A","\u6025","\u5531","\u8BEF","\u8BAD","\u613F","\u5BA1","\u9644","\u83B7","\u8336","\u9C9C","\u7CAE","\u65A4","\u5B69","\u8131","\u786B","\u80A5","\u5584","\u9F99","\u6F14","\u7236","\u6E10","\u8840","\u6B22","\u68B0","\u638C","\u6B4C","\u6C99","\u521A","\u653B","\u8C13","\u76FE","\u8BA8","\u665A","\u7C92","\u4E71","\u71C3","\u77DB","\u4E4E","\u6740","\u836F","\u5B81","\u9C81","\u8D35","\u949F","\u7164","\u8BFB","\u73ED","\u4F2F","\u9999","\u4ECB","\u8FEB","\u53E5","\u4E30","\u57F9","\u63E1","\u5170","\u62C5","\u5F26","\u86CB","\u6C89","\u5047","\u7A7F","\u6267","\u7B54","\u4E50","\u8C01","\u987A","\u70DF","\u7F29","\u5F81","\u8138","\u559C","\u677E","\u811A","\u56F0","\u5F02","\u514D","\u80CC","\u661F","\u798F","\u4E70","\u67D3","\u4E95","\u6982","\u6162","\u6015","\u78C1","\u500D","\u7956","\u7687","\u4FC3","\u9759","\u8865","\u8BC4","\u7FFB","\u8089","\u8DF5","\u5C3C","\u8863","\u5BBD","\u626C","\u68C9","\u5E0C","\u4F24","\u64CD","\u5782","\u79CB","\u5B9C","\u6C22","\u5957","\u7763","\u632F","\u67B6","\u4EAE","\u672B","\u5BAA","\u5E86","\u7F16","\u725B","\u89E6","\u6620","\u96F7","\u9500","\u8BD7","\u5EA7","\u5C45","\u6293","\u88C2","\u80DE","\u547C","\u5A18","\u666F","\u5A01","\u7EFF","\u6676","\u539A","\u76DF","\u8861","\u9E21","\u5B59","\u5EF6","\u5371","\u80F6","\u5C4B","\u4E61","\u4E34","\u9646","\u987E","\u6389","\u5440","\u706F","\u5C81","\u63AA","\u675F","\u8010","\u5267","\u7389","\u8D75","\u8DF3","\u54E5","\u5B63","\u8BFE","\u51EF","\u80E1","\u989D","\u6B3E","\u7ECD","\u5377","\u9F50","\u4F1F","\u84B8","\u6B96","\u6C38","\u5B97","\u82D7","\u5DDD","\u7089","\u5CA9","\u5F31","\u96F6","\u6768","\u594F","\u6CBF","\u9732","\u6746","\u63A2","\u6ED1","\u9547","\u996D","\u6D53","\u822A","\u6000","\u8D76","\u5E93","\u593A","\u4F0A","\u7075","\u7A0E","\u9014","\u706D","\u8D5B","\u5F52","\u53EC","\u9F13","\u64AD","\u76D8","\u88C1","\u9669","\u5EB7","\u552F","\u5F55","\u83CC","\u7EAF","\u501F","\u7CD6","\u76D6","\u6A2A","\u7B26","\u79C1","\u52AA","\u5802","\u57DF","\u67AA","\u6DA6","\u5E45","\u54C8","\u7ADF","\u719F","\u866B","\u6CFD","\u8111","\u58E4","\u78B3","\u6B27","\u904D","\u4FA7","\u5BE8","\u6562","\u5F7B","\u8651","\u659C","\u8584","\u5EAD","\u7EB3","\u5F39","\u9972","\u4F38","\u6298","\u9EA6","\u6E7F","\u6697","\u8377","\u74E6","\u585E","\u5E8A","\u7B51","\u6076","\u6237","\u8BBF","\u5854","\u5947","\u900F","\u6881","\u5200","\u65CB","\u8FF9","\u5361","\u6C2F","\u9047","\u4EFD","\u6BD2","\u6CE5","\u9000","\u6D17","\u6446","\u7070","\u5F69","\u5356","\u8017","\u590F","\u62E9","\u5FD9","\u94DC","\u732E","\u786C","\u4E88","\u7E41","\u5708","\u96EA","\u51FD","\u4EA6","\u62BD","\u7BC7","\u9635","\u9634","\u4E01","\u5C3A","\u8FFD","\u5806","\u96C4","\u8FCE","\u6CDB","\u7238","\u697C","\u907F","\u8C0B","\u5428","\u91CE","\u732A","\u65D7","\u7D2F","\u504F","\u5178","\u9986","\u7D22","\u79E6","\u8102","\u6F6E","\u7237","\u8C46","\u5FFD","\u6258","\u60CA","\u5851","\u9057","\u6108","\u6731","\u66FF","\u7EA4","\u7C97","\u503E","\u5C1A","\u75DB","\u695A","\u8C22","\u594B","\u8D2D","\u78E8","\u541B","\u6C60","\u65C1","\u788E","\u9AA8","\u76D1","\u6355","\u5F1F","\u66B4","\u5272","\u8D2F","\u6B8A","\u91CA","\u8BCD","\u4EA1","\u58C1","\u987F","\u5B9D","\u5348","\u5C18","\u95FB","\u63ED","\u70AE","\u6B8B","\u51AC","\u6865","\u5987","\u8B66","\u7EFC","\u62DB","\u5434","\u4ED8","\u6D6E","\u906D","\u5F90","\u60A8","\u6447","\u8C37","\u8D5E","\u7BB1","\u9694","\u8BA2","\u7537","\u5439","\u56ED","\u7EB7","\u5510","\u8D25","\u5B8B","\u73BB","\u5DE8","\u8015","\u5766","\u8363","\u95ED","\u6E7E","\u952E","\u51E1","\u9A7B","\u9505","\u6551","\u6069","\u5265","\u51DD","\u78B1","\u9F7F","\u622A","\u70BC","\u9EBB","\u7EBA","\u7981","\u5E9F","\u76DB","\u7248","\u7F13","\u51C0","\u775B","\u660C","\u5A5A","\u6D89","\u7B52","\u5634","\u63D2","\u5CB8","\u6717","\u5E84","\u8857","\u85CF","\u59D1","\u8D38","\u8150","\u5974","\u5566","\u60EF","\u4E58","\u4F19","\u6062","\u5300","\u7EB1","\u624E","\u8FA9","\u8033","\u5F6A","\u81E3","\u4EBF","\u7483","\u62B5","\u8109","\u79C0","\u8428","\u4FC4","\u7F51","\u821E","\u5E97","\u55B7","\u7EB5","\u5BF8","\u6C57","\u6302","\u6D2A","\u8D3A","\u95EA","\u67EC","\u7206","\u70EF","\u6D25","\u7A3B","\u5899","\u8F6F","\u52C7","\u50CF","\u6EDA","\u5398","\u8499","\u82B3","\u80AF","\u5761","\u67F1","\u8361","\u817F","\u4EEA","\u65C5","\u5C3E","\u8F67","\u51B0","\u8D21","\u767B","\u9ECE","\u524A","\u94BB","\u52D2","\u9003","\u969C","\u6C28","\u90ED","\u5CF0","\u5E01","\u6E2F","\u4F0F","\u8F68","\u4EA9","\u6BD5","\u64E6","\u83AB","\u523A","\u6D6A","\u79D8","\u63F4","\u682A","\u5065","\u552E","\u80A1","\u5C9B","\u7518","\u6CE1","\u7761","\u7AE5","\u94F8","\u6C64","\u9600","\u4F11","\u6C47","\u820D","\u7267","\u7ED5","\u70B8","\u54F2","\u78F7","\u7EE9","\u670B","\u6DE1","\u5C16","\u542F","\u9677","\u67F4","\u5448","\u5F92","\u989C","\u6CEA","\u7A0D","\u5FD8","\u6CF5","\u84DD","\u62D6","\u6D1E","\u6388","\u955C","\u8F9B","\u58EE","\u950B","\u8D2B","\u865A","\u5F2F","\u6469","\u6CF0","\u5E7C","\u5EF7","\u5C0A","\u7A97","\u7EB2","\u5F04","\u96B6","\u7591","\u6C0F","\u5BAB","\u59D0","\u9707","\u745E","\u602A","\u5C24","\u7434","\u5FAA","\u63CF","\u819C","\u8FDD","\u5939","\u8170","\u7F18","\u73E0","\u7A77","\u68EE","\u679D","\u7AF9","\u6C9F","\u50AC","\u7EF3","\u5FC6","\u90A6","\u5269","\u5E78","\u6D46","\u680F","\u62E5","\u7259","\u8D2E","\u793C","\u6EE4","\u94A0","\u7EB9","\u7F62","\u62CD","\u54B1","\u558A","\u8896","\u57C3","\u52E4","\u7F5A","\u7126","\u6F5C","\u4F0D","\u58A8","\u6B32","\u7F1D","\u59D3","\u520A","\u9971","\u4EFF","\u5956","\u94DD","\u9B3C","\u4E3D","\u8DE8","\u9ED8","\u6316","\u94FE","\u626B","\u559D","\u888B","\u70AD","\u6C61","\u5E55","\u8BF8","\u5F27","\u52B1","\u6885","\u5976","\u6D01","\u707E","\u821F","\u9274","\u82EF","\u8BBC","\u62B1","\u6BC1","\u61C2","\u5BD2","\u667A","\u57D4","\u5BC4","\u5C4A","\u8DC3","\u6E21","\u6311","\u4E39","\u8270","\u8D1D","\u78B0","\u62D4","\u7239","\u6234","\u7801","\u68A6","\u82BD","\u7194","\u8D64","\u6E14","\u54ED","\u656C","\u9897","\u5954","\u94C5","\u4EF2","\u864E","\u7A00","\u59B9","\u4E4F","\u73CD","\u7533","\u684C","\u9075","\u5141","\u9686","\u87BA","\u4ED3","\u9B4F","\u9510","\u6653","\u6C2E","\u517C","\u9690","\u788D","\u8D6B","\u62E8","\u5FE0","\u8083","\u7F38","\u7275","\u62A2","\u535A","\u5DE7","\u58F3","\u5144","\u675C","\u8BAF","\u8BDA","\u78A7","\u7965","\u67EF","\u9875","\u5DE1","\u77E9","\u60B2","\u704C","\u9F84","\u4F26","\u7968","\u5BFB","\u6842","\u94FA","\u5723","\u6050","\u6070","\u90D1","\u8DA3","\u62AC","\u8352","\u817E","\u8D34","\u67D4","\u6EF4","\u731B","\u9614","\u8F86","\u59BB","\u586B","\u64A4","\u50A8","\u7B7E","\u95F9","\u6270","\u7D2B","\u7802","\u9012","\u620F","\u540A","\u9676","\u4F10","\u5582","\u7597","\u74F6","\u5A46","\u629A","\u81C2","\u6478","\u5FCD","\u867E","\u8721","\u90BB","\u80F8","\u5DE9","\u6324","\u5076","\u5F03","\u69FD","\u52B2","\u4E73","\u9093","\u5409","\u4EC1","\u70C2","\u7816","\u79DF","\u4E4C","\u8230","\u4F34","\u74DC","\u6D45","\u4E19","\u6682","\u71E5","\u6A61","\u67F3","\u8FF7","\u6696","\u724C","\u79E7","\u80C6","\u8BE6","\u7C27","\u8E0F","\u74F7","\u8C31","\u5446","\u5BBE","\u7CCA","\u6D1B","\u8F89","\u6124","\u7ADE","\u9699","\u6012","\u7C98","\u4E43","\u7EEA","\u80A9","\u7C4D","\u654F","\u6D82","\u7199","\u7686","\u4FA6","\u60AC","\u6398","\u4EAB","\u7EA0","\u9192","\u72C2","\u9501","\u6DC0","\u6068","\u7272","\u9738","\u722C","\u8D4F","\u9006","\u73A9","\u9675","\u795D","\u79D2","\u6D59","\u8C8C","\u5F79","\u5F7C","\u6089","\u9E2D","\u8D8B","\u51E4","\u6668","\u755C","\u8F88","\u79E9","\u5375","\u7F72","\u68AF","\u708E","\u6EE9","\u68CB","\u9A71","\u7B5B","\u5CE1","\u5192","\u5565","\u5BFF","\u8BD1","\u6D78","\u6CC9","\u5E3D","\u8FDF","\u7845","\u7586","\u8D37","\u6F0F","\u7A3F","\u51A0","\u5AE9","\u80C1","\u82AF","\u7262","\u53DB","\u8680","\u5965","\u9E23","\u5CAD","\u7F8A","\u51ED","\u4E32","\u5858","\u7ED8","\u9175","\u878D","\u76C6","\u9521","\u5E99","\u7B79","\u51BB","\u8F85","\u6444","\u88AD","\u7B4B","\u62D2","\u50DA","\u65F1","\u94BE","\u9E1F","\u6F06","\u6C88","\u7709","\u758F","\u6DFB","\u68D2","\u7A57","\u785D","\u97E9","\u903C","\u626D","\u4FA8","\u51C9","\u633A","\u7897","\u683D","\u7092","\u676F","\u60A3","\u998F","\u529D","\u8C6A","\u8FBD","\u52C3","\u9E3F","\u65E6","\u540F","\u62DC","\u72D7","\u57CB","\u8F8A","\u63A9","\u996E","\u642C","\u9A82","\u8F9E","\u52FE","\u6263","\u4F30","\u848B","\u7ED2","\u96FE","\u4E08","\u6735","\u59C6","\u62DF","\u5B87","\u8F91","\u9655","\u96D5","\u507F","\u84C4","\u5D07","\u526A","\u5021","\u5385","\u54AC","\u9A76","\u85AF","\u5237","\u65A5","\u756A","\u8D4B","\u5949","\u4F5B","\u6D47","\u6F2B","\u66FC","\u6247","\u9499","\u6843","\u6276","\u4ED4","\u8FD4","\u4FD7","\u4E8F","\u8154","\u978B","\u68F1","\u8986","\u6846","\u6084","\u53D4","\u649E","\u9A97","\u52D8","\u65FA","\u6CB8","\u5B64","\u5410","\u5B5F","\u6E20","\u5C48","\u75BE","\u5999","\u60DC","\u4EF0","\u72E0","\u80C0","\u8C10","\u629B","\u9709","\u6851","\u5C97","\u561B","\u8870","\u76D7","\u6E17","\u810F","\u8D56","\u6D8C","\u751C","\u66F9","\u9605","\u808C","\u54E9","\u5389","\u70C3","\u7EAC","\u6BC5","\u6628","\u4F2A","\u75C7","\u716E","\u53F9","\u9489","\u642D","\u830E","\u7B3C","\u9177","\u5077","\u5F13","\u9525","\u6052","\u6770","\u5751","\u9F3B","\u7FFC","\u7EB6","\u53D9","\u72F1","\u902E","\u7F50","\u7EDC","\u68DA","\u6291","\u81A8","\u852C","\u5BFA","\u9AA4","\u7A46","\u51B6","\u67AF","\u518C","\u5C38","\u51F8","\u7EC5","\u576F","\u727A","\u7130","\u8F70","\u6B23","\u664B","\u7626","\u5FA1","\u952D","\u9526","\u4E27","\u65EC","\u953B","\u5784","\u641C","\u6251","\u9080","\u4EAD","\u916F","\u8FC8","\u8212","\u8106","\u9176","\u95F2","\u5FE7","\u915A","\u987D","\u7FBD","\u6DA8","\u5378","\u4ED7","\u966A","\u8F9F","\u60E9","\u676D","\u59DA","\u809A","\u6349","\u98D8","\u6F02","\u6606","\u6B3A","\u543E","\u90CE","\u70F7","\u6C41","\u5475","\u9970","\u8427","\u96C5","\u90AE","\u8FC1","\u71D5","\u6492","\u59FB","\u8D74","\u5BB4","\u70E6","\u503A","\u5E10","\u6591","\u94C3","\u65E8","\u9187","\u8463","\u997C","\u96CF","\u59FF","\u62CC","\u5085","\u8179","\u59A5","\u63C9","\u8D24","\u62C6","\u6B6A","\u8461","\u80FA","\u4E22","\u6D69","\u5FBD","\u6602","\u57AB","\u6321","\u89C8","\u8D2A","\u6170","\u7F34","\u6C6A","\u614C","\u51AF","\u8BFA","\u59DC","\u8C0A","\u51F6","\u52A3","\u8BEC","\u8000","\u660F","\u8EBA","\u76C8","\u9A91","\u4E54","\u6EAA","\u4E1B","\u5362","\u62B9","\u95F7","\u54A8","\u522E","\u9A7E","\u7F06","\u609F","\u6458","\u94D2","\u63B7","\u9887","\u5E7B","\u67C4","\u60E0","\u60E8","\u4F73","\u4EC7","\u814A","\u7A9D","\u6DA4","\u5251","\u77A7","\u5821","\u6CFC","\u8471","\u7F69","\u970D","\u635E","\u80CE","\u82CD","\u6EE8","\u4FE9","\u6345","\u6E58","\u780D","\u971E","\u90B5","\u8404","\u75AF","\u6DEE","\u9042","\u718A","\u7CAA","\u70D8","\u5BBF","\u6863","\u6208","\u9A73","\u5AC2","\u88D5","\u5F99","\u7BAD","\u6350","\u80A0","\u6491","\u6652","\u8FA8","\u6BBF","\u83B2","\u644A","\u6405","\u9171","\u5C4F","\u75AB","\u54C0","\u8521","\u5835","\u6CAB","\u76B1","\u7545","\u53E0","\u9601","\u83B1","\u6572","\u8F96","\u94A9","\u75D5","\u575D","\u5DF7","\u997F","\u7978","\u4E18","\u7384","\u6E9C","\u66F0","\u903B","\u5F6D","\u5C1D","\u537F","\u59A8","\u8247","\u541E","\u97E6","\u6028","\u77EE","\u6B47"];sM.exports=Jre});var cM=k((k5e,fM)=>{"use strict";v();var Qre=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];fM.exports=Qre});var hM=k((B5e,lM)=>{"use string";v();var eie=["abaisser","abandon","abdiquer","abeille","abolir","aborder","aboutir","aboyer","abrasif","abreuver","abriter","abroger","abrupt","absence","absolu","absurde","abusif","abyssal","acade\u0301mie","acajou","acarien","accabler","accepter","acclamer","accolade","accroche","accuser","acerbe","achat","acheter","aciduler","acier","acompte","acque\u0301rir","acronyme","acteur","actif","actuel","adepte","ade\u0301quat","adhe\u0301sif","adjectif","adjuger","admettre","admirer","adopter","adorer","adoucir","adresse","adroit","adulte","adverbe","ae\u0301rer","ae\u0301ronef","affaire","affecter","affiche","affreux","affubler","agacer","agencer","agile","agiter","agrafer","agre\u0301able","agrume","aider","aiguille","ailier","aimable","aisance","ajouter","ajuster","alarmer","alchimie","alerte","alge\u0300bre","algue","alie\u0301ner","aliment","alle\u0301ger","alliage","allouer","allumer","alourdir","alpaga","altesse","alve\u0301ole","amateur","ambigu","ambre","ame\u0301nager","amertume","amidon","amiral","amorcer","amour","amovible","amphibie","ampleur","amusant","analyse","anaphore","anarchie","anatomie","ancien","ane\u0301antir","angle","angoisse","anguleux","animal","annexer","annonce","annuel","anodin","anomalie","anonyme","anormal","antenne","antidote","anxieux","apaiser","ape\u0301ritif","aplanir","apologie","appareil","appeler","apporter","appuyer","aquarium","aqueduc","arbitre","arbuste","ardeur","ardoise","argent","arlequin","armature","armement","armoire","armure","arpenter","arracher","arriver","arroser","arsenic","arte\u0301riel","article","aspect","asphalte","aspirer","assaut","asservir","assiette","associer","assurer","asticot","astre","astuce","atelier","atome","atrium","atroce","attaque","attentif","attirer","attraper","aubaine","auberge","audace","audible","augurer","aurore","automne","autruche","avaler","avancer","avarice","avenir","averse","aveugle","aviateur","avide","avion","aviser","avoine","avouer","avril","axial","axiome","badge","bafouer","bagage","baguette","baignade","balancer","balcon","baleine","balisage","bambin","bancaire","bandage","banlieue","bannie\u0300re","banquier","barbier","baril","baron","barque","barrage","bassin","bastion","bataille","bateau","batterie","baudrier","bavarder","belette","be\u0301lier","belote","be\u0301ne\u0301fice","berceau","berger","berline","bermuda","besace","besogne","be\u0301tail","beurre","biberon","bicycle","bidule","bijou","bilan","bilingue","billard","binaire","biologie","biopsie","biotype","biscuit","bison","bistouri","bitume","bizarre","blafard","blague","blanchir","blessant","blinder","blond","bloquer","blouson","bobard","bobine","boire","boiser","bolide","bonbon","bondir","bonheur","bonifier","bonus","bordure","borne","botte","boucle","boueux","bougie","boulon","bouquin","bourse","boussole","boutique","boxeur","branche","brasier","brave","brebis","bre\u0300che","breuvage","bricoler","brigade","brillant","brioche","brique","brochure","broder","bronzer","brousse","broyeur","brume","brusque","brutal","bruyant","buffle","buisson","bulletin","bureau","burin","bustier","butiner","butoir","buvable","buvette","cabanon","cabine","cachette","cadeau","cadre","cafe\u0301ine","caillou","caisson","calculer","calepin","calibre","calmer","calomnie","calvaire","camarade","came\u0301ra","camion","campagne","canal","caneton","canon","cantine","canular","capable","caporal","caprice","capsule","capter","capuche","carabine","carbone","caresser","caribou","carnage","carotte","carreau","carton","cascade","casier","casque","cassure","causer","caution","cavalier","caverne","caviar","ce\u0301dille","ceinture","ce\u0301leste","cellule","cendrier","censurer","central","cercle","ce\u0301re\u0301bral","cerise","cerner","cerveau","cesser","chagrin","chaise","chaleur","chambre","chance","chapitre","charbon","chasseur","chaton","chausson","chavirer","chemise","chenille","che\u0301quier","chercher","cheval","chien","chiffre","chignon","chime\u0300re","chiot","chlorure","chocolat","choisir","chose","chouette","chrome","chute","cigare","cigogne","cimenter","cine\u0301ma","cintrer","circuler","cirer","cirque","citerne","citoyen","citron","civil","clairon","clameur","claquer","classe","clavier","client","cligner","climat","clivage","cloche","clonage","cloporte","cobalt","cobra","cocasse","cocotier","coder","codifier","coffre","cogner","cohe\u0301sion","coiffer","coincer","cole\u0300re","colibri","colline","colmater","colonel","combat","come\u0301die","commande","compact","concert","conduire","confier","congeler","connoter","consonne","contact","convexe","copain","copie","corail","corbeau","cordage","corniche","corpus","correct","corte\u0300ge","cosmique","costume","coton","coude","coupure","courage","couteau","couvrir","coyote","crabe","crainte","cravate","crayon","cre\u0301ature","cre\u0301diter","cre\u0301meux","creuser","crevette","cribler","crier","cristal","crite\u0300re","croire","croquer","crotale","crucial","cruel","crypter","cubique","cueillir","cuille\u0300re","cuisine","cuivre","culminer","cultiver","cumuler","cupide","curatif","curseur","cyanure","cycle","cylindre","cynique","daigner","damier","danger","danseur","dauphin","de\u0301battre","de\u0301biter","de\u0301border","de\u0301brider","de\u0301butant","de\u0301caler","de\u0301cembre","de\u0301chirer","de\u0301cider","de\u0301clarer","de\u0301corer","de\u0301crire","de\u0301cupler","de\u0301dale","de\u0301ductif","de\u0301esse","de\u0301fensif","de\u0301filer","de\u0301frayer","de\u0301gager","de\u0301givrer","de\u0301glutir","de\u0301grafer","de\u0301jeuner","de\u0301lice","de\u0301loger","demander","demeurer","de\u0301molir","de\u0301nicher","de\u0301nouer","dentelle","de\u0301nuder","de\u0301part","de\u0301penser","de\u0301phaser","de\u0301placer","de\u0301poser","de\u0301ranger","de\u0301rober","de\u0301sastre","descente","de\u0301sert","de\u0301signer","de\u0301sobe\u0301ir","dessiner","destrier","de\u0301tacher","de\u0301tester","de\u0301tourer","de\u0301tresse","devancer","devenir","deviner","devoir","diable","dialogue","diamant","dicter","diffe\u0301rer","dige\u0301rer","digital","digne","diluer","dimanche","diminuer","dioxyde","directif","diriger","discuter","disposer","dissiper","distance","divertir","diviser","docile","docteur","dogme","doigt","domaine","domicile","dompter","donateur","donjon","donner","dopamine","dortoir","dorure","dosage","doseur","dossier","dotation","douanier","double","douceur","douter","doyen","dragon","draper","dresser","dribbler","droiture","duperie","duplexe","durable","durcir","dynastie","e\u0301blouir","e\u0301carter","e\u0301charpe","e\u0301chelle","e\u0301clairer","e\u0301clipse","e\u0301clore","e\u0301cluse","e\u0301cole","e\u0301conomie","e\u0301corce","e\u0301couter","e\u0301craser","e\u0301cre\u0301mer","e\u0301crivain","e\u0301crou","e\u0301cume","e\u0301cureuil","e\u0301difier","e\u0301duquer","effacer","effectif","effigie","effort","effrayer","effusion","e\u0301galiser","e\u0301garer","e\u0301jecter","e\u0301laborer","e\u0301largir","e\u0301lectron","e\u0301le\u0301gant","e\u0301le\u0301phant","e\u0301le\u0300ve","e\u0301ligible","e\u0301litisme","e\u0301loge","e\u0301lucider","e\u0301luder","emballer","embellir","embryon","e\u0301meraude","e\u0301mission","emmener","e\u0301motion","e\u0301mouvoir","empereur","employer","emporter","emprise","e\u0301mulsion","encadrer","enche\u0300re","enclave","encoche","endiguer","endosser","endroit","enduire","e\u0301nergie","enfance","enfermer","enfouir","engager","engin","englober","e\u0301nigme","enjamber","enjeu","enlever","ennemi","ennuyeux","enrichir","enrobage","enseigne","entasser","entendre","entier","entourer","entraver","e\u0301nume\u0301rer","envahir","enviable","envoyer","enzyme","e\u0301olien","e\u0301paissir","e\u0301pargne","e\u0301patant","e\u0301paule","e\u0301picerie","e\u0301pide\u0301mie","e\u0301pier","e\u0301pilogue","e\u0301pine","e\u0301pisode","e\u0301pitaphe","e\u0301poque","e\u0301preuve","e\u0301prouver","e\u0301puisant","e\u0301querre","e\u0301quipe","e\u0301riger","e\u0301rosion","erreur","e\u0301ruption","escalier","espadon","espe\u0300ce","espie\u0300gle","espoir","esprit","esquiver","essayer","essence","essieu","essorer","estime","estomac","estrade","e\u0301tage\u0300re","e\u0301taler","e\u0301tanche","e\u0301tatique","e\u0301teindre","e\u0301tendoir","e\u0301ternel","e\u0301thanol","e\u0301thique","ethnie","e\u0301tirer","e\u0301toffer","e\u0301toile","e\u0301tonnant","e\u0301tourdir","e\u0301trange","e\u0301troit","e\u0301tude","euphorie","e\u0301valuer","e\u0301vasion","e\u0301ventail","e\u0301vidence","e\u0301viter","e\u0301volutif","e\u0301voquer","exact","exage\u0301rer","exaucer","exceller","excitant","exclusif","excuse","exe\u0301cuter","exemple","exercer","exhaler","exhorter","exigence","exiler","exister","exotique","expe\u0301dier","explorer","exposer","exprimer","exquis","extensif","extraire","exulter","fable","fabuleux","facette","facile","facture","faiblir","falaise","fameux","famille","farceur","farfelu","farine","farouche","fasciner","fatal","fatigue","faucon","fautif","faveur","favori","fe\u0301brile","fe\u0301conder","fe\u0301de\u0301rer","fe\u0301lin","femme","fe\u0301mur","fendoir","fe\u0301odal","fermer","fe\u0301roce","ferveur","festival","feuille","feutre","fe\u0301vrier","fiasco","ficeler","fictif","fide\u0300le","figure","filature","filetage","filie\u0300re","filleul","filmer","filou","filtrer","financer","finir","fiole","firme","fissure","fixer","flairer","flamme","flasque","flatteur","fle\u0301au","fle\u0300che","fleur","flexion","flocon","flore","fluctuer","fluide","fluvial","folie","fonderie","fongible","fontaine","forcer","forgeron","formuler","fortune","fossile","foudre","fouge\u0300re","fouiller","foulure","fourmi","fragile","fraise","franchir","frapper","frayeur","fre\u0301gate","freiner","frelon","fre\u0301mir","fre\u0301ne\u0301sie","fre\u0300re","friable","friction","frisson","frivole","froid","fromage","frontal","frotter","fruit","fugitif","fuite","fureur","furieux","furtif","fusion","futur","gagner","galaxie","galerie","gambader","garantir","gardien","garnir","garrigue","gazelle","gazon","ge\u0301ant","ge\u0301latine","ge\u0301lule","gendarme","ge\u0301ne\u0301ral","ge\u0301nie","genou","gentil","ge\u0301ologie","ge\u0301ome\u0300tre","ge\u0301ranium","germe","gestuel","geyser","gibier","gicler","girafe","givre","glace","glaive","glisser","globe","gloire","glorieux","golfeur","gomme","gonfler","gorge","gorille","goudron","gouffre","goulot","goupille","gourmand","goutte","graduel","graffiti","graine","grand","grappin","gratuit","gravir","grenat","griffure","griller","grimper","grogner","gronder","grotte","groupe","gruger","grutier","gruye\u0300re","gue\u0301pard","guerrier","guide","guimauve","guitare","gustatif","gymnaste","gyrostat","habitude","hachoir","halte","hameau","hangar","hanneton","haricot","harmonie","harpon","hasard","he\u0301lium","he\u0301matome","herbe","he\u0301risson","hermine","he\u0301ron","he\u0301siter","heureux","hiberner","hibou","hilarant","histoire","hiver","homard","hommage","homoge\u0300ne","honneur","honorer","honteux","horde","horizon","horloge","hormone","horrible","houleux","housse","hublot","huileux","humain","humble","humide","humour","hurler","hydromel","hygie\u0300ne","hymne","hypnose","idylle","ignorer","iguane","illicite","illusion","image","imbiber","imiter","immense","immobile","immuable","impact","impe\u0301rial","implorer","imposer","imprimer","imputer","incarner","incendie","incident","incliner","incolore","indexer","indice","inductif","ine\u0301dit","ineptie","inexact","infini","infliger","informer","infusion","inge\u0301rer","inhaler","inhiber","injecter","injure","innocent","inoculer","inonder","inscrire","insecte","insigne","insolite","inspirer","instinct","insulter","intact","intense","intime","intrigue","intuitif","inutile","invasion","inventer","inviter","invoquer","ironique","irradier","irre\u0301el","irriter","isoler","ivoire","ivresse","jaguar","jaillir","jambe","janvier","jardin","jauger","jaune","javelot","jetable","jeton","jeudi","jeunesse","joindre","joncher","jongler","joueur","jouissif","journal","jovial","joyau","joyeux","jubiler","jugement","junior","jupon","juriste","justice","juteux","juve\u0301nile","kayak","kimono","kiosque","label","labial","labourer","lace\u0301rer","lactose","lagune","laine","laisser","laitier","lambeau","lamelle","lampe","lanceur","langage","lanterne","lapin","largeur","larme","laurier","lavabo","lavoir","lecture","le\u0301gal","le\u0301ger","le\u0301gume","lessive","lettre","levier","lexique","le\u0301zard","liasse","libe\u0301rer","libre","licence","licorne","lie\u0300ge","lie\u0300vre","ligature","ligoter","ligue","limer","limite","limonade","limpide","line\u0301aire","lingot","lionceau","liquide","lisie\u0300re","lister","lithium","litige","littoral","livreur","logique","lointain","loisir","lombric","loterie","louer","lourd","loutre","louve","loyal","lubie","lucide","lucratif","lueur","lugubre","luisant","lumie\u0300re","lunaire","lundi","luron","lutter","luxueux","machine","magasin","magenta","magique","maigre","maillon","maintien","mairie","maison","majorer","malaxer","male\u0301fice","malheur","malice","mallette","mammouth","mandater","maniable","manquant","manteau","manuel","marathon","marbre","marchand","mardi","maritime","marqueur","marron","marteler","mascotte","massif","mate\u0301riel","matie\u0300re","matraque","maudire","maussade","mauve","maximal","me\u0301chant","me\u0301connu","me\u0301daille","me\u0301decin","me\u0301diter","me\u0301duse","meilleur","me\u0301lange","me\u0301lodie","membre","me\u0301moire","menacer","mener","menhir","mensonge","mentor","mercredi","me\u0301rite","merle","messager","mesure","me\u0301tal","me\u0301te\u0301ore","me\u0301thode","me\u0301tier","meuble","miauler","microbe","miette","mignon","migrer","milieu","million","mimique","mince","mine\u0301ral","minimal","minorer","minute","miracle","miroiter","missile","mixte","mobile","moderne","moelleux","mondial","moniteur","monnaie","monotone","monstre","montagne","monument","moqueur","morceau","morsure","mortier","moteur","motif","mouche","moufle","moulin","mousson","mouton","mouvant","multiple","munition","muraille","mure\u0300ne","murmure","muscle","muse\u0301um","musicien","mutation","muter","mutuel","myriade","myrtille","myste\u0300re","mythique","nageur","nappe","narquois","narrer","natation","nation","nature","naufrage","nautique","navire","ne\u0301buleux","nectar","ne\u0301faste","ne\u0301gation","ne\u0301gliger","ne\u0301gocier","neige","nerveux","nettoyer","neurone","neutron","neveu","niche","nickel","nitrate","niveau","noble","nocif","nocturne","noirceur","noisette","nomade","nombreux","nommer","normatif","notable","notifier","notoire","nourrir","nouveau","novateur","novembre","novice","nuage","nuancer","nuire","nuisible","nume\u0301ro","nuptial","nuque","nutritif","obe\u0301ir","objectif","obliger","obscur","observer","obstacle","obtenir","obturer","occasion","occuper","oce\u0301an","octobre","octroyer","octupler","oculaire","odeur","odorant","offenser","officier","offrir","ogive","oiseau","oisillon","olfactif","olivier","ombrage","omettre","onctueux","onduler","one\u0301reux","onirique","opale","opaque","ope\u0301rer","opinion","opportun","opprimer","opter","optique","orageux","orange","orbite","ordonner","oreille","organe","orgueil","orifice","ornement","orque","ortie","osciller","osmose","ossature","otarie","ouragan","ourson","outil","outrager","ouvrage","ovation","oxyde","oxyge\u0300ne","ozone","paisible","palace","palmare\u0300s","palourde","palper","panache","panda","pangolin","paniquer","panneau","panorama","pantalon","papaye","papier","papoter","papyrus","paradoxe","parcelle","paresse","parfumer","parler","parole","parrain","parsemer","partager","parure","parvenir","passion","paste\u0300que","paternel","patience","patron","pavillon","pavoiser","payer","paysage","peigne","peintre","pelage","pe\u0301lican","pelle","pelouse","peluche","pendule","pe\u0301ne\u0301trer","pe\u0301nible","pensif","pe\u0301nurie","pe\u0301pite","pe\u0301plum","perdrix","perforer","pe\u0301riode","permuter","perplexe","persil","perte","peser","pe\u0301tale","petit","pe\u0301trir","peuple","pharaon","phobie","phoque","photon","phrase","physique","piano","pictural","pie\u0300ce","pierre","pieuvre","pilote","pinceau","pipette","piquer","pirogue","piscine","piston","pivoter","pixel","pizza","placard","plafond","plaisir","planer","plaque","plastron","plateau","pleurer","plexus","pliage","plomb","plonger","pluie","plumage","pochette","poe\u0301sie","poe\u0300te","pointe","poirier","poisson","poivre","polaire","policier","pollen","polygone","pommade","pompier","ponctuel","ponde\u0301rer","poney","portique","position","posse\u0301der","posture","potager","poteau","potion","pouce","poulain","poumon","pourpre","poussin","pouvoir","prairie","pratique","pre\u0301cieux","pre\u0301dire","pre\u0301fixe","pre\u0301lude","pre\u0301nom","pre\u0301sence","pre\u0301texte","pre\u0301voir","primitif","prince","prison","priver","proble\u0300me","proce\u0301der","prodige","profond","progre\u0300s","proie","projeter","prologue","promener","propre","prospe\u0300re","prote\u0301ger","prouesse","proverbe","prudence","pruneau","psychose","public","puceron","puiser","pulpe","pulsar","punaise","punitif","pupitre","purifier","puzzle","pyramide","quasar","querelle","question","quie\u0301tude","quitter","quotient","racine","raconter","radieux","ragondin","raideur","raisin","ralentir","rallonge","ramasser","rapide","rasage","ratisser","ravager","ravin","rayonner","re\u0301actif","re\u0301agir","re\u0301aliser","re\u0301animer","recevoir","re\u0301citer","re\u0301clamer","re\u0301colter","recruter","reculer","recycler","re\u0301diger","redouter","refaire","re\u0301flexe","re\u0301former","refrain","refuge","re\u0301galien","re\u0301gion","re\u0301glage","re\u0301gulier","re\u0301ite\u0301rer","rejeter","rejouer","relatif","relever","relief","remarque","reme\u0300de","remise","remonter","remplir","remuer","renard","renfort","renifler","renoncer","rentrer","renvoi","replier","reporter","reprise","reptile","requin","re\u0301serve","re\u0301sineux","re\u0301soudre","respect","rester","re\u0301sultat","re\u0301tablir","retenir","re\u0301ticule","retomber","retracer","re\u0301union","re\u0301ussir","revanche","revivre","re\u0301volte","re\u0301vulsif","richesse","rideau","rieur","rigide","rigoler","rincer","riposter","risible","risque","rituel","rival","rivie\u0300re","rocheux","romance","rompre","ronce","rondin","roseau","rosier","rotatif","rotor","rotule","rouge","rouille","rouleau","routine","royaume","ruban","rubis","ruche","ruelle","rugueux","ruiner","ruisseau","ruser","rustique","rythme","sabler","saboter","sabre","sacoche","safari","sagesse","saisir","salade","salive","salon","saluer","samedi","sanction","sanglier","sarcasme","sardine","saturer","saugrenu","saumon","sauter","sauvage","savant","savonner","scalpel","scandale","sce\u0301le\u0301rat","sce\u0301nario","sceptre","sche\u0301ma","science","scinder","score","scrutin","sculpter","se\u0301ance","se\u0301cable","se\u0301cher","secouer","se\u0301cre\u0301ter","se\u0301datif","se\u0301duire","seigneur","se\u0301jour","se\u0301lectif","semaine","sembler","semence","se\u0301minal","se\u0301nateur","sensible","sentence","se\u0301parer","se\u0301quence","serein","sergent","se\u0301rieux","serrure","se\u0301rum","service","se\u0301same","se\u0301vir","sevrage","sextuple","side\u0301ral","sie\u0300cle","sie\u0301ger","siffler","sigle","signal","silence","silicium","simple","since\u0300re","sinistre","siphon","sirop","sismique","situer","skier","social","socle","sodium","soigneux","soldat","soleil","solitude","soluble","sombre","sommeil","somnoler","sonde","songeur","sonnette","sonore","sorcier","sortir","sosie","sottise","soucieux","soudure","souffle","soulever","soupape","source","soutirer","souvenir","spacieux","spatial","spe\u0301cial","sphe\u0300re","spiral","stable","station","sternum","stimulus","stipuler","strict","studieux","stupeur","styliste","sublime","substrat","subtil","subvenir","succe\u0300s","sucre","suffixe","sugge\u0301rer","suiveur","sulfate","superbe","supplier","surface","suricate","surmener","surprise","sursaut","survie","suspect","syllabe","symbole","syme\u0301trie","synapse","syntaxe","syste\u0300me","tabac","tablier","tactile","tailler","talent","talisman","talonner","tambour","tamiser","tangible","tapis","taquiner","tarder","tarif","tartine","tasse","tatami","tatouage","taupe","taureau","taxer","te\u0301moin","temporel","tenaille","tendre","teneur","tenir","tension","terminer","terne","terrible","te\u0301tine","texte","the\u0300me","the\u0301orie","the\u0301rapie","thorax","tibia","tie\u0300de","timide","tirelire","tiroir","tissu","titane","titre","tituber","toboggan","tole\u0301rant","tomate","tonique","tonneau","toponyme","torche","tordre","tornade","torpille","torrent","torse","tortue","totem","toucher","tournage","tousser","toxine","traction","trafic","tragique","trahir","train","trancher","travail","tre\u0300fle","tremper","tre\u0301sor","treuil","triage","tribunal","tricoter","trilogie","triomphe","tripler","triturer","trivial","trombone","tronc","tropical","troupeau","tuile","tulipe","tumulte","tunnel","turbine","tuteur","tutoyer","tuyau","tympan","typhon","typique","tyran","ubuesque","ultime","ultrason","unanime","unifier","union","unique","unitaire","univers","uranium","urbain","urticant","usage","usine","usuel","usure","utile","utopie","vacarme","vaccin","vagabond","vague","vaillant","vaincre","vaisseau","valable","valise","vallon","valve","vampire","vanille","vapeur","varier","vaseux","vassal","vaste","vecteur","vedette","ve\u0301ge\u0301tal","ve\u0301hicule","veinard","ve\u0301loce","vendredi","ve\u0301ne\u0301rer","venger","venimeux","ventouse","verdure","ve\u0301rin","vernir","verrou","verser","vertu","veston","ve\u0301te\u0301ran","ve\u0301tuste","vexant","vexer","viaduc","viande","victoire","vidange","vide\u0301o","vignette","vigueur","vilain","village","vinaigre","violon","vipe\u0300re","virement","virtuose","virus","visage","viseur","vision","visqueux","visuel","vital","vitesse","viticole","vitrine","vivace","vivipare","vocation","voguer","voile","voisin","voiture","volaille","volcan","voltiger","volume","vorace","vortex","voter","vouloir","voyage","voyelle","wagon","xe\u0301non","yacht","ze\u0300bre","ze\u0301nith","zeste","zoologie"];lM.exports=eie});var pM=k((N5e,dM)=>{"use strict";v();var tie=["abaco","abbaglio","abbinato","abete","abisso","abolire","abrasivo","abrogato","accadere","accenno","accusato","acetone","achille","acido","acqua","acre","acrilico","acrobata","acuto","adagio","addebito","addome","adeguato","aderire","adipe","adottare","adulare","affabile","affetto","affisso","affranto","aforisma","afoso","africano","agave","agente","agevole","aggancio","agire","agitare","agonismo","agricolo","agrumeto","aguzzo","alabarda","alato","albatro","alberato","albo","albume","alce","alcolico","alettone","alfa","algebra","aliante","alibi","alimento","allagato","allegro","allievo","allodola","allusivo","almeno","alogeno","alpaca","alpestre","altalena","alterno","alticcio","altrove","alunno","alveolo","alzare","amalgama","amanita","amarena","ambito","ambrato","ameba","america","ametista","amico","ammasso","ammenda","ammirare","ammonito","amore","ampio","ampliare","amuleto","anacardo","anagrafe","analista","anarchia","anatra","anca","ancella","ancora","andare","andrea","anello","angelo","angolare","angusto","anima","annegare","annidato","anno","annuncio","anonimo","anticipo","anzi","apatico","apertura","apode","apparire","appetito","appoggio","approdo","appunto","aprile","arabica","arachide","aragosta","araldica","arancio","aratura","arazzo","arbitro","archivio","ardito","arenile","argento","argine","arguto","aria","armonia","arnese","arredato","arringa","arrosto","arsenico","arso","artefice","arzillo","asciutto","ascolto","asepsi","asettico","asfalto","asino","asola","aspirato","aspro","assaggio","asse","assoluto","assurdo","asta","astenuto","astice","astratto","atavico","ateismo","atomico","atono","attesa","attivare","attorno","attrito","attuale","ausilio","austria","autista","autonomo","autunno","avanzato","avere","avvenire","avviso","avvolgere","azione","azoto","azzimo","azzurro","babele","baccano","bacino","baco","badessa","badilata","bagnato","baita","balcone","baldo","balena","ballata","balzano","bambino","bandire","baraonda","barbaro","barca","baritono","barlume","barocco","basilico","basso","batosta","battuto","baule","bava","bavosa","becco","beffa","belgio","belva","benda","benevole","benigno","benzina","bere","berlina","beta","bibita","bici","bidone","bifido","biga","bilancia","bimbo","binocolo","biologo","bipede","bipolare","birbante","birra","biscotto","bisesto","bisnonno","bisonte","bisturi","bizzarro","blando","blatta","bollito","bonifico","bordo","bosco","botanico","bottino","bozzolo","braccio","bradipo","brama","branca","bravura","bretella","brevetto","brezza","briglia","brillante","brindare","broccolo","brodo","bronzina","brullo","bruno","bubbone","buca","budino","buffone","buio","bulbo","buono","burlone","burrasca","bussola","busta","cadetto","caduco","calamaro","calcolo","calesse","calibro","calmo","caloria","cambusa","camerata","camicia","cammino","camola","campale","canapa","candela","cane","canino","canotto","cantina","capace","capello","capitolo","capogiro","cappero","capra","capsula","carapace","carcassa","cardo","carisma","carovana","carretto","cartolina","casaccio","cascata","caserma","caso","cassone","castello","casuale","catasta","catena","catrame","cauto","cavillo","cedibile","cedrata","cefalo","celebre","cellulare","cena","cenone","centesimo","ceramica","cercare","certo","cerume","cervello","cesoia","cespo","ceto","chela","chiaro","chicca","chiedere","chimera","china","chirurgo","chitarra","ciao","ciclismo","cifrare","cigno","cilindro","ciottolo","circa","cirrosi","citrico","cittadino","ciuffo","civetta","civile","classico","clinica","cloro","cocco","codardo","codice","coerente","cognome","collare","colmato","colore","colposo","coltivato","colza","coma","cometa","commando","comodo","computer","comune","conciso","condurre","conferma","congelare","coniuge","connesso","conoscere","consumo","continuo","convegno","coperto","copione","coppia","copricapo","corazza","cordata","coricato","cornice","corolla","corpo","corredo","corsia","cortese","cosmico","costante","cottura","covato","cratere","cravatta","creato","credere","cremoso","crescita","creta","criceto","crinale","crisi","critico","croce","cronaca","crostata","cruciale","crusca","cucire","cuculo","cugino","cullato","cupola","curatore","cursore","curvo","cuscino","custode","dado","daino","dalmata","damerino","daniela","dannoso","danzare","datato","davanti","davvero","debutto","decennio","deciso","declino","decollo","decreto","dedicato","definito","deforme","degno","delegare","delfino","delirio","delta","demenza","denotato","dentro","deposito","derapata","derivare","deroga","descritto","deserto","desiderio","desumere","detersivo","devoto","diametro","dicembre","diedro","difeso","diffuso","digerire","digitale","diluvio","dinamico","dinnanzi","dipinto","diploma","dipolo","diradare","dire","dirotto","dirupo","disagio","discreto","disfare","disgelo","disposto","distanza","disumano","dito","divano","divelto","dividere","divorato","doblone","docente","doganale","dogma","dolce","domato","domenica","dominare","dondolo","dono","dormire","dote","dottore","dovuto","dozzina","drago","druido","dubbio","dubitare","ducale","duna","duomo","duplice","duraturo","ebano","eccesso","ecco","eclissi","economia","edera","edicola","edile","editoria","educare","egemonia","egli","egoismo","egregio","elaborato","elargire","elegante","elencato","eletto","elevare","elfico","elica","elmo","elsa","eluso","emanato","emblema","emesso","emiro","emotivo","emozione","empirico","emulo","endemico","enduro","energia","enfasi","enoteca","entrare","enzima","epatite","epilogo","episodio","epocale","eppure","equatore","erario","erba","erboso","erede","eremita","erigere","ermetico","eroe","erosivo","errante","esagono","esame","esanime","esaudire","esca","esempio","esercito","esibito","esigente","esistere","esito","esofago","esortato","esoso","espanso","espresso","essenza","esso","esteso","estimare","estonia","estroso","esultare","etilico","etnico","etrusco","etto","euclideo","europa","evaso","evidenza","evitato","evoluto","evviva","fabbrica","faccenda","fachiro","falco","famiglia","fanale","fanfara","fango","fantasma","fare","farfalla","farinoso","farmaco","fascia","fastoso","fasullo","faticare","fato","favoloso","febbre","fecola","fede","fegato","felpa","feltro","femmina","fendere","fenomeno","fermento","ferro","fertile","fessura","festivo","fetta","feudo","fiaba","fiducia","fifa","figurato","filo","finanza","finestra","finire","fiore","fiscale","fisico","fiume","flacone","flamenco","flebo","flemma","florido","fluente","fluoro","fobico","focaccia","focoso","foderato","foglio","folata","folclore","folgore","fondente","fonetico","fonia","fontana","forbito","forchetta","foresta","formica","fornaio","foro","fortezza","forzare","fosfato","fosso","fracasso","frana","frassino","fratello","freccetta","frenata","fresco","frigo","frollino","fronde","frugale","frutta","fucilata","fucsia","fuggente","fulmine","fulvo","fumante","fumetto","fumoso","fune","funzione","fuoco","furbo","furgone","furore","fuso","futile","gabbiano","gaffe","galateo","gallina","galoppo","gambero","gamma","garanzia","garbo","garofano","garzone","gasdotto","gasolio","gastrico","gatto","gaudio","gazebo","gazzella","geco","gelatina","gelso","gemello","gemmato","gene","genitore","gennaio","genotipo","gergo","ghepardo","ghiaccio","ghisa","giallo","gilda","ginepro","giocare","gioiello","giorno","giove","girato","girone","gittata","giudizio","giurato","giusto","globulo","glutine","gnomo","gobba","golf","gomito","gommone","gonfio","gonna","governo","gracile","grado","grafico","grammo","grande","grattare","gravoso","grazia","greca","gregge","grifone","grigio","grinza","grotta","gruppo","guadagno","guaio","guanto","guardare","gufo","guidare","ibernato","icona","identico","idillio","idolo","idra","idrico","idrogeno","igiene","ignaro","ignorato","ilare","illeso","illogico","illudere","imballo","imbevuto","imbocco","imbuto","immane","immerso","immolato","impacco","impeto","impiego","importo","impronta","inalare","inarcare","inattivo","incanto","incendio","inchino","incisivo","incluso","incontro","incrocio","incubo","indagine","india","indole","inedito","infatti","infilare","inflitto","ingaggio","ingegno","inglese","ingordo","ingrosso","innesco","inodore","inoltrare","inondato","insano","insetto","insieme","insonnia","insulina","intasato","intero","intonaco","intuito","inumidire","invalido","invece","invito","iperbole","ipnotico","ipotesi","ippica","iride","irlanda","ironico","irrigato","irrorare","isolato","isotopo","isterico","istituto","istrice","italia","iterare","labbro","labirinto","lacca","lacerato","lacrima","lacuna","laddove","lago","lampo","lancetta","lanterna","lardoso","larga","laringe","lastra","latenza","latino","lattuga","lavagna","lavoro","legale","leggero","lembo","lentezza","lenza","leone","lepre","lesivo","lessato","lesto","letterale","leva","levigato","libero","lido","lievito","lilla","limatura","limitare","limpido","lineare","lingua","liquido","lira","lirica","lisca","lite","litigio","livrea","locanda","lode","logica","lombare","londra","longevo","loquace","lorenzo","loto","lotteria","luce","lucidato","lumaca","luminoso","lungo","lupo","luppolo","lusinga","lusso","lutto","macabro","macchina","macero","macinato","madama","magico","maglia","magnete","magro","maiolica","malafede","malgrado","malinteso","malsano","malto","malumore","mana","mancia","mandorla","mangiare","manifesto","mannaro","manovra","mansarda","mantide","manubrio","mappa","maratona","marcire","maretta","marmo","marsupio","maschera","massaia","mastino","materasso","matricola","mattone","maturo","mazurca","meandro","meccanico","mecenate","medesimo","meditare","mega","melassa","melis","melodia","meninge","meno","mensola","mercurio","merenda","merlo","meschino","mese","messere","mestolo","metallo","metodo","mettere","miagolare","mica","micelio","michele","microbo","midollo","miele","migliore","milano","milite","mimosa","minerale","mini","minore","mirino","mirtillo","miscela","missiva","misto","misurare","mitezza","mitigare","mitra","mittente","mnemonico","modello","modifica","modulo","mogano","mogio","mole","molosso","monastero","monco","mondina","monetario","monile","monotono","monsone","montato","monviso","mora","mordere","morsicato","mostro","motivato","motosega","motto","movenza","movimento","mozzo","mucca","mucosa","muffa","mughetto","mugnaio","mulatto","mulinello","multiplo","mummia","munto","muovere","murale","musa","muscolo","musica","mutevole","muto","nababbo","nafta","nanometro","narciso","narice","narrato","nascere","nastrare","naturale","nautica","naviglio","nebulosa","necrosi","negativo","negozio","nemmeno","neofita","neretto","nervo","nessuno","nettuno","neutrale","neve","nevrotico","nicchia","ninfa","nitido","nobile","nocivo","nodo","nome","nomina","nordico","normale","norvegese","nostrano","notare","notizia","notturno","novella","nucleo","nulla","numero","nuovo","nutrire","nuvola","nuziale","oasi","obbedire","obbligo","obelisco","oblio","obolo","obsoleto","occasione","occhio","occidente","occorrere","occultare","ocra","oculato","odierno","odorare","offerta","offrire","offuscato","oggetto","oggi","ognuno","olandese","olfatto","oliato","oliva","ologramma","oltre","omaggio","ombelico","ombra","omega","omissione","ondoso","onere","onice","onnivoro","onorevole","onta","operato","opinione","opposto","oracolo","orafo","ordine","orecchino","orefice","orfano","organico","origine","orizzonte","orma","ormeggio","ornativo","orologio","orrendo","orribile","ortensia","ortica","orzata","orzo","osare","oscurare","osmosi","ospedale","ospite","ossa","ossidare","ostacolo","oste","otite","otre","ottagono","ottimo","ottobre","ovale","ovest","ovino","oviparo","ovocito","ovunque","ovviare","ozio","pacchetto","pace","pacifico","padella","padrone","paese","paga","pagina","palazzina","palesare","pallido","palo","palude","pandoro","pannello","paolo","paonazzo","paprica","parabola","parcella","parere","pargolo","pari","parlato","parola","partire","parvenza","parziale","passivo","pasticca","patacca","patologia","pattume","pavone","peccato","pedalare","pedonale","peggio","peloso","penare","pendice","penisola","pennuto","penombra","pensare","pentola","pepe","pepita","perbene","percorso","perdonato","perforare","pergamena","periodo","permesso","perno","perplesso","persuaso","pertugio","pervaso","pesatore","pesista","peso","pestifero","petalo","pettine","petulante","pezzo","piacere","pianta","piattino","piccino","picozza","piega","pietra","piffero","pigiama","pigolio","pigro","pila","pilifero","pillola","pilota","pimpante","pineta","pinna","pinolo","pioggia","piombo","piramide","piretico","pirite","pirolisi","pitone","pizzico","placebo","planare","plasma","platano","plenario","pochezza","poderoso","podismo","poesia","poggiare","polenta","poligono","pollice","polmonite","polpetta","polso","poltrona","polvere","pomice","pomodoro","ponte","popoloso","porfido","poroso","porpora","porre","portata","posa","positivo","possesso","postulato","potassio","potere","pranzo","prassi","pratica","precluso","predica","prefisso","pregiato","prelievo","premere","prenotare","preparato","presenza","pretesto","prevalso","prima","principe","privato","problema","procura","produrre","profumo","progetto","prolunga","promessa","pronome","proposta","proroga","proteso","prova","prudente","prugna","prurito","psiche","pubblico","pudica","pugilato","pugno","pulce","pulito","pulsante","puntare","pupazzo","pupilla","puro","quadro","qualcosa","quasi","querela","quota","raccolto","raddoppio","radicale","radunato","raffica","ragazzo","ragione","ragno","ramarro","ramingo","ramo","randagio","rantolare","rapato","rapina","rappreso","rasatura","raschiato","rasente","rassegna","rastrello","rata","ravveduto","reale","recepire","recinto","recluta","recondito","recupero","reddito","redimere","regalato","registro","regola","regresso","relazione","remare","remoto","renna","replica","reprimere","reputare","resa","residente","responso","restauro","rete","retina","retorica","rettifica","revocato","riassunto","ribadire","ribelle","ribrezzo","ricarica","ricco","ricevere","riciclato","ricordo","ricreduto","ridicolo","ridurre","rifasare","riflesso","riforma","rifugio","rigare","rigettato","righello","rilassato","rilevato","rimanere","rimbalzo","rimedio","rimorchio","rinascita","rincaro","rinforzo","rinnovo","rinomato","rinsavito","rintocco","rinuncia","rinvenire","riparato","ripetuto","ripieno","riportare","ripresa","ripulire","risata","rischio","riserva","risibile","riso","rispetto","ristoro","risultato","risvolto","ritardo","ritegno","ritmico","ritrovo","riunione","riva","riverso","rivincita","rivolto","rizoma","roba","robotico","robusto","roccia","roco","rodaggio","rodere","roditore","rogito","rollio","romantico","rompere","ronzio","rosolare","rospo","rotante","rotondo","rotula","rovescio","rubizzo","rubrica","ruga","rullino","rumine","rumoroso","ruolo","rupe","russare","rustico","sabato","sabbiare","sabotato","sagoma","salasso","saldatura","salgemma","salivare","salmone","salone","saltare","saluto","salvo","sapere","sapido","saporito","saraceno","sarcasmo","sarto","sassoso","satellite","satira","satollo","saturno","savana","savio","saziato","sbadiglio","sbalzo","sbancato","sbarra","sbattere","sbavare","sbendare","sbirciare","sbloccato","sbocciato","sbrinare","sbruffone","sbuffare","scabroso","scadenza","scala","scambiare","scandalo","scapola","scarso","scatenare","scavato","scelto","scenico","scettro","scheda","schiena","sciarpa","scienza","scindere","scippo","sciroppo","scivolo","sclerare","scodella","scolpito","scomparto","sconforto","scoprire","scorta","scossone","scozzese","scriba","scrollare","scrutinio","scuderia","scultore","scuola","scuro","scusare","sdebitare","sdoganare","seccatura","secondo","sedano","seggiola","segnalato","segregato","seguito","selciato","selettivo","sella","selvaggio","semaforo","sembrare","seme","seminato","sempre","senso","sentire","sepolto","sequenza","serata","serbato","sereno","serio","serpente","serraglio","servire","sestina","setola","settimana","sfacelo","sfaldare","sfamato","sfarzoso","sfaticato","sfera","sfida","sfilato","sfinge","sfocato","sfoderare","sfogo","sfoltire","sforzato","sfratto","sfruttato","sfuggito","sfumare","sfuso","sgabello","sgarbato","sgonfiare","sgorbio","sgrassato","sguardo","sibilo","siccome","sierra","sigla","signore","silenzio","sillaba","simbolo","simpatico","simulato","sinfonia","singolo","sinistro","sino","sintesi","sinusoide","sipario","sisma","sistole","situato","slitta","slogatura","sloveno","smarrito","smemorato","smentito","smeraldo","smilzo","smontare","smottato","smussato","snellire","snervato","snodo","sobbalzo","sobrio","soccorso","sociale","sodale","soffitto","sogno","soldato","solenne","solido","sollazzo","solo","solubile","solvente","somatico","somma","sonda","sonetto","sonnifero","sopire","soppeso","sopra","sorgere","sorpasso","sorriso","sorso","sorteggio","sorvolato","sospiro","sosta","sottile","spada","spalla","spargere","spatola","spavento","spazzola","specie","spedire","spegnere","spelatura","speranza","spessore","spettrale","spezzato","spia","spigoloso","spillato","spinoso","spirale","splendido","sportivo","sposo","spranga","sprecare","spronato","spruzzo","spuntino","squillo","sradicare","srotolato","stabile","stacco","staffa","stagnare","stampato","stantio","starnuto","stasera","statuto","stelo","steppa","sterzo","stiletto","stima","stirpe","stivale","stizzoso","stonato","storico","strappo","stregato","stridulo","strozzare","strutto","stuccare","stufo","stupendo","subentro","succoso","sudore","suggerito","sugo","sultano","suonare","superbo","supporto","surgelato","surrogato","sussurro","sutura","svagare","svedese","sveglio","svelare","svenuto","svezia","sviluppo","svista","svizzera","svolta","svuotare","tabacco","tabulato","tacciare","taciturno","tale","talismano","tampone","tannino","tara","tardivo","targato","tariffa","tarpare","tartaruga","tasto","tattico","taverna","tavolata","tazza","teca","tecnico","telefono","temerario","tempo","temuto","tendone","tenero","tensione","tentacolo","teorema","terme","terrazzo","terzetto","tesi","tesserato","testato","tetro","tettoia","tifare","tigella","timbro","tinto","tipico","tipografo","tiraggio","tiro","titanio","titolo","titubante","tizio","tizzone","toccare","tollerare","tolto","tombola","tomo","tonfo","tonsilla","topazio","topologia","toppa","torba","tornare","torrone","tortora","toscano","tossire","tostatura","totano","trabocco","trachea","trafila","tragedia","tralcio","tramonto","transito","trapano","trarre","trasloco","trattato","trave","treccia","tremolio","trespolo","tributo","tricheco","trifoglio","trillo","trincea","trio","tristezza","triturato","trivella","tromba","trono","troppo","trottola","trovare","truccato","tubatura","tuffato","tulipano","tumulto","tunisia","turbare","turchino","tuta","tutela","ubicato","uccello","uccisore","udire","uditivo","uffa","ufficio","uguale","ulisse","ultimato","umano","umile","umorismo","uncinetto","ungere","ungherese","unicorno","unificato","unisono","unitario","unte","uovo","upupa","uragano","urgenza","urlo","usanza","usato","uscito","usignolo","usuraio","utensile","utilizzo","utopia","vacante","vaccinato","vagabondo","vagliato","valanga","valgo","valico","valletta","valoroso","valutare","valvola","vampata","vangare","vanitoso","vano","vantaggio","vanvera","vapore","varano","varcato","variante","vasca","vedetta","vedova","veduto","vegetale","veicolo","velcro","velina","velluto","veloce","venato","vendemmia","vento","verace","verbale","vergogna","verifica","vero","verruca","verticale","vescica","vessillo","vestale","veterano","vetrina","vetusto","viandante","vibrante","vicenda","vichingo","vicinanza","vidimare","vigilia","vigneto","vigore","vile","villano","vimini","vincitore","viola","vipera","virgola","virologo","virulento","viscoso","visione","vispo","vissuto","visura","vita","vitello","vittima","vivanda","vivido","viziare","voce","voga","volatile","volere","volpe","voragine","vulcano","zampogna","zanna","zappato","zattera","zavorra","zefiro","zelante","zelo","zenzero","zerbino","zibetto","zinco","zircone","zitto","zolla","zotico","zucchero","zufolo","zulu","zuppa"];dM.exports=tie});var vM=k((D5e,gM)=>{"use strict";v();var rie=["\u3042\u3044\u3053\u304F\u3057\u3093","\u3042\u3044\u3055\u3064","\u3042\u3044\u305F\u3099","\u3042\u304A\u305D\u3099\u3089","\u3042\u304B\u3061\u3083\u3093","\u3042\u304D\u308B","\u3042\u3051\u304B\u3099\u305F","\u3042\u3051\u308B","\u3042\u3053\u304B\u3099\u308C\u308B","\u3042\u3055\u3044","\u3042\u3055\u3072","\u3042\u3057\u3042\u3068","\u3042\u3057\u3099\u308F\u3046","\u3042\u3059\u3099\u304B\u308B","\u3042\u3059\u3099\u304D","\u3042\u305D\u3075\u3099","\u3042\u305F\u3048\u308B","\u3042\u305F\u305F\u3081\u308B","\u3042\u305F\u308A\u307E\u3048","\u3042\u305F\u308B","\u3042\u3064\u3044","\u3042\u3064\u304B\u3046","\u3042\u3063\u3057\u3085\u304F","\u3042\u3064\u307E\u308A","\u3042\u3064\u3081\u308B","\u3042\u3066\u306A","\u3042\u3066\u306F\u307E\u308B","\u3042\u3072\u308B","\u3042\u3075\u3099\u3089","\u3042\u3075\u3099\u308B","\u3042\u3075\u308C\u308B","\u3042\u307E\u3044","\u3042\u307E\u3068\u3099","\u3042\u307E\u3084\u304B\u3059","\u3042\u307E\u308A","\u3042\u307F\u3082\u306E","\u3042\u3081\u308A\u304B","\u3042\u3084\u307E\u308B","\u3042\u3086\u3080","\u3042\u3089\u3044\u304F\u3099\u307E","\u3042\u3089\u3057","\u3042\u3089\u3059\u3057\u3099","\u3042\u3089\u305F\u3081\u308B","\u3042\u3089\u3086\u308B","\u3042\u3089\u308F\u3059","\u3042\u308A\u304B\u3099\u3068\u3046","\u3042\u308F\u305B\u308B","\u3042\u308F\u3066\u308B","\u3042\u3093\u3044","\u3042\u3093\u304B\u3099\u3044","\u3042\u3093\u3053","\u3042\u3093\u305B\u3099\u3093","\u3042\u3093\u3066\u3044","\u3042\u3093\u306A\u3044","\u3042\u3093\u307E\u308A","\u3044\u3044\u305F\u3099\u3059","\u3044\u304A\u3093","\u3044\u304B\u3099\u3044","\u3044\u304B\u3099\u304F","\u3044\u304D\u304A\u3044","\u3044\u304D\u306A\u308A","\u3044\u304D\u3082\u306E","\u3044\u304D\u308B","\u3044\u304F\u3057\u3099","\u3044\u304F\u3075\u3099\u3093","\u3044\u3051\u306F\u3099\u306A","\u3044\u3051\u3093","\u3044\u3053\u3046","\u3044\u3053\u304F","\u3044\u3053\u3064","\u3044\u3055\u307E\u3057\u3044","\u3044\u3055\u3093","\u3044\u3057\u304D","\u3044\u3057\u3099\u3085\u3046","\u3044\u3057\u3099\u3087\u3046","\u3044\u3057\u3099\u308F\u308B","\u3044\u3059\u3099\u307F","\u3044\u3059\u3099\u308C","\u3044\u305B\u3044","\u3044\u305B\u3048\u3072\u3099","\u3044\u305B\u304B\u3044","\u3044\u305B\u304D","\u3044\u305B\u3099\u3093","\u3044\u305D\u3046\u308D\u3046","\u3044\u305D\u304B\u3099\u3057\u3044","\u3044\u305F\u3099\u3044","\u3044\u305F\u3099\u304F","\u3044\u305F\u3059\u3099\u3089","\u3044\u305F\u307F","\u3044\u305F\u308A\u3042","\u3044\u3061\u304A\u3046","\u3044\u3061\u3057\u3099","\u3044\u3061\u3068\u3099","\u3044\u3061\u306F\u3099","\u3044\u3061\u3075\u3099","\u3044\u3061\u308A\u3085\u3046","\u3044\u3064\u304B","\u3044\u3063\u3057\u3085\u3093","\u3044\u3063\u305B\u3044","\u3044\u3063\u305D\u3046","\u3044\u3063\u305F\u3093","\u3044\u3063\u3061","\u3044\u3063\u3066\u3044","\u3044\u3063\u307B\u309A\u3046","\u3044\u3066\u3055\u3099","\u3044\u3066\u3093","\u3044\u3068\u3099\u3046","\u3044\u3068\u3053","\u3044\u306A\u3044","\u3044\u306A\u304B","\u3044\u306D\u3080\u308A","\u3044\u306E\u3061","\u3044\u306E\u308B","\u3044\u306F\u3064","\u3044\u306F\u3099\u308B","\u3044\u306F\u3093","\u3044\u3072\u3099\u304D","\u3044\u3072\u3093","\u3044\u3075\u304F","\u3044\u3078\u3093","\u3044\u307B\u3046","\u3044\u307F\u3093","\u3044\u3082\u3046\u3068","\u3044\u3082\u305F\u308C","\u3044\u3082\u308A","\u3044\u3084\u304B\u3099\u308B","\u3044\u3084\u3059","\u3044\u3088\u304B\u3093","\u3044\u3088\u304F","\u3044\u3089\u3044","\u3044\u3089\u3059\u3068","\u3044\u308A\u304F\u3099\u3061","\u3044\u308A\u3087\u3046","\u3044\u308C\u3044","\u3044\u308C\u3082\u306E","\u3044\u308C\u308B","\u3044\u308D\u3048\u3093\u3072\u309A\u3064","\u3044\u308F\u3044","\u3044\u308F\u3046","\u3044\u308F\u304B\u3093","\u3044\u308F\u306F\u3099","\u3044\u308F\u3086\u308B","\u3044\u3093\u3051\u3099\u3093\u307E\u3081","\u3044\u3093\u3055\u3064","\u3044\u3093\u3057\u3087\u3046","\u3044\u3093\u3088\u3046","\u3046\u3048\u304D","\u3046\u3048\u308B","\u3046\u304A\u3055\u3099","\u3046\u304B\u3099\u3044","\u3046\u304B\u3075\u3099","\u3046\u304B\u3078\u3099\u308B","\u3046\u304D\u308F","\u3046\u304F\u3089\u3044\u306A","\u3046\u304F\u308C\u308C","\u3046\u3051\u305F\u307E\u308F\u308B","\u3046\u3051\u3064\u3051","\u3046\u3051\u3068\u308B","\u3046\u3051\u3082\u3064","\u3046\u3051\u308B","\u3046\u3053\u3099\u304B\u3059","\u3046\u3053\u3099\u304F","\u3046\u3053\u3093","\u3046\u3055\u304D\u3099","\u3046\u3057\u306A\u3046","\u3046\u3057\u308D\u304B\u3099\u307F","\u3046\u3059\u3044","\u3046\u3059\u304D\u3099","\u3046\u3059\u304F\u3099\u3089\u3044","\u3046\u3059\u3081\u308B","\u3046\u305B\u3064","\u3046\u3061\u3042\u308F\u305B","\u3046\u3061\u304B\u3099\u308F","\u3046\u3061\u304D","\u3046\u3061\u3085\u3046","\u3046\u3063\u304B\u308A","\u3046\u3064\u304F\u3057\u3044","\u3046\u3063\u305F\u3048\u308B","\u3046\u3064\u308B","\u3046\u3068\u3099\u3093","\u3046\u306A\u304D\u3099","\u3046\u306A\u3057\u3099","\u3046\u306A\u3059\u3099\u304F","\u3046\u306A\u308B","\u3046\u306D\u308B","\u3046\u306E\u3046","\u3046\u3075\u3099\u3051\u3099","\u3046\u3075\u3099\u3053\u3099\u3048","\u3046\u307E\u308C\u308B","\u3046\u3081\u308B","\u3046\u3082\u3046","\u3046\u3084\u307E\u3046","\u3046\u3088\u304F","\u3046\u3089\u304B\u3099\u3048\u3059","\u3046\u3089\u304F\u3099\u3061","\u3046\u3089\u306A\u3044","\u3046\u308A\u3042\u3051\u3099","\u3046\u308A\u304D\u308C","\u3046\u308B\u3055\u3044","\u3046\u308C\u3057\u3044","\u3046\u308C\u3086\u304D","\u3046\u308C\u308B","\u3046\u308D\u3053","\u3046\u308F\u304D","\u3046\u308F\u3055","\u3046\u3093\u3053\u3046","\u3046\u3093\u3061\u3093","\u3046\u3093\u3066\u3093","\u3046\u3093\u3068\u3099\u3046","\u3048\u3044\u3048\u3093","\u3048\u3044\u304B\u3099","\u3048\u3044\u304D\u3087\u3046","\u3048\u3044\u3053\u3099","\u3048\u3044\u305B\u3044","\u3048\u3044\u3075\u3099\u3093","\u3048\u3044\u3088\u3046","\u3048\u3044\u308F","\u3048\u304A\u308A","\u3048\u304B\u3099\u304A","\u3048\u304B\u3099\u304F","\u3048\u304D\u305F\u3044","\u3048\u304F\u305B\u308B","\u3048\u3057\u3083\u304F","\u3048\u3059\u3066","\u3048\u3064\u3089\u3093","\u3048\u306E\u304F\u3099","\u3048\u307B\u3046\u307E\u304D","\u3048\u307B\u3093","\u3048\u307E\u304D","\u3048\u3082\u3057\u3099","\u3048\u3082\u306E","\u3048\u3089\u3044","\u3048\u3089\u3075\u3099","\u3048\u308A\u3042","\u3048\u3093\u3048\u3093","\u3048\u3093\u304B\u3044","\u3048\u3093\u304D\u3099","\u3048\u3093\u3051\u3099\u304D","\u3048\u3093\u3057\u3085\u3046","\u3048\u3093\u305B\u3099\u3064","\u3048\u3093\u305D\u304F","\u3048\u3093\u3061\u3087\u3046","\u3048\u3093\u3068\u3064","\u304A\u3044\u304B\u3051\u308B","\u304A\u3044\u3053\u3059","\u304A\u3044\u3057\u3044","\u304A\u3044\u3064\u304F","\u304A\u3046\u3048\u3093","\u304A\u3046\u3055\u307E","\u304A\u3046\u3057\u3099","\u304A\u3046\u305B\u3064","\u304A\u3046\u305F\u3044","\u304A\u3046\u3075\u304F","\u304A\u3046\u3078\u3099\u3044","\u304A\u3046\u3088\u3046","\u304A\u3048\u308B","\u304A\u304A\u3044","\u304A\u304A\u3046","\u304A\u304A\u3068\u3099\u304A\u308A","\u304A\u304A\u3084","\u304A\u304A\u3088\u305D","\u304A\u304B\u3048\u308A","\u304A\u304B\u3059\u3099","\u304A\u304B\u3099\u3080","\u304A\u304B\u308F\u308A","\u304A\u304D\u3099\u306A\u3046","\u304A\u304D\u308B","\u304A\u304F\u3055\u307E","\u304A\u304F\u3057\u3099\u3087\u3046","\u304A\u304F\u308A\u304B\u3099\u306A","\u304A\u304F\u308B","\u304A\u304F\u308C\u308B","\u304A\u3053\u3059","\u304A\u3053\u306A\u3046","\u304A\u3053\u308B","\u304A\u3055\u3048\u308B","\u304A\u3055\u306A\u3044","\u304A\u3055\u3081\u308B","\u304A\u3057\u3044\u308C","\u304A\u3057\u3048\u308B","\u304A\u3057\u3099\u304D\u3099","\u304A\u3057\u3099\u3055\u3093","\u304A\u3057\u3083\u308C","\u304A\u305D\u3089\u304F","\u304A\u305D\u308F\u308B","\u304A\u305F\u304B\u3099\u3044","\u304A\u305F\u304F","\u304A\u305F\u3099\u3084\u304B","\u304A\u3061\u3064\u304F","\u304A\u3063\u3068","\u304A\u3064\u308A","\u304A\u3066\u3099\u304B\u3051","\u304A\u3068\u3057\u3082\u306E","\u304A\u3068\u306A\u3057\u3044","\u304A\u3068\u3099\u308A","\u304A\u3068\u3099\u308D\u304B\u3059","\u304A\u306F\u3099\u3055\u3093","\u304A\u307E\u3044\u308A","\u304A\u3081\u3066\u3099\u3068\u3046","\u304A\u3082\u3044\u3066\u3099","\u304A\u3082\u3046","\u304A\u3082\u305F\u3044","\u304A\u3082\u3061\u3083","\u304A\u3084\u3064","\u304A\u3084\u3086\u3072\u3099","\u304A\u3088\u307B\u3099\u3059","\u304A\u3089\u3093\u305F\u3099","\u304A\u308D\u3059","\u304A\u3093\u304B\u3099\u304F","\u304A\u3093\u3051\u3044","\u304A\u3093\u3057\u3083","\u304A\u3093\u305B\u3093","\u304A\u3093\u305F\u3099\u3093","\u304A\u3093\u3061\u3085\u3046","\u304A\u3093\u3068\u3099\u3051\u3044","\u304B\u3042\u3064","\u304B\u3044\u304B\u3099","\u304B\u3099\u3044\u304D","\u304B\u3099\u3044\u3051\u3093","\u304B\u3099\u3044\u3053\u3046","\u304B\u3044\u3055\u3064","\u304B\u3044\u3057\u3083","\u304B\u3044\u3059\u3044\u3088\u304F","\u304B\u3044\u305B\u3099\u3093","\u304B\u3044\u305D\u3099\u3046\u3068\u3099","\u304B\u3044\u3064\u3046","\u304B\u3044\u3066\u3093","\u304B\u3044\u3068\u3046","\u304B\u3044\u3075\u304F","\u304B\u3099\u3044\u3078\u304D","\u304B\u3044\u307B\u3046","\u304B\u3044\u3088\u3046","\u304B\u3099\u3044\u3089\u3044","\u304B\u3044\u308F","\u304B\u3048\u308B","\u304B\u304A\u308A","\u304B\u304B\u3048\u308B","\u304B\u304B\u3099\u304F","\u304B\u304B\u3099\u3057","\u304B\u304B\u3099\u307F","\u304B\u304F\u3053\u3099","\u304B\u304F\u3068\u304F","\u304B\u3055\u3099\u308B","\u304B\u3099\u305D\u3099\u3046","\u304B\u305F\u3044","\u304B\u305F\u3061","\u304B\u3099\u3061\u3087\u3046","\u304B\u3099\u3063\u304D\u3085\u3046","\u304B\u3099\u3063\u3053\u3046","\u304B\u3099\u3063\u3055\u3093","\u304B\u3099\u3063\u3057\u3087\u3046","\u304B\u306A\u3055\u3099\u308F\u3057","\u304B\u306E\u3046","\u304B\u3099\u306F\u304F","\u304B\u3075\u3099\u304B","\u304B\u307B\u3046","\u304B\u307B\u3053\u3099","\u304B\u307E\u3046","\u304B\u307E\u307B\u3099\u3053","\u304B\u3081\u308C\u304A\u3093","\u304B\u3086\u3044","\u304B\u3088\u3046\u3072\u3099","\u304B\u3089\u3044","\u304B\u308B\u3044","\u304B\u308D\u3046","\u304B\u308F\u304F","\u304B\u308F\u3089","\u304B\u3099\u3093\u304B","\u304B\u3093\u3051\u3044","\u304B\u3093\u3053\u3046","\u304B\u3093\u3057\u3083","\u304B\u3093\u305D\u3046","\u304B\u3093\u305F\u3093","\u304B\u3093\u3061","\u304B\u3099\u3093\u306F\u3099\u308B","\u304D\u3042\u3044","\u304D\u3042\u3064","\u304D\u3044\u308D","\u304D\u3099\u3044\u3093","\u304D\u3046\u3044","\u304D\u3046\u3093","\u304D\u3048\u308B","\u304D\u304A\u3046","\u304D\u304A\u304F","\u304D\u304A\u3061","\u304D\u304A\u3093","\u304D\u304B\u3044","\u304D\u304B\u304F","\u304D\u304B\u3093\u3057\u3083","\u304D\u304D\u3066","\u304D\u304F\u306F\u3099\u308A","\u304D\u304F\u3089\u3051\u3099","\u304D\u3051\u3093\u305B\u3044","\u304D\u3053\u3046","\u304D\u3053\u3048\u308B","\u304D\u3053\u304F","\u304D\u3055\u3044","\u304D\u3055\u304F","\u304D\u3055\u307E","\u304D\u3055\u3089\u304D\u3099","\u304D\u3099\u3057\u3099\u304B\u304B\u3099\u304F","\u304D\u3099\u3057\u304D","\u304D\u3099\u3057\u3099\u305F\u3044\u3051\u3093","\u304D\u3099\u3057\u3099\u306B\u3063\u3066\u3044","\u304D\u3099\u3057\u3099\u3085\u3064\u3057\u3083","\u304D\u3059\u3046","\u304D\u305B\u3044","\u304D\u305B\u304D","\u304D\u305B\u3064","\u304D\u305D\u3046","\u304D\u305D\u3099\u304F","\u304D\u305D\u3099\u3093","\u304D\u305F\u3048\u308B","\u304D\u3061\u3087\u3046","\u304D\u3064\u3048\u3093","\u304D\u3099\u3063\u3061\u308A","\u304D\u3064\u3064\u304D","\u304D\u3064\u306D","\u304D\u3066\u3044","\u304D\u3068\u3099\u3046","\u304D\u3068\u3099\u304F","\u304D\u306A\u3044","\u304D\u306A\u304B\u3099","\u304D\u306A\u3053","\u304D\u306C\u3053\u3099\u3057","\u304D\u306D\u3093","\u304D\u306E\u3046","\u304D\u306E\u3057\u305F","\u304D\u306F\u304F","\u304D\u3072\u3099\u3057\u3044","\u304D\u3072\u3093","\u304D\u3075\u304F","\u304D\u3075\u3099\u3093","\u304D\u307B\u3099\u3046","\u304D\u307B\u3093","\u304D\u307E\u308B","\u304D\u307F\u3064","\u304D\u3080\u3059\u3099\u304B\u3057\u3044","\u304D\u3081\u308B","\u304D\u3082\u305F\u3099\u3081\u3057","\u304D\u3082\u3061","\u304D\u3082\u306E","\u304D\u3083\u304F","\u304D\u3084\u304F","\u304D\u3099\u3085\u3046\u306B\u304F","\u304D\u3088\u3046","\u304D\u3087\u3046\u308A\u3085\u3046","\u304D\u3089\u3044","\u304D\u3089\u304F","\u304D\u308A\u3093","\u304D\u308C\u3044","\u304D\u308C\u3064","\u304D\u308D\u304F","\u304D\u3099\u308D\u3093","\u304D\u308F\u3081\u308B","\u304D\u3099\u3093\u3044\u308D","\u304D\u3093\u304B\u304F\u3057\u3099","\u304D\u3093\u3057\u3099\u3087","\u304D\u3093\u3088\u3046\u3072\u3099","\u304F\u3099\u3042\u3044","\u304F\u3044\u3059\u3099","\u304F\u3046\u304B\u3093","\u304F\u3046\u304D","\u304F\u3046\u304F\u3099\u3093","\u304F\u3046\u3053\u3046","\u304F\u3099\u3046\u305B\u3044","\u304F\u3046\u305D\u3046","\u304F\u3099\u3046\u305F\u3089","\u304F\u3046\u3075\u304F","\u304F\u3046\u307B\u3099","\u304F\u304B\u3093","\u304F\u304D\u3087\u3046","\u304F\u3051\u3099\u3093","\u304F\u3099\u3053\u3046","\u304F\u3055\u3044","\u304F\u3055\u304D","\u304F\u3055\u306F\u3099\u306A","\u304F\u3055\u308B","\u304F\u3057\u3083\u307F","\u304F\u3057\u3087\u3046","\u304F\u3059\u306E\u304D","\u304F\u3059\u308A\u3086\u3072\u3099","\u304F\u305B\u3051\u3099","\u304F\u305B\u3093","\u304F\u3099\u305F\u3044\u3066\u304D","\u304F\u305F\u3099\u3055\u308B","\u304F\u305F\u3072\u3099\u308C\u308B","\u304F\u3061\u3053\u307F","\u304F\u3061\u3055\u304D","\u304F\u3064\u3057\u305F","\u304F\u3099\u3063\u3059\u308A","\u304F\u3064\u308D\u304F\u3099","\u304F\u3068\u3046\u3066\u3093","\u304F\u3068\u3099\u304F","\u304F\u306A\u3093","\u304F\u306D\u304F\u306D","\u304F\u306E\u3046","\u304F\u3075\u3046","\u304F\u307F\u3042\u308F\u305B","\u304F\u307F\u305F\u3066\u308B","\u304F\u3081\u308B","\u304F\u3084\u304F\u3057\u3087","\u304F\u3089\u3059","\u304F\u3089\u3078\u3099\u308B","\u304F\u308B\u307E","\u304F\u308C\u308B","\u304F\u308D\u3046","\u304F\u308F\u3057\u3044","\u304F\u3099\u3093\u304B\u3093","\u304F\u3099\u3093\u3057\u3087\u304F","\u304F\u3099\u3093\u305F\u3044","\u304F\u3099\u3093\u3066","\u3051\u3042\u306A","\u3051\u3044\u304B\u304F","\u3051\u3044\u3051\u3093","\u3051\u3044\u3053","\u3051\u3044\u3055\u3064","\u3051\u3099\u3044\u3057\u3099\u3085\u3064","\u3051\u3044\u305F\u3044","\u3051\u3099\u3044\u306E\u3046\u3057\u3099\u3093","\u3051\u3044\u308C\u304D","\u3051\u3044\u308D","\u3051\u304A\u3068\u3059","\u3051\u304A\u308A\u3082\u306E","\u3051\u3099\u304D\u304B","\u3051\u3099\u304D\u3051\u3099\u3093","\u3051\u3099\u304D\u305F\u3099\u3093","\u3051\u3099\u304D\u3061\u3093","\u3051\u3099\u304D\u3068\u3064","\u3051\u3099\u304D\u306F","\u3051\u3099\u304D\u3084\u304F","\u3051\u3099\u3053\u3046","\u3051\u3099\u3053\u304F\u3057\u3099\u3087\u3046","\u3051\u3099\u3055\u3099\u3044","\u3051\u3055\u304D","\u3051\u3099\u3055\u3099\u3093","\u3051\u3057\u304D","\u3051\u3057\u3053\u3099\u3080","\u3051\u3057\u3087\u3046","\u3051\u3099\u3059\u3068","\u3051\u305F\u306F\u3099","\u3051\u3061\u3083\u3063\u3075\u309A","\u3051\u3061\u3089\u3059","\u3051\u3064\u3042\u3064","\u3051\u3064\u3044","\u3051\u3064\u3048\u304D","\u3051\u3063\u3053\u3093","\u3051\u3064\u3057\u3099\u3087","\u3051\u3063\u305B\u304D","\u3051\u3063\u3066\u3044","\u3051\u3064\u307E\u3064","\u3051\u3099\u3064\u3088\u3046\u3072\u3099","\u3051\u3099\u3064\u308C\u3044","\u3051\u3064\u308D\u3093","\u3051\u3099\u3068\u3099\u304F","\u3051\u3068\u306F\u3099\u3059","\u3051\u3068\u308B","\u3051\u306A\u3051\u3099","\u3051\u306A\u3059","\u3051\u306A\u307F","\u3051\u306C\u304D","\u3051\u3099\u306D\u3064","\u3051\u306D\u3093","\u3051\u306F\u3044","\u3051\u3099\u3072\u3093","\u3051\u3075\u3099\u304B\u3044","\u3051\u3099\u307B\u3099\u304F","\u3051\u307E\u308A","\u3051\u307F\u304B\u308B","\u3051\u3080\u3057","\u3051\u3080\u308A","\u3051\u3082\u306E","\u3051\u3089\u3044","\u3051\u308D\u3051\u308D","\u3051\u308F\u3057\u3044","\u3051\u3093\u3044","\u3051\u3093\u3048\u3064","\u3051\u3093\u304A","\u3051\u3093\u304B","\u3051\u3099\u3093\u304D","\u3051\u3093\u3051\u3099\u3093","\u3051\u3093\u3053\u3046","\u3051\u3093\u3055\u304F","\u3051\u3093\u3057\u3085\u3046","\u3051\u3093\u3059\u3046","\u3051\u3099\u3093\u305D\u3046","\u3051\u3093\u3061\u304F","\u3051\u3093\u3066\u3044","\u3051\u3093\u3068\u3046","\u3051\u3093\u306A\u3044","\u3051\u3093\u306B\u3093","\u3051\u3099\u3093\u3075\u3099\u3064","\u3051\u3093\u307E","\u3051\u3093\u307F\u3093","\u3051\u3093\u3081\u3044","\u3051\u3093\u3089\u3093","\u3051\u3093\u308A","\u3053\u3042\u304F\u307E","\u3053\u3044\u306C","\u3053\u3044\u3072\u3099\u3068","\u3053\u3099\u3046\u3044","\u3053\u3046\u3048\u3093","\u3053\u3046\u304A\u3093","\u3053\u3046\u304B\u3093","\u3053\u3099\u3046\u304D\u3085\u3046","\u3053\u3099\u3046\u3051\u3044","\u3053\u3046\u3053\u3046","\u3053\u3046\u3055\u3044","\u3053\u3046\u3057\u3099","\u3053\u3046\u3059\u3044","\u3053\u3099\u3046\u305B\u3044","\u3053\u3046\u305D\u304F","\u3053\u3046\u305F\u3044","\u3053\u3046\u3061\u3083","\u3053\u3046\u3064\u3046","\u3053\u3046\u3066\u3044","\u3053\u3046\u3068\u3099\u3046","\u3053\u3046\u306A\u3044","\u3053\u3046\u306F\u3044","\u3053\u3099\u3046\u307B\u3046","\u3053\u3099\u3046\u307E\u3093","\u3053\u3046\u3082\u304F","\u3053\u3046\u308A\u3064","\u3053\u3048\u308B","\u3053\u304A\u308A","\u3053\u3099\u304B\u3044","\u3053\u3099\u304B\u3099\u3064","\u3053\u3099\u304B\u3093","\u3053\u304F\u3053\u3099","\u3053\u304F\u3055\u3044","\u3053\u304F\u3068\u3046","\u3053\u304F\u306A\u3044","\u3053\u304F\u306F\u304F","\u3053\u304F\u3099\u307E","\u3053\u3051\u3044","\u3053\u3051\u308B","\u3053\u3053\u306E\u304B","\u3053\u3053\u308D","\u3053\u3055\u3081","\u3053\u3057\u3064","\u3053\u3059\u3046","\u3053\u305B\u3044","\u3053\u305B\u304D","\u3053\u305B\u3099\u3093","\u3053\u305D\u305F\u3099\u3066","\u3053\u305F\u3044","\u3053\u305F\u3048\u308B","\u3053\u305F\u3064","\u3053\u3061\u3087\u3046","\u3053\u3063\u304B","\u3053\u3064\u3053\u3064","\u3053\u3064\u306F\u3099\u3093","\u3053\u3064\u3075\u3099","\u3053\u3066\u3044","\u3053\u3066\u3093","\u3053\u3068\u304B\u3099\u3089","\u3053\u3068\u3057","\u3053\u3068\u306F\u3099","\u3053\u3068\u308A","\u3053\u306A\u3053\u3099\u306A","\u3053\u306D\u3053\u306D","\u3053\u306E\u307E\u307E","\u3053\u306E\u307F","\u3053\u306E\u3088","\u3053\u3099\u306F\u3093","\u3053\u3072\u3064\u3057\u3099","\u3053\u3075\u3046","\u3053\u3075\u3093","\u3053\u307B\u3099\u308C\u308B","\u3053\u3099\u307E\u3042\u3075\u3099\u3089","\u3053\u307E\u304B\u3044","\u3053\u3099\u307E\u3059\u308A","\u3053\u307E\u3064\u306A","\u3053\u307E\u308B","\u3053\u3080\u304D\u3099\u3053","\u3053\u3082\u3057\u3099","\u3053\u3082\u3061","\u3053\u3082\u306E","\u3053\u3082\u3093","\u3053\u3084\u304F","\u3053\u3084\u307E","\u3053\u3086\u3046","\u3053\u3086\u3072\u3099","\u3053\u3088\u3044","\u3053\u3088\u3046","\u3053\u308A\u308B","\u3053\u308C\u304F\u3057\u3087\u3093","\u3053\u308D\u3063\u3051","\u3053\u308F\u3082\u3066","\u3053\u308F\u308C\u308B","\u3053\u3093\u3044\u3093","\u3053\u3093\u304B\u3044","\u3053\u3093\u304D","\u3053\u3093\u3057\u3085\u3046","\u3053\u3093\u3059\u3044","\u3053\u3093\u305F\u3099\u3066","\u3053\u3093\u3068\u3093","\u3053\u3093\u306A\u3093","\u3053\u3093\u3072\u3099\u306B","\u3053\u3093\u307B\u309A\u3093","\u3053\u3093\u307E\u3051","\u3053\u3093\u3084","\u3053\u3093\u308C\u3044","\u3053\u3093\u308F\u304F","\u3055\u3099\u3044\u3048\u304D","\u3055\u3044\u304B\u3044","\u3055\u3044\u304D\u3093","\u3055\u3099\u3044\u3051\u3099\u3093","\u3055\u3099\u3044\u3053","\u3055\u3044\u3057\u3087","\u3055\u3044\u305B\u3044","\u3055\u3099\u3044\u305F\u304F","\u3055\u3099\u3044\u3061\u3085\u3046","\u3055\u3044\u3066\u304D","\u3055\u3099\u3044\u308A\u3087\u3046","\u3055\u3046\u306A","\u3055\u304B\u3044\u3057","\u3055\u304B\u3099\u3059","\u3055\u304B\u306A","\u3055\u304B\u307F\u3061","\u3055\u304B\u3099\u308B","\u3055\u304D\u3099\u3087\u3046","\u3055\u304F\u3057","\u3055\u304F\u3072\u3093","\u3055\u304F\u3089","\u3055\u3053\u304F","\u3055\u3053\u3064","\u3055\u3059\u3099\u304B\u308B","\u3055\u3099\u305B\u304D","\u3055\u305F\u3093","\u3055\u3064\u3048\u3044","\u3055\u3099\u3064\u304A\u3093","\u3055\u3099\u3063\u304B","\u3055\u3099\u3064\u304B\u3099\u304F","\u3055\u3063\u304D\u3087\u304F","\u3055\u3099\u3063\u3057","\u3055\u3064\u3057\u3099\u3093","\u3055\u3099\u3063\u305D\u3046","\u3055\u3064\u305F\u306F\u3099","\u3055\u3064\u307E\u3044\u3082","\u3055\u3066\u3044","\u3055\u3068\u3044\u3082","\u3055\u3068\u3046","\u3055\u3068\u304A\u3084","\u3055\u3068\u3057","\u3055\u3068\u308B","\u3055\u306E\u3046","\u3055\u306F\u3099\u304F","\u3055\u3072\u3099\u3057\u3044","\u3055\u3078\u3099\u3064","\u3055\u307B\u3046","\u3055\u307B\u3068\u3099","\u3055\u307E\u3059","\u3055\u307F\u3057\u3044","\u3055\u307F\u305F\u3099\u308C","\u3055\u3080\u3051","\u3055\u3081\u308B","\u3055\u3084\u3048\u3093\u3068\u3099\u3046","\u3055\u3086\u3046","\u3055\u3088\u3046","\u3055\u3088\u304F","\u3055\u3089\u305F\u3099","\u3055\u3099\u308B\u305D\u306F\u3099","\u3055\u308F\u3084\u304B","\u3055\u308F\u308B","\u3055\u3093\u3044\u3093","\u3055\u3093\u304B","\u3055\u3093\u304D\u3083\u304F","\u3055\u3093\u3053\u3046","\u3055\u3093\u3055\u3044","\u3055\u3099\u3093\u3057\u3087","\u3055\u3093\u3059\u3046","\u3055\u3093\u305B\u3044","\u3055\u3093\u305D","\u3055\u3093\u3061","\u3055\u3093\u307E","\u3055\u3093\u307F","\u3055\u3093\u3089\u3093","\u3057\u3042\u3044","\u3057\u3042\u3051\u3099","\u3057\u3042\u3055\u3063\u3066","\u3057\u3042\u308F\u305B","\u3057\u3044\u304F","\u3057\u3044\u3093","\u3057\u3046\u3061","\u3057\u3048\u3044","\u3057\u304A\u3051","\u3057\u304B\u3044","\u3057\u304B\u304F","\u3057\u3099\u304B\u3093","\u3057\u3053\u3099\u3068","\u3057\u3059\u3046","\u3057\u3099\u305F\u3099\u3044","\u3057\u305F\u3046\u3051","\u3057\u305F\u304D\u3099","\u3057\u305F\u3066","\u3057\u305F\u307F","\u3057\u3061\u3087\u3046","\u3057\u3061\u308A\u3093","\u3057\u3063\u304B\u308A","\u3057\u3064\u3057\u3099","\u3057\u3064\u3082\u3093","\u3057\u3066\u3044","\u3057\u3066\u304D","\u3057\u3066\u3064","\u3057\u3099\u3066\u3093","\u3057\u3099\u3068\u3099\u3046","\u3057\u306A\u304D\u3099\u308C","\u3057\u306A\u3082\u306E","\u3057\u306A\u3093","\u3057\u306D\u307E","\u3057\u306D\u3093","\u3057\u306E\u304F\u3099","\u3057\u306E\u3075\u3099","\u3057\u306F\u3044","\u3057\u306F\u3099\u304B\u308A","\u3057\u306F\u3064","\u3057\u306F\u3089\u3044","\u3057\u306F\u3093","\u3057\u3072\u3087\u3046","\u3057\u3075\u304F","\u3057\u3099\u3075\u3099\u3093","\u3057\u3078\u3044","\u3057\u307B\u3046","\u3057\u307B\u3093","\u3057\u307E\u3046","\u3057\u307E\u308B","\u3057\u307F\u3093","\u3057\u3080\u3051\u308B","\u3057\u3099\u3080\u3057\u3087","\u3057\u3081\u3044","\u3057\u3081\u308B","\u3057\u3082\u3093","\u3057\u3083\u3044\u3093","\u3057\u3083\u3046\u3093","\u3057\u3083\u304A\u3093","\u3057\u3099\u3083\u304B\u3099\u3044\u3082","\u3057\u3084\u304F\u3057\u3087","\u3057\u3083\u304F\u307B\u3046","\u3057\u3083\u3051\u3093","\u3057\u3083\u3053","\u3057\u3083\u3055\u3099\u3044","\u3057\u3083\u3057\u3093","\u3057\u3083\u305B\u3093","\u3057\u3083\u305D\u3046","\u3057\u3083\u305F\u3044","\u3057\u3083\u3061\u3087\u3046","\u3057\u3083\u3063\u304D\u3093","\u3057\u3099\u3083\u307E","\u3057\u3083\u308A\u3093","\u3057\u3083\u308C\u3044","\u3057\u3099\u3086\u3046","\u3057\u3099\u3085\u3046\u3057\u3087","\u3057\u3085\u304F\u306F\u304F","\u3057\u3099\u3085\u3057\u3093","\u3057\u3085\u3063\u305B\u304D","\u3057\u3085\u307F","\u3057\u3085\u3089\u306F\u3099","\u3057\u3099\u3085\u3093\u306F\u3099\u3093","\u3057\u3087\u3046\u304B\u3044","\u3057\u3087\u304F\u305F\u304F","\u3057\u3087\u3063\u3051\u3093","\u3057\u3087\u3068\u3099\u3046","\u3057\u3087\u3082\u3064","\u3057\u3089\u305B\u308B","\u3057\u3089\u3078\u3099\u308B","\u3057\u3093\u304B","\u3057\u3093\u3053\u3046","\u3057\u3099\u3093\u3057\u3099\u3083","\u3057\u3093\u305B\u3044\u3057\u3099","\u3057\u3093\u3061\u304F","\u3057\u3093\u308A\u3093","\u3059\u3042\u3051\u3099","\u3059\u3042\u3057","\u3059\u3042\u306A","\u3059\u3099\u3042\u3093","\u3059\u3044\u3048\u3044","\u3059\u3044\u304B","\u3059\u3044\u3068\u3046","\u3059\u3099\u3044\u3075\u3099\u3093","\u3059\u3044\u3088\u3046\u3072\u3099","\u3059\u3046\u304B\u3099\u304F","\u3059\u3046\u3057\u3099\u3064","\u3059\u3046\u305B\u3093","\u3059\u304A\u3068\u3099\u308A","\u3059\u304D\u307E","\u3059\u304F\u3046","\u3059\u304F\u306A\u3044","\u3059\u3051\u308B","\u3059\u3053\u3099\u3044","\u3059\u3053\u3057","\u3059\u3099\u3055\u3093","\u3059\u3059\u3099\u3057\u3044","\u3059\u3059\u3080","\u3059\u3059\u3081\u308B","\u3059\u3063\u304B\u308A","\u3059\u3099\u3063\u3057\u308A","\u3059\u3099\u3063\u3068","\u3059\u3066\u304D","\u3059\u3066\u308B","\u3059\u306D\u308B","\u3059\u306E\u3053","\u3059\u306F\u305F\u3099","\u3059\u306F\u3099\u3089\u3057\u3044","\u3059\u3099\u3072\u3087\u3046","\u3059\u3099\u3075\u3099\u306C\u308C","\u3059\u3075\u3099\u308A","\u3059\u3075\u308C","\u3059\u3078\u3099\u3066","\u3059\u3078\u3099\u308B","\u3059\u3099\u307B\u3046","\u3059\u307B\u3099\u3093","\u3059\u307E\u3044","\u3059\u3081\u3057","\u3059\u3082\u3046","\u3059\u3084\u304D","\u3059\u3089\u3059\u3089","\u3059\u308B\u3081","\u3059\u308C\u3061\u304B\u3099\u3046","\u3059\u308D\u3063\u3068","\u3059\u308F\u308B","\u3059\u3093\u305B\u3099\u3093","\u3059\u3093\u307B\u309A\u3046","\u305B\u3042\u3075\u3099\u3089","\u305B\u3044\u304B\u3064","\u305B\u3044\u3051\u3099\u3093","\u305B\u3044\u3057\u3099","\u305B\u3044\u3088\u3046","\u305B\u304A\u3046","\u305B\u304B\u3044\u304B\u3093","\u305B\u304D\u306B\u3093","\u305B\u304D\u3080","\u305B\u304D\u3086","\u305B\u304D\u3089\u3093\u3046\u3093","\u305B\u3051\u3093","\u305B\u3053\u3046","\u305B\u3059\u3057\u3099","\u305B\u305F\u3044","\u305B\u305F\u3051","\u305B\u3063\u304B\u304F","\u305B\u3063\u304D\u3083\u304F","\u305B\u3099\u3063\u304F","\u305B\u3063\u3051\u3093","\u305B\u3063\u3053\u3064","\u305B\u3063\u3055\u305F\u304F\u307E","\u305B\u3064\u305D\u3099\u304F","\u305B\u3064\u305F\u3099\u3093","\u305B\u3064\u3066\u3099\u3093","\u305B\u3063\u306F\u309A\u3093","\u305B\u3064\u3072\u3099","\u305B\u3064\u3075\u3099\u3093","\u305B\u3064\u3081\u3044","\u305B\u3064\u308A\u3064","\u305B\u306A\u304B","\u305B\u306E\u3072\u3099","\u305B\u306F\u306F\u3099","\u305B\u3072\u3099\u308D","\u305B\u307B\u3099\u306D","\u305B\u307E\u3044","\u305B\u307E\u308B","\u305B\u3081\u308B","\u305B\u3082\u305F\u308C","\u305B\u308A\u3075","\u305B\u3099\u3093\u3042\u304F","\u305B\u3093\u3044","\u305B\u3093\u3048\u3044","\u305B\u3093\u304B","\u305B\u3093\u304D\u3087","\u305B\u3093\u304F","\u305B\u3093\u3051\u3099\u3093","\u305B\u3099\u3093\u3053\u3099","\u305B\u3093\u3055\u3044","\u305B\u3093\u3057\u3085","\u305B\u3093\u3059\u3044","\u305B\u3093\u305B\u3044","\u305B\u3093\u305D\u3099","\u305B\u3093\u305F\u304F","\u305B\u3093\u3061\u3087\u3046","\u305B\u3093\u3066\u3044","\u305B\u3093\u3068\u3046","\u305B\u3093\u306C\u304D","\u305B\u3093\u306D\u3093","\u305B\u3093\u306F\u309A\u3044","\u305B\u3099\u3093\u3075\u3099","\u305B\u3099\u3093\u307B\u309A\u3046","\u305B\u3093\u3080","\u305B\u3093\u3081\u3093\u3057\u3099\u3087","\u305B\u3093\u3082\u3093","\u305B\u3093\u3084\u304F","\u305B\u3093\u3086\u3046","\u305B\u3093\u3088\u3046","\u305B\u3099\u3093\u3089","\u305B\u3099\u3093\u308A\u3083\u304F","\u305B\u3093\u308C\u3044","\u305B\u3093\u308D","\u305D\u3042\u304F","\u305D\u3044\u3068\u3051\u3099\u308B","\u305D\u3044\u306D","\u305D\u3046\u304B\u3099\u3093\u304D\u3087\u3046","\u305D\u3046\u304D","\u305D\u3046\u3053\u3099","\u305D\u3046\u3057\u3093","\u305D\u3046\u305F\u3099\u3093","\u305D\u3046\u306A\u3093","\u305D\u3046\u3072\u3099","\u305D\u3046\u3081\u3093","\u305D\u3046\u308A","\u305D\u3048\u3082\u306E","\u305D\u3048\u3093","\u305D\u304B\u3099\u3044","\u305D\u3051\u3099\u304D","\u305D\u3053\u3046","\u305D\u3053\u305D\u3053","\u305D\u3055\u3099\u3044","\u305D\u3057\u306A","\u305D\u305B\u3044","\u305D\u305B\u3093","\u305D\u305D\u304F\u3099","\u305D\u305F\u3099\u3066\u308B","\u305D\u3064\u3046","\u305D\u3064\u3048\u3093","\u305D\u3063\u304B\u3093","\u305D\u3064\u304D\u3099\u3087\u3046","\u305D\u3063\u3051\u3064","\u305D\u3063\u3053\u3046","\u305D\u3063\u305B\u3093","\u305D\u3063\u3068","\u305D\u3068\u304B\u3099\u308F","\u305D\u3068\u3064\u3099\u3089","\u305D\u306A\u3048\u308B","\u305D\u306A\u305F","\u305D\u3075\u307B\u3099","\u305D\u307B\u3099\u304F","\u305D\u307B\u3099\u308D","\u305D\u307E\u3064","\u305D\u307E\u308B","\u305D\u3080\u304F","\u305D\u3080\u308A\u3048","\u305D\u3081\u308B","\u305D\u3082\u305D\u3082","\u305D\u3088\u304B\u305B\u3099","\u305D\u3089\u307E\u3081","\u305D\u308D\u3046","\u305D\u3093\u304B\u3044","\u305D\u3093\u3051\u3044","\u305D\u3093\u3055\u3099\u3044","\u305D\u3093\u3057\u3064","\u305D\u3093\u305D\u3099\u304F","\u305D\u3093\u3061\u3087\u3046","\u305D\u3099\u3093\u3072\u3099","\u305D\u3099\u3093\u3075\u3099\u3093","\u305D\u3093\u307F\u3093","\u305F\u3042\u3044","\u305F\u3044\u3044\u3093","\u305F\u3044\u3046\u3093","\u305F\u3044\u3048\u304D","\u305F\u3044\u304A\u3046","\u305F\u3099\u3044\u304B\u3099\u304F","\u305F\u3044\u304D","\u305F\u3044\u304F\u3099\u3046","\u305F\u3044\u3051\u3093","\u305F\u3044\u3053","\u305F\u3044\u3055\u3099\u3044","\u305F\u3099\u3044\u3057\u3099\u3087\u3046\u3075\u3099","\u305F\u3099\u3044\u3059\u304D","\u305F\u3044\u305B\u3064","\u305F\u3044\u305D\u3046","\u305F\u3099\u3044\u305F\u3044","\u305F\u3044\u3061\u3087\u3046","\u305F\u3044\u3066\u3044","\u305F\u3099\u3044\u3068\u3099\u3053\u308D","\u305F\u3044\u306A\u3044","\u305F\u3044\u306D\u3064","\u305F\u3044\u306E\u3046","\u305F\u3044\u306F\u3093","\u305F\u3099\u3044\u3072\u3087\u3046","\u305F\u3044\u3075\u3046","\u305F\u3044\u3078\u3093","\u305F\u3044\u307B","\u305F\u3044\u307E\u3064\u306F\u3099\u306A","\u305F\u3044\u307F\u3093\u304F\u3099","\u305F\u3044\u3080","\u305F\u3044\u3081\u3093","\u305F\u3044\u3084\u304D","\u305F\u3044\u3088\u3046","\u305F\u3044\u3089","\u305F\u3044\u308A\u3087\u304F","\u305F\u3044\u308B","\u305F\u3044\u308F\u3093","\u305F\u3046\u3048","\u305F\u3048\u308B","\u305F\u304A\u3059","\u305F\u304A\u308B","\u305F\u304A\u308C\u308B","\u305F\u304B\u3044","\u305F\u304B\u306D","\u305F\u304D\u3072\u3099","\u305F\u304F\u3055\u3093","\u305F\u3053\u304F","\u305F\u3053\u3084\u304D","\u305F\u3055\u3044","\u305F\u3057\u3055\u3099\u3093","\u305F\u3099\u3057\u3099\u3083\u308C","\u305F\u3059\u3051\u308B","\u305F\u3059\u3099\u3055\u308F\u308B","\u305F\u305D\u304B\u3099\u308C","\u305F\u305F\u304B\u3046","\u305F\u305F\u304F","\u305F\u305F\u3099\u3057\u3044","\u305F\u305F\u307F","\u305F\u3061\u306F\u3099\u306A","\u305F\u3099\u3063\u304B\u3044","\u305F\u3099\u3063\u304D\u3083\u304F","\u305F\u3099\u3063\u3053","\u305F\u3099\u3063\u3057\u3085\u3064","\u305F\u3099\u3063\u305F\u3044","\u305F\u3066\u308B","\u305F\u3068\u3048\u308B","\u305F\u306A\u306F\u3099\u305F","\u305F\u306B\u3093","\u305F\u306C\u304D","\u305F\u306E\u3057\u307F","\u305F\u306F\u3064","\u305F\u3075\u3099\u3093","\u305F\u3078\u3099\u308B","\u305F\u307B\u3099\u3046","\u305F\u307E\u3053\u3099","\u305F\u307E\u308B","\u305F\u3099\u3080\u308B","\u305F\u3081\u3044\u304D","\u305F\u3081\u3059","\u305F\u3081\u308B","\u305F\u3082\u3064","\u305F\u3084\u3059\u3044","\u305F\u3088\u308B","\u305F\u3089\u3059","\u305F\u308A\u304D\u307B\u3093\u304B\u3099\u3093","\u305F\u308A\u3087\u3046","\u305F\u308A\u308B","\u305F\u308B\u3068","\u305F\u308C\u308B","\u305F\u308C\u3093\u3068","\u305F\u308D\u3063\u3068","\u305F\u308F\u3080\u308C\u308B","\u305F\u3099\u3093\u3042\u3064","\u305F\u3093\u3044","\u305F\u3093\u304A\u3093","\u305F\u3093\u304B","\u305F\u3093\u304D","\u305F\u3093\u3051\u3093","\u305F\u3093\u3053\u3099","\u305F\u3093\u3055\u3093","\u305F\u3093\u3057\u3099\u3087\u3046\u3072\u3099","\u305F\u3099\u3093\u305B\u3044","\u305F\u3093\u305D\u304F","\u305F\u3093\u305F\u3044","\u305F\u3099\u3093\u3061","\u305F\u3093\u3066\u3044","\u305F\u3093\u3068\u3046","\u305F\u3099\u3093\u306A","\u305F\u3093\u306B\u3093","\u305F\u3099\u3093\u306D\u3064","\u305F\u3093\u306E\u3046","\u305F\u3093\u3072\u309A\u3093","\u305F\u3099\u3093\u307B\u3099\u3046","\u305F\u3093\u307E\u3064","\u305F\u3093\u3081\u3044","\u305F\u3099\u3093\u308C\u3064","\u305F\u3099\u3093\u308D","\u305F\u3099\u3093\u308F","\u3061\u3042\u3044","\u3061\u3042\u3093","\u3061\u3044\u304D","\u3061\u3044\u3055\u3044","\u3061\u3048\u3093","\u3061\u304B\u3044","\u3061\u304B\u3089","\u3061\u304D\u3085\u3046","\u3061\u304D\u3093","\u3061\u3051\u3044\u3059\u3099","\u3061\u3051\u3093","\u3061\u3053\u304F","\u3061\u3055\u3044","\u3061\u3057\u304D","\u3061\u3057\u308A\u3087\u3046","\u3061\u305B\u3044","\u3061\u305D\u3046","\u3061\u305F\u3044","\u3061\u305F\u3093","\u3061\u3061\u304A\u3084","\u3061\u3064\u3057\u3099\u3087","\u3061\u3066\u304D","\u3061\u3066\u3093","\u3061\u306C\u304D","\u3061\u306C\u308A","\u3061\u306E\u3046","\u3061\u3072\u3087\u3046","\u3061\u3078\u3044\u305B\u3093","\u3061\u307B\u3046","\u3061\u307E\u305F","\u3061\u307F\u3064","\u3061\u307F\u3068\u3099\u308D","\u3061\u3081\u3044\u3068\u3099","\u3061\u3083\u3093\u3053\u306A\u3078\u3099","\u3061\u3085\u3046\u3044","\u3061\u3086\u308A\u3087\u304F","\u3061\u3087\u3046\u3057","\u3061\u3087\u3055\u304F\u3051\u3093","\u3061\u3089\u3057","\u3061\u3089\u307F","\u3061\u308A\u304B\u3099\u307F","\u3061\u308A\u3087\u3046","\u3061\u308B\u3068\u3099","\u3061\u308F\u308F","\u3061\u3093\u305F\u3044","\u3061\u3093\u3082\u304F","\u3064\u3044\u304B","\u3064\u3044\u305F\u3061","\u3064\u3046\u304B","\u3064\u3046\u3057\u3099\u3087\u3046","\u3064\u3046\u306F\u3093","\u3064\u3046\u308F","\u3064\u304B\u3046","\u3064\u304B\u308C\u308B","\u3064\u304F\u306D","\u3064\u304F\u308B","\u3064\u3051\u306D","\u3064\u3051\u308B","\u3064\u3053\u3099\u3046","\u3064\u305F\u3048\u308B","\u3064\u3064\u3099\u304F","\u3064\u3064\u3057\u3099","\u3064\u3064\u3080","\u3064\u3068\u3081\u308B","\u3064\u306A\u304B\u3099\u308B","\u3064\u306A\u307F","\u3064\u306D\u3064\u3099\u306D","\u3064\u306E\u308B","\u3064\u3075\u3099\u3059","\u3064\u307E\u3089\u306A\u3044","\u3064\u307E\u308B","\u3064\u307F\u304D","\u3064\u3081\u305F\u3044","\u3064\u3082\u308A","\u3064\u3082\u308B","\u3064\u3088\u3044","\u3064\u308B\u307B\u3099","\u3064\u308B\u307F\u304F","\u3064\u308F\u3082\u306E","\u3064\u308F\u308A","\u3066\u3042\u3057","\u3066\u3042\u3066","\u3066\u3042\u307F","\u3066\u3044\u304A\u3093","\u3066\u3044\u304B","\u3066\u3044\u304D","\u3066\u3044\u3051\u3044","\u3066\u3044\u3053\u304F","\u3066\u3044\u3055\u3064","\u3066\u3044\u3057","\u3066\u3044\u305B\u3044","\u3066\u3044\u305F\u3044","\u3066\u3044\u3068\u3099","\u3066\u3044\u306D\u3044","\u3066\u3044\u3072\u3087\u3046","\u3066\u3044\u3078\u3093","\u3066\u3044\u307B\u3099\u3046","\u3066\u3046\u3061","\u3066\u304A\u304F\u308C","\u3066\u304D\u3068\u3046","\u3066\u304F\u3072\u3099","\u3066\u3099\u3053\u307B\u3099\u3053","\u3066\u3055\u304D\u3099\u3087\u3046","\u3066\u3055\u3051\u3099","\u3066\u3059\u308A","\u3066\u305D\u3046","\u3066\u3061\u304B\u3099\u3044","\u3066\u3061\u3087\u3046","\u3066\u3064\u304B\u3099\u304F","\u3066\u3064\u3064\u3099\u304D","\u3066\u3099\u3063\u306F\u309A","\u3066\u3064\u307B\u3099\u3046","\u3066\u3064\u3084","\u3066\u3099\u306C\u304B\u3048","\u3066\u306C\u304D","\u3066\u306C\u304F\u3099\u3044","\u3066\u306E\u3072\u3089","\u3066\u306F\u3044","\u3066\u3075\u3099\u304F\u308D","\u3066\u3075\u305F\u3099","\u3066\u307B\u3068\u3099\u304D","\u3066\u307B\u3093","\u3066\u307E\u3048","\u3066\u307E\u304D\u3059\u3099\u3057","\u3066\u307F\u3057\u3099\u304B","\u3066\u307F\u3084\u3051\u3099","\u3066\u3089\u3059","\u3066\u308C\u3072\u3099","\u3066\u308F\u3051","\u3066\u308F\u305F\u3057","\u3066\u3099\u3093\u3042\u3064","\u3066\u3093\u3044\u3093","\u3066\u3093\u304B\u3044","\u3066\u3093\u304D","\u3066\u3093\u304F\u3099","\u3066\u3093\u3051\u3093","\u3066\u3093\u3053\u3099\u304F","\u3066\u3093\u3055\u3044","\u3066\u3093\u3057","\u3066\u3093\u3059\u3046","\u3066\u3099\u3093\u3061","\u3066\u3093\u3066\u304D","\u3066\u3093\u3068\u3046","\u3066\u3093\u306A\u3044","\u3066\u3093\u3075\u309A\u3089","\u3066\u3093\u307B\u3099\u3046\u305F\u3099\u3044","\u3066\u3093\u3081\u3064","\u3066\u3093\u3089\u3093\u304B\u3044","\u3066\u3099\u3093\u308A\u3087\u304F","\u3066\u3099\u3093\u308F","\u3068\u3099\u3042\u3044","\u3068\u3044\u308C","\u3068\u3099\u3046\u304B\u3093","\u3068\u3046\u304D\u3085\u3046","\u3068\u3099\u3046\u304F\u3099","\u3068\u3046\u3057","\u3068\u3046\u3080\u304D\u3099","\u3068\u304A\u3044","\u3068\u304A\u304B","\u3068\u304A\u304F","\u3068\u304A\u3059","\u3068\u304A\u308B","\u3068\u304B\u3044","\u3068\u304B\u3059","\u3068\u304D\u304A\u308A","\u3068\u304D\u3068\u3099\u304D","\u3068\u304F\u3044","\u3068\u304F\u3057\u3085\u3046","\u3068\u304F\u3066\u3093","\u3068\u304F\u306B","\u3068\u304F\u3078\u3099\u3064","\u3068\u3051\u3044","\u3068\u3051\u308B","\u3068\u3053\u3084","\u3068\u3055\u304B","\u3068\u3057\u3087\u304B\u3093","\u3068\u305D\u3046","\u3068\u305F\u3093","\u3068\u3061\u3085\u3046","\u3068\u3063\u304D\u3085\u3046","\u3068\u3063\u304F\u3093","\u3068\u3064\u305B\u3099\u3093","\u3068\u3064\u306B\u3085\u3046","\u3068\u3068\u3099\u3051\u308B","\u3068\u3068\u306E\u3048\u308B","\u3068\u306A\u3044","\u3068\u306A\u3048\u308B","\u3068\u306A\u308A","\u3068\u306E\u3055\u307E","\u3068\u306F\u3099\u3059","\u3068\u3099\u3075\u3099\u304B\u3099\u308F","\u3068\u307B\u3046","\u3068\u307E\u308B","\u3068\u3081\u308B","\u3068\u3082\u305F\u3099\u3061","\u3068\u3082\u308B","\u3068\u3099\u3088\u3046\u3072\u3099","\u3068\u3089\u3048\u308B","\u3068\u3093\u304B\u3064","\u3068\u3099\u3093\u3075\u3099\u308A","\u306A\u3044\u304B\u304F","\u306A\u3044\u3053\u3046","\u306A\u3044\u3057\u3087","\u306A\u3044\u3059","\u306A\u3044\u305B\u3093","\u306A\u3044\u305D\u3046","\u306A\u304A\u3059","\u306A\u304B\u3099\u3044","\u306A\u304F\u3059","\u306A\u3051\u3099\u308B","\u306A\u3053\u3046\u3068\u3099","\u306A\u3055\u3051","\u306A\u305F\u3066\u3099\u3053\u3053","\u306A\u3063\u3068\u3046","\u306A\u3064\u3084\u3059\u307F","\u306A\u306A\u304A\u3057","\u306A\u306B\u3053\u3099\u3068","\u306A\u306B\u3082\u306E","\u306A\u306B\u308F","\u306A\u306E\u304B","\u306A\u3075\u305F\u3099","\u306A\u307E\u3044\u304D","\u306A\u307E\u3048","\u306A\u307E\u307F","\u306A\u307F\u305F\u3099","\u306A\u3081\u3089\u304B","\u306A\u3081\u308B","\u306A\u3084\u3080","\u306A\u3089\u3046","\u306A\u3089\u3072\u3099","\u306A\u3089\u3075\u3099","\u306A\u308C\u308B","\u306A\u308F\u3068\u3072\u3099","\u306A\u308F\u306F\u3099\u308A","\u306B\u3042\u3046","\u306B\u3044\u304B\u3099\u305F","\u306B\u3046\u3051","\u306B\u304A\u3044","\u306B\u304B\u3044","\u306B\u304B\u3099\u3066","\u306B\u304D\u3072\u3099","\u306B\u304F\u3057\u307F","\u306B\u304F\u307E\u3093","\u306B\u3051\u3099\u308B","\u306B\u3055\u3093\u304B\u305F\u3093\u305D","\u306B\u3057\u304D","\u306B\u305B\u3082\u306E","\u306B\u3061\u3057\u3099\u3087\u3046","\u306B\u3061\u3088\u3046\u3072\u3099","\u306B\u3063\u304B","\u306B\u3063\u304D","\u306B\u3063\u3051\u3044","\u306B\u3063\u3053\u3046","\u306B\u3063\u3055\u3093","\u306B\u3063\u3057\u3087\u304F","\u306B\u3063\u3059\u3046","\u306B\u3063\u305B\u304D","\u306B\u3063\u3066\u3044","\u306B\u306A\u3046","\u306B\u307B\u3093","\u306B\u307E\u3081","\u306B\u3082\u3064","\u306B\u3084\u308A","\u306B\u3085\u3046\u3044\u3093","\u306B\u308A\u3093\u3057\u3083","\u306B\u308F\u3068\u308A","\u306B\u3093\u3044","\u306B\u3093\u304B","\u306B\u3093\u304D","\u306B\u3093\u3051\u3099\u3093","\u306B\u3093\u3057\u304D","\u306B\u3093\u3059\u3099\u3046","\u306B\u3093\u305D\u3046","\u306B\u3093\u305F\u3044","\u306B\u3093\u3061","\u306B\u3093\u3066\u3044","\u306B\u3093\u306B\u304F","\u306B\u3093\u3075\u309A","\u306B\u3093\u307E\u308A","\u306B\u3093\u3080","\u306B\u3093\u3081\u3044","\u306B\u3093\u3088\u3046","\u306C\u3044\u304F\u304D\u3099","\u306C\u304B\u3059","\u306C\u304F\u3099\u3044\u3068\u308B","\u306C\u304F\u3099\u3046","\u306C\u304F\u3082\u308A","\u306C\u3059\u3080","\u306C\u307E\u3048\u3072\u3099","\u306C\u3081\u308A","\u306C\u3089\u3059","\u306C\u3093\u3061\u3083\u304F","\u306D\u3042\u3051\u3099","\u306D\u3044\u304D","\u306D\u3044\u308B","\u306D\u3044\u308D","\u306D\u304F\u3099\u305B","\u306D\u304F\u305F\u3044","\u306D\u304F\u3089","\u306D\u3053\u305B\u3099","\u306D\u3053\u3080","\u306D\u3055\u3051\u3099","\u306D\u3059\u3053\u3099\u3059","\u306D\u305D\u3078\u3099\u308B","\u306D\u305F\u3099\u3093","\u306D\u3064\u3044","\u306D\u3063\u3057\u3093","\u306D\u3064\u305D\u3099\u3046","\u306D\u3063\u305F\u3044\u304D\u3099\u3087","\u306D\u3075\u3099\u305D\u304F","\u306D\u3075\u305F\u3099","\u306D\u307B\u3099\u3046","\u306D\u307B\u308A\u306F\u307B\u308A","\u306D\u307E\u304D","\u306D\u307E\u308F\u3057","\u306D\u307F\u307F","\u306D\u3080\u3044","\u306D\u3080\u305F\u3044","\u306D\u3082\u3068","\u306D\u3089\u3046","\u306D\u308F\u3055\u3099","\u306D\u3093\u3044\u308A","\u306D\u3093\u304A\u3057","\u306D\u3093\u304B\u3093","\u306D\u3093\u304D\u3093","\u306D\u3093\u304F\u3099","\u306D\u3093\u3055\u3099","\u306D\u3093\u3057","\u306D\u3093\u3061\u3083\u304F","\u306D\u3093\u3068\u3099","\u306D\u3093\u3072\u309A","\u306D\u3093\u3075\u3099\u3064","\u306D\u3093\u307E\u3064","\u306D\u3093\u308A\u3087\u3046","\u306D\u3093\u308C\u3044","\u306E\u3044\u3059\u3099","\u306E\u304A\u3064\u3099\u307E","\u306E\u304B\u3099\u3059","\u306E\u304D\u306A\u307F","\u306E\u3053\u304D\u3099\u308A","\u306E\u3053\u3059","\u306E\u3053\u308B","\u306E\u305B\u308B","\u306E\u305D\u3099\u304F","\u306E\u305D\u3099\u3080","\u306E\u305F\u307E\u3046","\u306E\u3061\u307B\u3068\u3099","\u306E\u3063\u304F","\u306E\u306F\u3099\u3059","\u306E\u306F\u3089","\u306E\u3078\u3099\u308B","\u306E\u307B\u3099\u308B","\u306E\u307F\u3082\u306E","\u306E\u3084\u307E","\u306E\u3089\u3044\u306C","\u306E\u3089\u306D\u3053","\u306E\u308A\u3082\u306E","\u306E\u308A\u3086\u304D","\u306E\u308C\u3093","\u306E\u3093\u304D","\u306F\u3099\u3042\u3044","\u306F\u3042\u304F","\u306F\u3099\u3042\u3055\u3093","\u306F\u3099\u3044\u304B","\u306F\u3099\u3044\u304F","\u306F\u3044\u3051\u3093","\u306F\u3044\u3053\u3099","\u306F\u3044\u3057\u3093","\u306F\u3044\u3059\u3044","\u306F\u3044\u305B\u3093","\u306F\u3044\u305D\u3046","\u306F\u3044\u3061","\u306F\u3099\u3044\u306F\u3099\u3044","\u306F\u3044\u308C\u3064","\u306F\u3048\u308B","\u306F\u304A\u308B","\u306F\u304B\u3044","\u306F\u3099\u304B\u308A","\u306F\u304B\u308B","\u306F\u304F\u3057\u3085","\u306F\u3051\u3093","\u306F\u3053\u3075\u3099","\u306F\u3055\u307F","\u306F\u3055\u3093","\u306F\u3057\u3053\u3099","\u306F\u3099\u3057\u3087","\u306F\u3057\u308B","\u306F\u305B\u308B","\u306F\u309A\u305D\u3053\u3093","\u306F\u305D\u3093","\u306F\u305F\u3093","\u306F\u3061\u307F\u3064","\u306F\u3064\u304A\u3093","\u306F\u3063\u304B\u304F","\u306F\u3064\u3099\u304D","\u306F\u3063\u304D\u308A","\u306F\u3063\u304F\u3064","\u306F\u3063\u3051\u3093","\u306F\u3063\u3053\u3046","\u306F\u3063\u3055\u3093","\u306F\u3063\u3057\u3093","\u306F\u3063\u305F\u3064","\u306F\u3063\u3061\u3085\u3046","\u306F\u3063\u3066\u3093","\u306F\u3063\u3072\u309A\u3087\u3046","\u306F\u3063\u307B\u309A\u3046","\u306F\u306A\u3059","\u306F\u306A\u3072\u3099","\u306F\u306B\u304B\u3080","\u306F\u3075\u3099\u3089\u3057","\u306F\u307F\u304B\u3099\u304D","\u306F\u3080\u304B\u3046","\u306F\u3081\u3064","\u306F\u3084\u3044","\u306F\u3084\u3057","\u306F\u3089\u3046","\u306F\u308D\u3046\u3043\u3093","\u306F\u308F\u3044","\u306F\u3093\u3044","\u306F\u3093\u3048\u3044","\u306F\u3093\u304A\u3093","\u306F\u3093\u304B\u304F","\u306F\u3093\u304D\u3087\u3046","\u306F\u3099\u3093\u304F\u3099\u307F","\u306F\u3093\u3053","\u306F\u3093\u3057\u3083","\u306F\u3093\u3059\u3046","\u306F\u3093\u305F\u3099\u3093","\u306F\u309A\u3093\u3061","\u306F\u309A\u3093\u3064","\u306F\u3093\u3066\u3044","\u306F\u3093\u3068\u3057","\u306F\u3093\u306E\u3046","\u306F\u3093\u306F\u309A","\u306F\u3093\u3075\u3099\u3093","\u306F\u3093\u3078\u309A\u3093","\u306F\u3093\u307B\u3099\u3046\u304D","\u306F\u3093\u3081\u3044","\u306F\u3093\u3089\u3093","\u306F\u3093\u308D\u3093","\u3072\u3044\u304D","\u3072\u3046\u3093","\u3072\u3048\u308B","\u3072\u304B\u304F","\u3072\u304B\u308A","\u3072\u304B\u308B","\u3072\u304B\u3093","\u3072\u304F\u3044","\u3072\u3051\u3064","\u3072\u3053\u3046\u304D","\u3072\u3053\u304F","\u3072\u3055\u3044","\u3072\u3055\u3057\u3075\u3099\u308A","\u3072\u3055\u3093","\u3072\u3099\u3057\u3099\u3085\u3064\u304B\u3093","\u3072\u3057\u3087","\u3072\u305D\u304B","\u3072\u305D\u3080","\u3072\u305F\u3080\u304D","\u3072\u305F\u3099\u308A","\u3072\u305F\u308B","\u3072\u3064\u304D\u3099","\u3072\u3063\u3053\u3057","\u3072\u3063\u3057","\u3072\u3064\u3057\u3099\u3085\u3072\u3093","\u3072\u3063\u3059","\u3072\u3064\u305B\u3099\u3093","\u3072\u309A\u3063\u305F\u308A","\u3072\u309A\u3063\u3061\u308A","\u3072\u3064\u3088\u3046","\u3072\u3066\u3044","\u3072\u3068\u3053\u3099\u307F","\u3072\u306A\u307E\u3064\u308A","\u3072\u306A\u3093","\u3072\u306D\u308B","\u3072\u306F\u3093","\u3072\u3072\u3099\u304F","\u3072\u3072\u3087\u3046","\u3072\u307B\u3046","\u3072\u307E\u308F\u308A","\u3072\u307E\u3093","\u3072\u307F\u3064","\u3072\u3081\u3044","\u3072\u3081\u3057\u3099\u3057","\u3072\u3084\u3051","\u3072\u3084\u3059","\u3072\u3088\u3046","\u3072\u3099\u3087\u3046\u304D","\u3072\u3089\u304B\u3099\u306A","\u3072\u3089\u304F","\u3072\u308A\u3064","\u3072\u308A\u3087\u3046","\u3072\u308B\u307E","\u3072\u308B\u3084\u3059\u307F","\u3072\u308C\u3044","\u3072\u308D\u3044","\u3072\u308D\u3046","\u3072\u308D\u304D","\u3072\u308D\u3086\u304D","\u3072\u3093\u304B\u304F","\u3072\u3093\u3051\u3064","\u3072\u3093\u3053\u3093","\u3072\u3093\u3057\u3085","\u3072\u3093\u305D\u3046","\u3072\u309A\u3093\u3061","\u3072\u3093\u306F\u309A\u3093","\u3072\u3099\u3093\u307B\u3099\u3046","\u3075\u3042\u3093","\u3075\u3044\u3046\u3061","\u3075\u3046\u3051\u3044","\u3075\u3046\u305B\u3093","\u3075\u309A\u3046\u305F\u308D\u3046","\u3075\u3046\u3068\u3046","\u3075\u3046\u3075","\u3075\u3048\u308B","\u3075\u304A\u3093","\u3075\u304B\u3044","\u3075\u304D\u3093","\u3075\u304F\u3055\u3099\u3064","\u3075\u304F\u3075\u3099\u304F\u308D","\u3075\u3053\u3046","\u3075\u3055\u3044","\u3075\u3057\u304D\u3099","\u3075\u3057\u3099\u307F","\u3075\u3059\u307E","\u3075\u305B\u3044","\u3075\u305B\u304F\u3099","\u3075\u305D\u304F","\u3075\u3099\u305F\u306B\u304F","\u3075\u305F\u3093","\u3075\u3061\u3087\u3046","\u3075\u3064\u3046","\u3075\u3064\u304B","\u3075\u3063\u304B\u3064","\u3075\u3063\u304D","\u3075\u3063\u3053\u304F","\u3075\u3099\u3068\u3099\u3046","\u3075\u3068\u308B","\u3075\u3068\u3093","\u3075\u306E\u3046","\u3075\u306F\u3044","\u3075\u3072\u3087\u3046","\u3075\u3078\u3093","\u3075\u307E\u3093","\u3075\u307F\u3093","\u3075\u3081\u3064","\u3075\u3081\u3093","\u3075\u3088\u3046","\u3075\u308A\u3053","\u3075\u308A\u308B","\u3075\u308B\u3044","\u3075\u3093\u3044\u304D","\u3075\u3099\u3093\u304B\u3099\u304F","\u3075\u3099\u3093\u304F\u3099","\u3075\u3093\u3057\u3064","\u3075\u3099\u3093\u305B\u304D","\u3075\u3093\u305D\u3046","\u3075\u3099\u3093\u307B\u309A\u3046","\u3078\u3044\u3042\u3093","\u3078\u3044\u304A\u3093","\u3078\u3044\u304B\u3099\u3044","\u3078\u3044\u304D","\u3078\u3044\u3051\u3099\u3093","\u3078\u3044\u3053\u3046","\u3078\u3044\u3055","\u3078\u3044\u3057\u3083","\u3078\u3044\u305B\u3064","\u3078\u3044\u305D","\u3078\u3044\u305F\u304F","\u3078\u3044\u3066\u3093","\u3078\u3044\u306D\u3064","\u3078\u3044\u308F","\u3078\u304D\u304B\u3099","\u3078\u3053\u3080","\u3078\u3099\u306B\u3044\u308D","\u3078\u3099\u306B\u3057\u3087\u3046\u304B\u3099","\u3078\u3089\u3059","\u3078\u3093\u304B\u3093","\u3078\u3099\u3093\u304D\u3087\u3046","\u3078\u3099\u3093\u3053\u3099\u3057","\u3078\u3093\u3055\u3044","\u3078\u3093\u305F\u3044","\u3078\u3099\u3093\u308A","\u307B\u3042\u3093","\u307B\u3044\u304F","\u307B\u3099\u3046\u304D\u3099\u3087","\u307B\u3046\u3053\u304F","\u307B\u3046\u305D\u3046","\u307B\u3046\u307B\u3046","\u307B\u3046\u3082\u3093","\u307B\u3046\u308A\u3064","\u307B\u3048\u308B","\u307B\u304A\u3093","\u307B\u304B\u3093","\u307B\u304D\u3087\u3046","\u307B\u3099\u304D\u3093","\u307B\u304F\u308D","\u307B\u3051\u3064","\u307B\u3051\u3093","\u307B\u3053\u3046","\u307B\u3053\u308B","\u307B\u3057\u3044","\u307B\u3057\u3064","\u307B\u3057\u3085","\u307B\u3057\u3087\u3046","\u307B\u305B\u3044","\u307B\u305D\u3044","\u307B\u305D\u304F","\u307B\u305F\u3066","\u307B\u305F\u308B","\u307B\u309A\u3061\u3075\u3099\u304F\u308D","\u307B\u3063\u304D\u3087\u304F","\u307B\u3063\u3055","\u307B\u3063\u305F\u3093","\u307B\u3068\u3093\u3068\u3099","\u307B\u3081\u308B","\u307B\u3093\u3044","\u307B\u3093\u304D","\u307B\u3093\u3051","\u307B\u3093\u3057\u3064","\u307B\u3093\u3084\u304F","\u307E\u3044\u306B\u3061","\u307E\u304B\u3044","\u307E\u304B\u305B\u308B","\u307E\u304B\u3099\u308B","\u307E\u3051\u308B","\u307E\u3053\u3068","\u307E\u3055\u3064","\u307E\u3057\u3099\u3081","\u307E\u3059\u304F","\u307E\u305B\u3099\u308B","\u307E\u3064\u308A","\u307E\u3068\u3081","\u307E\u306A\u3075\u3099","\u307E\u306C\u3051","\u307E\u306D\u304F","\u307E\u307B\u3046","\u307E\u3082\u308B","\u307E\u3086\u3051\u3099","\u307E\u3088\u3046","\u307E\u308D\u3084\u304B","\u307E\u308F\u3059","\u307E\u308F\u308A","\u307E\u308F\u308B","\u307E\u3093\u304B\u3099","\u307E\u3093\u304D\u3064","\u307E\u3093\u305D\u3099\u304F","\u307E\u3093\u306A\u304B","\u307F\u3044\u3089","\u307F\u3046\u3061","\u307F\u3048\u308B","\u307F\u304B\u3099\u304F","\u307F\u304B\u305F","\u307F\u304B\u3093","\u307F\u3051\u3093","\u307F\u3053\u3093","\u307F\u3057\u3099\u304B\u3044","\u307F\u3059\u3044","\u307F\u3059\u3048\u308B","\u307F\u305B\u308B","\u307F\u3063\u304B","\u307F\u3064\u304B\u308B","\u307F\u3064\u3051\u308B","\u307F\u3066\u3044","\u307F\u3068\u3081\u308B","\u307F\u306A\u3068","\u307F\u306A\u307F\u304B\u3055\u3044","\u307F\u306D\u3089\u308B","\u307F\u306E\u3046","\u307F\u306E\u304B\u3099\u3059","\u307F\u307B\u3093","\u307F\u3082\u3068","\u307F\u3084\u3051\u3099","\u307F\u3089\u3044","\u307F\u308A\u3087\u304F","\u307F\u308F\u304F","\u307F\u3093\u304B","\u307F\u3093\u305D\u3099\u304F","\u3080\u3044\u304B","\u3080\u3048\u304D","\u3080\u3048\u3093","\u3080\u304B\u3044","\u3080\u304B\u3046","\u3080\u304B\u3048","\u3080\u304B\u3057","\u3080\u304D\u3099\u3061\u3083","\u3080\u3051\u308B","\u3080\u3051\u3099\u3093","\u3080\u3055\u307B\u3099\u308B","\u3080\u3057\u3042\u3064\u3044","\u3080\u3057\u306F\u3099","\u3080\u3057\u3099\u3085\u3093","\u3080\u3057\u308D","\u3080\u3059\u3046","\u3080\u3059\u3053","\u3080\u3059\u3075\u3099","\u3080\u3059\u3081","\u3080\u305B\u308B","\u3080\u305B\u3093","\u3080\u3061\u3085\u3046","\u3080\u306A\u3057\u3044","\u3080\u306E\u3046","\u3080\u3084\u307F","\u3080\u3088\u3046","\u3080\u3089\u3055\u304D","\u3080\u308A\u3087\u3046","\u3080\u308D\u3093","\u3081\u3044\u3042\u3093","\u3081\u3044\u3046\u3093","\u3081\u3044\u3048\u3093","\u3081\u3044\u304B\u304F","\u3081\u3044\u304D\u3087\u304F","\u3081\u3044\u3055\u3044","\u3081\u3044\u3057","\u3081\u3044\u305D\u3046","\u3081\u3044\u3075\u3099\u3064","\u3081\u3044\u308C\u3044","\u3081\u3044\u308F\u304F","\u3081\u304F\u3099\u307E\u308C\u308B","\u3081\u3055\u3099\u3059","\u3081\u3057\u305F","\u3081\u3059\u3099\u3089\u3057\u3044","\u3081\u305F\u3099\u3064","\u3081\u307E\u3044","\u3081\u3084\u3059","\u3081\u3093\u304D\u3087","\u3081\u3093\u305B\u304D","\u3081\u3093\u3068\u3099\u3046","\u3082\u3046\u3057\u3042\u3051\u3099\u308B","\u3082\u3046\u3068\u3099\u3046\u3051\u3093","\u3082\u3048\u308B","\u3082\u304F\u3057","\u3082\u304F\u3066\u304D","\u3082\u304F\u3088\u3046\u3072\u3099","\u3082\u3061\u308D\u3093","\u3082\u3068\u3099\u308B","\u3082\u3089\u3046","\u3082\u3093\u304F","\u3082\u3093\u305F\u3099\u3044","\u3084\u304A\u3084","\u3084\u3051\u308B","\u3084\u3055\u3044","\u3084\u3055\u3057\u3044","\u3084\u3059\u3044","\u3084\u3059\u305F\u308D\u3046","\u3084\u3059\u307F","\u3084\u305B\u308B","\u3084\u305D\u3046","\u3084\u305F\u3044","\u3084\u3061\u3093","\u3084\u3063\u3068","\u3084\u3063\u306F\u309A\u308A","\u3084\u3075\u3099\u308B","\u3084\u3081\u308B","\u3084\u3084\u3053\u3057\u3044","\u3084\u3088\u3044","\u3084\u308F\u3089\u304B\u3044","\u3086\u3046\u304D","\u3086\u3046\u3072\u3099\u3093\u304D\u3087\u304F","\u3086\u3046\u3078\u3099","\u3086\u3046\u3081\u3044","\u3086\u3051\u3064","\u3086\u3057\u3085\u3064","\u3086\u305B\u3093","\u3086\u305D\u3046","\u3086\u305F\u304B","\u3086\u3061\u3083\u304F","\u3086\u3066\u3099\u308B","\u3086\u306B\u3085\u3046","\u3086\u3072\u3099\u308F","\u3086\u3089\u3044","\u3086\u308C\u308B","\u3088\u3046\u3044","\u3088\u3046\u304B","\u3088\u3046\u304D\u3085\u3046","\u3088\u3046\u3057\u3099","\u3088\u3046\u3059","\u3088\u3046\u3061\u3048\u3093","\u3088\u304B\u305B\u3099","\u3088\u304B\u3093","\u3088\u304D\u3093","\u3088\u304F\u305B\u3044","\u3088\u304F\u307B\u3099\u3046","\u3088\u3051\u3044","\u3088\u3053\u3099\u308C\u308B","\u3088\u3055\u3093","\u3088\u3057\u3085\u3046","\u3088\u305D\u3046","\u3088\u305D\u304F","\u3088\u3063\u304B","\u3088\u3066\u3044","\u3088\u3068\u3099\u304B\u3099\u308F\u304F","\u3088\u306D\u3064","\u3088\u3084\u304F","\u3088\u3086\u3046","\u3088\u308D\u3053\u3075\u3099","\u3088\u308D\u3057\u3044","\u3089\u3044\u3046","\u3089\u304F\u304B\u3099\u304D","\u3089\u304F\u3053\u3099","\u3089\u304F\u3055\u3064","\u3089\u304F\u305F\u3099","\u3089\u3057\u3093\u306F\u3099\u3093","\u3089\u305B\u3093","\u3089\u305D\u3099\u304F","\u3089\u305F\u3044","\u3089\u3063\u304B","\u3089\u308C\u3064","\u308A\u3048\u304D","\u308A\u304B\u3044","\u308A\u304D\u3055\u304F","\u308A\u304D\u305B\u3064","\u308A\u304F\u304F\u3099\u3093","\u308A\u304F\u3064","\u308A\u3051\u3093","\u308A\u3053\u3046","\u308A\u305B\u3044","\u308A\u305D\u3046","\u308A\u305D\u304F","\u308A\u3066\u3093","\u308A\u306D\u3093","\u308A\u3086\u3046","\u308A\u3085\u3046\u304B\u3099\u304F","\u308A\u3088\u3046","\u308A\u3087\u3046\u308A","\u308A\u3087\u304B\u3093","\u308A\u3087\u304F\u3061\u3083","\u308A\u3087\u3053\u3046","\u308A\u308A\u304F","\u308A\u308C\u304D","\u308A\u308D\u3093","\u308A\u3093\u3053\u3099","\u308B\u3044\u3051\u3044","\u308B\u3044\u3055\u3044","\u308B\u3044\u3057\u3099","\u308B\u3044\u305B\u304D","\u308B\u3059\u306F\u3099\u3093","\u308B\u308A\u304B\u3099\u308F\u3089","\u308C\u3044\u304B\u3093","\u308C\u3044\u304D\u3099","\u308C\u3044\u305B\u3044","\u308C\u3044\u305D\u3099\u3046\u3053","\u308C\u3044\u3068\u3046","\u308C\u3044\u307B\u3099\u3046","\u308C\u304D\u3057","\u308C\u304D\u305F\u3099\u3044","\u308C\u3093\u3042\u3044","\u308C\u3093\u3051\u3044","\u308C\u3093\u3053\u3093","\u308C\u3093\u3055\u3044","\u308C\u3093\u3057\u3085\u3046","\u308C\u3093\u305D\u3099\u304F","\u308C\u3093\u3089\u304F","\u308D\u3046\u304B","\u308D\u3046\u3053\u3099","\u308D\u3046\u3057\u3099\u3093","\u308D\u3046\u305D\u304F","\u308D\u304F\u304B\u3099","\u308D\u3053\u3064","\u308D\u3057\u3099\u3046\u3089","\u308D\u3057\u3085\u3064","\u308D\u305B\u3093","\u308D\u3066\u3093","\u308D\u3081\u3093","\u308D\u308C\u3064","\u308D\u3093\u304D\u3099","\u308D\u3093\u306F\u309A","\u308D\u3093\u3075\u3099\u3093","\u308D\u3093\u308A","\u308F\u304B\u3059","\u308F\u304B\u3081","\u308F\u304B\u3084\u307E","\u308F\u304B\u308C\u308B","\u308F\u3057\u3064","\u308F\u3057\u3099\u307E\u3057","\u308F\u3059\u308C\u3082\u306E","\u308F\u3089\u3046","\u308F\u308C\u308B"];gM.exports=rie});var yM=k((q5e,mM)=>{"use strict";v();var iie=["a\u0301baco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","accio\u0301n","aceite","acelga","acento","aceptar","a\u0301cido","aclarar","acne\u0301","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","ae\u0301reo","afectar","aficio\u0301n","afinar","afirmar","a\u0301gil","agitar","agoni\u0301a","agosto","agotar","agregar","agrio","agua","agudo","a\u0301guila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacra\u0301n","alambre","alarma","alba","a\u0301lbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodo\u0301n","aliado","aliento","alivio","alma","almeja","almi\u0301bar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","a\u0301mbar","a\u0301mbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","ande\u0301n","anemia","a\u0301ngulo","anillo","a\u0301nimo","ani\u0301s","anotar","antena","antiguo","antojo","anual","anular","anuncio","an\u0303adir","an\u0303ejo","an\u0303o","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","aran\u0303a","arar","a\u0301rbitro","a\u0301rbol","arbusto","archivo","arco","arder","ardilla","arduo","a\u0301rea","a\u0301rido","aries","armoni\u0301a","arne\u0301s","aroma","arpa","arpo\u0301n","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","a\u0301spero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","a\u0301tico","atleta","a\u0301tomo","atraer","atroz","atu\u0301n","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avio\u0301n","aviso","ayer","ayuda","ayuno","azafra\u0301n","azar","azote","azu\u0301car","azufre","azul","baba","babor","bache","bahi\u0301a","baile","bajar","balanza","balco\u0301n","balde","bambu\u0301","banco","banda","ban\u0303o","barba","barco","barniz","barro","ba\u0301scula","basto\u0301n","basura","batalla","bateri\u0301a","batir","batuta","bau\u0301l","bazar","bebe\u0301","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsa\u0301i","borde","borrar","bosque","bote","boti\u0301n","bo\u0301veda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufo\u0301n","bu\u0301ho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzo\u0301n","caballo","cabeza","cabina","cabra","cacao","cada\u0301ver","cadena","caer","cafe\u0301","cai\u0301da","caima\u0301n","caja","cajo\u0301n","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","ca\u0301ncer","candil","canela","canguro","canica","canto","can\u0303a","can\u0303o\u0301n","caoba","caos","capaz","capita\u0301n","capote","captar","capucha","cara","carbo\u0301n","ca\u0301rcel","careta","carga","carin\u0303o","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","ce\u0301lebre","celoso","ce\u0301lula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","ce\u0301sped","cetro","chacal","chaleco","champu\u0301","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclo\u0301n","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","cipre\u0301s","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","cli\u0301nica","cobre","coccio\u0301n","cochino","cocina","coco","co\u0301digo","codo","cofre","coger","cohete","coji\u0301n","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","co\u0301modo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazo\u0301n","corbata","corcho","cordo\u0301n","corona","correr","coser","cosmos","costa","cra\u0301neo","cra\u0301ter","crear","crecer","crei\u0301do","crema","cri\u0301a","crimen","cripta","crisis","cromo","cro\u0301nica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupo\u0301n","cu\u0301pula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","da\u0301til","deber","de\u0301bil","de\u0301cada","decir","dedo","defensa","definir","dejar","delfi\u0301n","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvi\u0301o","detalle","detener","deuda","di\u0301a","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difi\u0301cil","digno","dilema","diluir","dinero","directo","dirigir","disco","disen\u0303o","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","drago\u0301n","droga","ducha","duda","duelo","duen\u0303o","dulce","du\u0301o","duque","durar","dureza","duro","e\u0301bano","ebrio","echar","eco","ecuador","edad","edicio\u0301n","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","e\u0301lite","elixir","elogio","eludir","embudo","emitir","emocio\u0301n","empate","empen\u0303o","empleo","empresa","enano","encargo","enchufe","enci\u0301a","enemigo","enero","enfado","enfermo","engan\u0303o","enigma","enlace","enorme","enredo","ensayo","ensen\u0303ar","entero","entrar","envase","envi\u0301o","e\u0301poca","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espi\u0301a","esposa","espuma","esqui\u0301","estar","este","estilo","estufa","etapa","eterno","e\u0301tica","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","e\u0301xito","experto","explicar","exponer","extremo","fa\u0301brica","fa\u0301bula","fachada","fa\u0301cil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","farao\u0301n","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fe\u0301rtil","fervor","festi\u0301n","fiable","fianza","fiar","fibra","ficcio\u0301n","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flu\u0301or","fobia","foca","fogata","fogo\u0301n","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","fra\u0301gil","franja","frase","fraude","frei\u0301r","freno","fresa","fri\u0301o","frito","fruta","fuego","fuente","fuerza","fuga","fumar","funcio\u0301n","funda","furgo\u0301n","furia","fusil","fu\u0301tbol","futuro","gacela","gafas","gaita","gajo","gala","galeri\u0301a","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavila\u0301n","gemelo","gemir","gen","ge\u0301nero","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gra\u0301fico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","gru\u0301a","grueso","grumo","grupo","guante","guapo","guardia","guerra","gui\u0301a","guin\u0303o","guion","guiso","guitarra","gusano","gustar","haber","ha\u0301bil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazan\u0303a","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","he\u0301roe","hervir","hielo","hierro","hi\u0301gado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","hu\u0301medo","humilde","humo","hundir","huraca\u0301n","hurto","icono","ideal","idioma","i\u0301dolo","iglesia","iglu\u0301","igual","ilegal","ilusio\u0301n","imagen","ima\u0301n","imitar","impar","imperio","imponer","impulso","incapaz","i\u0301ndice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","intere\u0301s","i\u0301ntimo","intuir","inu\u0301til","invierno","ira","iris","ironi\u0301a","isla","islote","jabali\u0301","jabo\u0301n","jamo\u0301n","jarabe","jardi\u0301n","jarra","jaula","jazmi\u0301n","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","ju\u0301piter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladro\u0301n","lagarto","la\u0301grima","laguna","laico","lamer","la\u0301mina","la\u0301mpara","lana","lancha","langosta","lanza","la\u0301piz","largo","larva","la\u0301stima","lata","la\u0301tex","latir","laurel","lavar","lazo","leal","leccio\u0301n","leche","lector","leer","legio\u0301n","legumbre","lejano","lengua","lento","len\u0303a","leo\u0301n","leopardo","lesio\u0301n","letal","letra","leve","leyenda","libertad","libro","licor","li\u0301der","lidiar","lienzo","liga","ligero","lima","li\u0301mite","limo\u0301n","limpio","lince","lindo","li\u0301nea","lingote","lino","linterna","li\u0301quido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","locio\u0301n","loco","locura","lo\u0301gica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","mai\u0301z","maldad","maleta","malla","malo","mama\u0301","mambo","mamut","manco","mando","manejar","manga","maniqui\u0301","manjar","mano","manso","manta","man\u0303ana","mapa","ma\u0301quina","mar","marco","marea","marfil","margen","marido","ma\u0301rmol","marro\u0301n","martes","marzo","masa","ma\u0301scara","masivo","matar","materia","matiz","matriz","ma\u0301ximo","mayor","mazorca","mecha","medalla","medio","me\u0301dula","mejilla","mejor","melena","melo\u0301n","memoria","menor","mensaje","mente","menu\u0301","mercado","merengue","me\u0301rito","mes","meso\u0301n","meta","meter","me\u0301todo","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millo\u0301n","mimo","mina","minero","mi\u0301nimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","mocio\u0301n","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","mon\u0303o","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","mo\u0301vil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","mun\u0303eca","mural","muro","mu\u0301sculo","museo","musgo","mu\u0301sica","muslo","na\u0301car","nacio\u0301n","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","na\u0301usea","naval","nave","navidad","necio","ne\u0301ctar","negar","negocio","negro","neo\u0301n","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","nin\u0303ez","nin\u0303o","ni\u0301tido","nivel","nobleza","noche","no\u0301mina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","nu\u0301cleo","nudillo","nudo","nuera","nueve","nuez","nulo","nu\u0301mero","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","oce\u0301ano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oi\u0301do","oi\u0301r","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opcio\u0301n","o\u0301pera","opinar","oponer","optar","o\u0301ptica","opuesto","oracio\u0301n","orador","oral","o\u0301rbita","orca","orden","oreja","o\u0301rgano","orgi\u0301a","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadi\u0301a","oscuro","osezno","oso","ostra","oton\u0303o","otro","oveja","o\u0301vulo","o\u0301xido","oxi\u0301geno","oyente","ozono","pacto","padre","paella","pa\u0301gina","pago","pai\u0301s","pa\u0301jaro","palabra","palco","paleta","pa\u0301lido","palma","paloma","palpar","pan","panal","pa\u0301nico","pantera","pan\u0303uelo","papa\u0301","papel","papilla","paquete","parar","parcela","pared","parir","paro","pa\u0301rpado","parque","pa\u0301rrafo","parte","pasar","paseo","pasio\u0301n","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peato\u0301n","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldan\u0303o","pelea","peligro","pellejo","pelo","peluca","pena","pensar","pen\u0303o\u0301n","peo\u0301n","peor","pepino","pequen\u0303o","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pe\u0301simo","pestan\u0303a","pe\u0301talo","petro\u0301leo","pez","pezun\u0303a","picar","picho\u0301n","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","pin\u0303a","piojo","pipa","pirata","pisar","piscina","piso","pista","pito\u0301n","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesi\u0301a","poeta","polen","polici\u0301a","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porcio\u0301n","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","pri\u0301ncipe","prisio\u0301n","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","pro\u0301ximo","prueba","pu\u0301blico","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmo\u0301n","pulpo","pulso","puma","punto","pun\u0303al","pun\u0303o","pupa","pupila","pure\u0301","quedar","queja","quemar","querer","queso","quieto","qui\u0301mica","quince","quitar","ra\u0301bano","rabia","rabo","racio\u0301n","radical","rai\u0301z","rama","rampa","rancho","rango","rapaz","ra\u0301pido","rapto","rasgo","raspa","rato","rayo","raza","razo\u0301n","reaccio\u0301n","realidad","reban\u0303o","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refra\u0301n","refugio","regalo","regir","regla","regreso","rehe\u0301n","reino","rei\u0301r","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","reve\u0301s","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","ri\u0301gido","rigor","rinco\u0301n","rin\u0303o\u0301n","ri\u0301o","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubi\u0301","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sa\u0301bado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmo\u0301n","salo\u0301n","salsa","salto","salud","salvar","samba","sancio\u0301n","sandi\u0301a","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sarte\u0301n","sastre","sata\u0301n","sauna","saxofo\u0301n","seccio\u0301n","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","sen\u0303al","sen\u0303or","separar","sepia","sequi\u0301a","ser","serie","sermo\u0301n","servir","sesenta","sesio\u0301n","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","si\u0301laba","silbar","silencio","silla","si\u0301mbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","so\u0301lido","soltar","solucio\u0301n","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","soste\u0301n","so\u0301tano","suave","subir","suceso","sudor","suegra","suelo","suen\u0303o","suerte","sufrir","sujeto","sulta\u0301n","sumar","superar","suplir","suponer","supremo","sur","surco","suren\u0303o","surgir","susto","sutil","tabaco","tabique","tabla","tabu\u0301","taco","tacto","tajo","talar","talco","talento","talla","talo\u0301n","taman\u0303o","tambor","tango","tanque","tapa","tapete","tapia","tapo\u0301n","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazo\u0301n","teatro","techo","tecla","te\u0301cnica","tejado","tejer","tejido","tela","tele\u0301fono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teori\u0301a","terapia","terco","te\u0301rmino","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburo\u0301n","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","ti\u0301mido","timo","tinta","ti\u0301o","ti\u0301pico","tipo","tira","tiro\u0301n","tita\u0301n","ti\u0301tere","ti\u0301tulo","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","to\u0301rax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","to\u0301xico","trabajo","tractor","traer","tra\u0301fico","trago","traje","tramo","trance","trato","trauma","trazar","tre\u0301bol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tuberi\u0301a","tubo","tuerto","tumba","tumor","tu\u0301nel","tu\u0301nica","turbina","turismo","turno","tutor","ubicar","u\u0301lcera","umbral","unidad","unir","universo","uno","untar","un\u0303a","urbano","urbe","urgente","urna","usar","usuario","u\u0301til","utopi\u0301a","uva","vaca","vaci\u0301o","vacuna","vagar","vago","vaina","vajilla","vale","va\u0301lido","valle","valor","va\u0301lvula","vampiro","vara","variar","varo\u0301n","vaso","vecino","vector","vehi\u0301culo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vi\u0301a","viaje","vibrar","vicio","vi\u0301ctima","vida","vi\u0301deo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","vin\u0303edo","violi\u0301n","viral","virgo","virtud","visor","vi\u0301spera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volca\u0301n","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"];mM.exports=iie});var _M=k((F5e,bM)=>{v();bM.exports={CHINESE:uM(),ENGLISH:cM(),FRENCH:hM(),ITALIAN:pM(),JAPANESE:vM(),SPANISH:yM()}});var xM=k((j5e,SM)=>{"use strict";v();var Va=Te(),nie=Va.crypto.BN,t1=XB(),vl=Va.deps._,oie=nM(),Y4=aM(),aie=Va.crypto.Hash,sie=Va.crypto.Random,wM=Va.util.preconditions,dt=function(e,t){if(!(this instanceof dt))return new dt(e,t);vl.isArray(e)&&(t=e,e=null);var r,i,n;if(h.Buffer.isBuffer(e))n=e;else if(vl.isString(e))i=t1.nfkd(e);else if(vl.isNumber(e))r=e;else if(e)throw new Va.errors.InvalidArgument("data","Must be a Buffer, a string or an integer");if(r=r||128,t=t||dt._getDictionary(i),i&&!t)throw new Y4.UnknownWordlist(i);if(t=t||dt.Words.ENGLISH,n&&(i=dt._entropy2mnemonic(n,t)),i&&!dt.isValid(i,t))throw new Y4.InvalidMnemonic(i);if(r%32!==0||r<128)throw new Va.errors.InvalidArgument("ENT","Values must be ENT > 128 and ENT % 32 == 0");i=i||dt._mnemonic(r,t),Object.defineProperty(this,"wordlist",{configurable:!1,value:t}),Object.defineProperty(this,"phrase",{configurable:!1,value:i})};dt.fromRandom=function(e,t){if(vl.isNumber(e)){var r=t;t=e,e=r}return e=e||dt.Words.ENGLISH,t=t||128,new dt(t,e)};dt.fromString=function(e,t=dt.Words.ENGLISH){return new dt(e,t)};dt.Words=_M();dt.isValid=function(e,t){if(e=t1.nfkd(e),t=t||dt._getDictionary(e),!t)return!1;for(var r=e.split(" "),i="",n=0;n<r.length;n++){var o=t.indexOf(r[n]);if(o<0)return!1;i=i+("00000000000"+o.toString(2)).slice(-11)}var a=i.length/33,s=i.slice(-a),u=i.slice(0,i.length-a),c=h.Buffer.alloc(u.length/8);for(n=0;n<u.length/8;n++)c.writeUInt8(parseInt(i.slice(n*8,(n+1)*8),2),n);var l=dt._entropyChecksum(c);return l===s};dt._belongsToWordlist=function(e,t){for(var r=t1.nfkd(e).split(" "),i=0;i<r.length;i++){var n=t.indexOf(r[i]);if(n<0)return!1}return!0};dt._getDictionary=function(e){if(!e)return null;for(var t=Object.keys(dt.Words),r=0;r<t.length;r++){var i=t[r];if(dt._belongsToWordlist(e,dt.Words[i]))return dt.Words[i]}return null};dt.prototype.toSeed=function(e){return e=e||"",oie(t1.nfkd(this.phrase),t1.nfkd("mnemonic"+e),2048,64)};dt.fromSeed=function(e,t){return wM.checkArgument(h.Buffer.isBuffer(e),"seed must be a Buffer."),wM.checkArgument(vl.isArray(t)||vl.isString(t),"wordlist must be a string or an array."),new dt(e,t)};dt.prototype.toHDPrivateKey=function(e,t){var r=this.toSeed(e);return Va.HDPrivateKey.fromSeed(r,t)};dt.prototype.toString=function(){return this.phrase};dt.prototype.inspect=function(){return"<Mnemonic: "+this.toString()+" >"};dt._mnemonic=function(e,t){var r=sie.getRandomBuffer(e/8);return dt._entropy2mnemonic(r,t)};dt._entropy2mnemonic=function(e,t){for(var r="",i=0;i<e.length;i++)r=r+("00000000"+e[i].toString(2)).slice(-8);if(r=r+dt._entropyChecksum(e),r.length%11!==0)throw new Y4.InvalidEntropy(r);var n=[];for(i=0;i<r.length/11;i++){var o=parseInt(r.slice(i*11,(i+1)*11),2);n.push(t[o])}var a;return t===dt.Words.JAPANESE?a=n.join("\u3000"):a=n.join(" "),a};dt._entropyChecksum=function(e){for(var t=aie.sha256(e),r=e.length*8,i=r/32,n=new nie(t.toString("hex"),16).toString(2);n.length%256!==0;)n="0"+n;var o=n.slice(0,i);return o};dt.bsv=Va;SM.exports=dt});var IM=k((K5e,OM)=>{v();var EM=Te();EM.Mnemonic=xM();OM.exports=EM.Mnemonic});function uie(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function fie(e){if(typeof e!="boolean")throw new TypeError(`boolean expected, not ${e}`)}function O6(e){if(typeof e!="number")throw new TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError("positive integer expected, got "+e)}function st(e,t,r=""){let i=uie(e),n=e?.length,o=t!==void 0;if(!i||o&&n!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=i?`length=${n}`:`type=${typeof e}`,c=a+"expected Uint8Array"+s+", got "+u;throw i?new RangeError(c):new TypeError(c)}return e}function r1(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 i1(e,t,r=!1){st(e,void 0,"output");let i=t.outputLen;if(e.length<i)throw new RangeError("digestInto() expects output buffer of length at least "+i);if(r&&!Yr(e))throw new Error("invalid output, must be aligned")}function I6(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function vt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Rt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ml(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function $4(e,t){return!e.byteLength||!t.byteLength?!1:e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength}function n1(e,t){if($4(e,t)&&e.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}function X4(...e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];st(n),t+=n.length}let r=new Uint8Array(t);for(let i=0,n=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return r}function o1(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return r===0}function a1(e,t,r){let i=t,n=r||(()=>[]),o=(s,u)=>i(u,...n(s)).update(s).digest(),a=i(new Uint8Array(e),...n(new Uint8Array(0)));return o.outputLen=a.outputLen,o.blockLen=a.blockLen,o.create=(s,...u)=>i(s,...u),o}function Sf(e,t,r=!0){if(t===void 0)return new Uint8Array(e);if(st(t,void 0,"output"),t.length!==e)throw new Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&!Yr(t))throw new Error("invalid output, must be aligned");return t}function AM(e,t,r){O6(e),O6(t),fie(r);let i=new Uint8Array(16),n=ml(i);return n.setBigUint64(0,BigInt(t),r),n.setBigUint64(8,BigInt(e),r),i}function Yr(e){return e.byteOffset%4===0}function tr(e){return Uint8Array.from(st(e))}var Sn,wf,ut,cie,_t,Ho,J4=Xr(()=>{v();Sn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,wf=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,ut=Sn?e=>e:e=>wf(e)>>>0,cie=e=>{for(let t=0;t<e.length;t++)e[t]=wf(e[t]);return e},_t=Sn?e=>e:cie;Ho=(e,t)=>{function r(i,...n){if(st(i,void 0,"key"),e.nonceLength!==void 0){let l=n[0];st(l,e.varSizeNonce?void 0:e.nonceLength,"nonce")}let o=e.tagLength;o&&n[1]!==void 0&&st(n[1],void 0,"AAD");let a=t(i,...n),s=(l,m)=>{if(m!==void 0){if(l!==2)throw new Error("cipher output not supported");st(m,void 0,"output")}},u=!1;return{encrypt(l,m){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,st(l),s(a.encrypt.length,m),a.encrypt(l,m)},decrypt(l,m){if(st(l),o&&l.length<o)throw new Error('"ciphertext" expected length bigger than tagLength='+o);return s(a.decrypt.length,m),a.decrypt(l,m)}}}return Object.assign(r,e),r}});function die(e){e.reverse();let t=e[15]&1,r=0;for(let i=0;i<e.length;i++){let n=e[i];e[i]=n>>>1|r,r=(n&1)<<7}return e[0]^=-t&225,e}var Ga,e8,jo,lie,hie,s1,Ns,pie,A6,Q4,t8,PM,TM=Xr(()=>{v();J4();Ga=16,e8=new Uint8Array(16),jo=vt(e8),lie=225,hie=(e,t,r,i)=>{let n=i&1;return{s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^lie<<24&-(n&1)}},s1=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255|0,Ns=e=>ut(s1(e));pie=e=>e>64*1024?8:e>1024?4:2,A6=class{constructor(t,r){Z(this,"blockLen",Ga);Z(this,"outputLen",Ga);Z(this,"s0",0);Z(this,"s1",0);Z(this,"s2",0);Z(this,"s3",0);Z(this,"finished",!1);Z(this,"destroyed",!1);Z(this,"t");Z(this,"W");Z(this,"windowSize");st(t,16,"key"),t=tr(t);let i=ml(t),n=i.getUint32(0,!1),o=i.getUint32(4,!1),a=i.getUint32(8,!1),s=i.getUint32(12,!1),u=[];for(let P=0;P<128;P++)u.push({s0:s1(n),s1:s1(o),s2:s1(a),s3:s1(s)}),{s0:n,s1:o,s2:a,s3:s}=hie(n,o,a,s);let c=pie(r||1024);if(![1,2,4,8].includes(c))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=c;let m=128/c,w=this.windowSize=2**c,E=[];for(let P=0;P<m;P++)for(let M=0;M<w;M++){let D=0,L=0,U=0,K=0;for(let N=0;N<c;N++){if(!(M>>>c-N-1&1))continue;let{s0:F,s1:H,s2:z,s3:G}=u[c*P+N];D^=F,L^=H,U^=z,K^=G}E.push({s0:D,s1:L,s2:U,s3:K})}this.t=E}_updateBlock(t,r,i,n){t^=this.s0,r^=this.s1,i^=this.s2,n^=this.s3;let{W:o,t:a,windowSize:s}=this,u=0,c=0,l=0,m=0,w=(1<<o)-1,E=0;for(let P of[t,r,i,n])for(let M=0;M<4;M++){let D=P>>>8*M&255;for(let L=8/o-1;L>=0;L--){let U=D>>>o*L&w,{s0:K,s1:N,s2:C,s3:F}=a[E*s+U];u^=K,c^=N,l^=C,m^=F,E+=1}}this.s0=u,this.s1=c,this.s2=l,this.s3=m}update(t){r1(this),st(t),t=tr(t);let r=vt(t),i=Math.floor(t.length/Ga),n=t.length%Ga;for(let o=0;o<i;o++)this._updateBlock(ut(r[o*4+0]),ut(r[o*4+1]),ut(r[o*4+2]),ut(r[o*4+3]));return n&&(e8.set(t.subarray(i*Ga)),this._updateBlock(ut(jo[0]),ut(jo[1]),ut(jo[2]),ut(jo[3])),Rt(jo)),this}destroy(){this.destroyed=!0;let{t}=this;for(let r of t)r.s0=0,r.s1=0,r.s2=0,r.s3=0}digestInto(t){r1(this),i1(t,this,!0),this.finished=!0;let{s0:r,s1:i,s2:n,s3:o}=this,a=vt(t);a[0]=r,a[1]=i,a[2]=n,a[3]=o,_t(a)}digest(){let t=new Uint8Array(Ga);return this.digestInto(t),this.destroy(),t}},Q4=class extends A6{constructor(t,r){st(t);let i=die(tr(t));super(i,r),Rt(i)}update(t){r1(this),st(t),t=tr(t);let r=vt(t),i=t.length%Ga,n=Math.floor(t.length/Ga);for(let o=0;o<n;o++)this._updateBlock(Ns(r[o*4+3]),Ns(r[o*4+2]),Ns(r[o*4+1]),Ns(r[o*4+0]));return i&&(e8.set(t.subarray(n*Ga)),this._updateBlock(Ns(jo[3]),Ns(jo[2]),Ns(jo[1]),Ns(jo[0])),Rt(jo)),this}digestInto(t){r1(this),i1(t,this,!0),this.finished=!0;let r=t.subarray(0,this.outputLen),{s0:i,s1:n,s2:o,s3:a}=this,s=vt(r);s[0]=i,s[1]=n,s[2]=o,s[3]=a,_t(s),r.reverse()}},t8=a1(16,(e,t)=>new A6(e,t),e=>[e.length]),PM=a1(16,(e,t)=>new Q4(e,t),e=>[e.length])});var c8={};Q1(c8,{__TESTS:()=>Bie,aeskw:()=>Oie,aeskwp:()=>Iie,aessiv:()=>kie,cbc:()=>wie,cfb:()=>Sie,cmac:()=>f1,ctr:()=>wl,ecb:()=>_ie,gcm:()=>xie,gcmsiv:()=>Eie,rngAesCtrDrbg128:()=>Aie,rngAesCtrDrbg256:()=>Pie,siv:()=>Tie,unsafe:()=>Rie});function T6(e){if(![16,24,32].includes(e.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+e.length)}function u8(e){return e<<1^vie&-(e>>7)}function yl(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(t&1),e=u8(e);return r}function BM(e,t){if(e.length!==256)throw new Error("Wrong sbox length");let r=new Uint32Array(256).map((c,l)=>t(e[l])),i=r.map(r8),n=i.map(r8),o=n.map(r8),a=new Uint32Array(256*256),s=new Uint32Array(256*256),u=new Uint16Array(256*256);for(let c=0;c<256;c++)for(let l=0;l<256;l++){let m=c*256+l;a[m]=r[c]^i[l],s[m]=n[c]^o[l],u[m]=e[c]<<8|e[l]}return{sbox:e,sbox2:u,T0:r,T1:i,T2:n,T3:o,T01:a,T23:s}}function io(e){st(e);let t=e.length;T6(e);let{sbox2:r}=f8,i=[];(!Sn||!Yr(e))&&i.push(e=tr(e));let n=_t(vt(e)),o=n.length,a=u=>zo(r,u,u,u,u),s=new Uint32Array(t+28);s.set(n);for(let u=o;u<s.length;u++){let c=s[u-1];u%o===0?c=a(yie(c))^bie[u/o-1]:o>6&&u%o===4&&(c=a(c)),s[u]=s[u-o]^c}return Rt(...i),s}function k6(e){let t=io(e),r=t.slice(),i=t.length,{sbox2:n}=f8,{T0:o,T1:a,T2:s,T3:u}=MM;for(let c=0;c<i;c+=4)for(let l=0;l<4;l++)r[c+l]=t[i-c-4+l];Rt(t);for(let c=4;c<i-4;c++){let l=r[c],m=zo(n,l,l,l,l);r[c]=o[m&255]^a[m>>>8&255]^s[m>>>16&255]^u[m>>>24]}return r}function Cs(e,t,r,i,n,o){return e[r<<8&65280|i>>>8&255]^t[n>>>8&65280|o>>>24&255]}function zo(e,t,r,i,n){return e[t&255|r&65280]|e[i>>>16&255|n>>>16&65280]<<16}function Si(e,t,r,i,n){let{sbox2:o,T01:a,T23:s}=f8,u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];let c=e.length/4-2;for(let P=0;P<c;P++){let M=e[u++]^Cs(a,s,t,r,i,n),D=e[u++]^Cs(a,s,r,i,n,t),L=e[u++]^Cs(a,s,i,n,t,r),U=e[u++]^Cs(a,s,n,t,r,i);t=M,r=D,i=L,n=U}let l=e[u++]^zo(o,t,r,i,n),m=e[u++]^zo(o,r,i,n,t),w=e[u++]^zo(o,i,n,t,r),E=e[u++]^zo(o,n,t,r,i);return{s0:l,s1:m,s2:w,s3:E}}function d1(e,t,r,i,n){let{sbox2:o,T01:a,T23:s}=MM,u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];let c=e.length/4-2;for(let P=0;P<c;P++){let M=e[u++]^Cs(a,s,t,n,i,r),D=e[u++]^Cs(a,s,r,t,n,i),L=e[u++]^Cs(a,s,i,r,t,n),U=e[u++]^Cs(a,s,n,i,r,t);t=M,r=D,i=L,n=U}let l=e[u++]^zo(o,t,n,i,r),m=e[u++]^zo(o,r,t,n,i),w=e[u++]^zo(o,i,r,t,n),E=e[u++]^zo(o,n,i,r,t);return{s0:l,s1:m,s2:w,s3:E}}function NM(e,t,r,i){st(t,At,"nonce"),st(r);let n=r.length;i=Sf(n,i),n1(r,i);let o=t,a=vt(o),s=vt(r),u=vt(i),{s0:c,s1:l,s2:m,s3:w}=Si(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));for(let P=0;P+4<=s.length;P+=4)u[P+0]=s[P+0]^ut(c),u[P+1]=s[P+1]^ut(l),u[P+2]=s[P+2]^ut(m),u[P+3]=s[P+3]^ut(w),c1(o,!1,1),{s0:c,s1:l,s2:m,s3:w}=Si(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));let E=At*Math.floor(s.length/s8);if(E<n){let P=new Uint32Array([c,l,m,w]);_t(P);let M=I6(P);for(let D=E,L=0;D<n;D++,L++)i[D]=r[D]^M[L];Rt(P)}return i}function bl(e,t,r,i,n){st(r,At,"nonce"),st(i),n=Sf(i.length,n);let o=r,a=vt(o),s=ml(o),u=vt(i),c=vt(n),l=t?0:12,m=i.length,w=s.getUint32(l,t),{s0:E,s1:P,s2:M,s3:D}=Si(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));for(let U=0;U+4<=u.length;U+=4)c[U+0]=u[U+0]^ut(E),c[U+1]=u[U+1]^ut(P),c[U+2]=u[U+2]^ut(M),c[U+3]=u[U+3]^ut(D),w=w+1>>>0,s.setUint32(l,w,t),{s0:E,s1:P,s2:M,s3:D}=Si(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));let L=At*Math.floor(u.length/s8);if(L<m){let U=new Uint32Array([E,P,M,D]);_t(U);let K=I6(U);for(let N=L,C=0;N<m;N++,C++)n[N]=i[N]^K[C];Rt(U)}return n}function CM(e){if(st(e),e.length%At!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size "+At)}function DM(e,t,r){st(e);let i=e.length,n=i%At;if(!t&&n!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");if(t){let s=At-n;s||(s=At),i=i+s}r=Sf(i,r),n1(e,r),(!Sn||!Yr(e))&&(e=tr(e));let o=vt(e);_t(o);let a=vt(r);return{b:o,o:a,out:r}}function LM(e,t){if(!t)return e;let r=e.length;if(r===0)throw new Error("aes/pkcs7: empty ciphertext not allowed");let i=e[r-1],n=1;n&=i-1>>>31^1,n&=16-i>>>31^1;for(let o=0;o<16;o++){let a=o-i>>>31,s=(e[r-1-o]^i)===0?1:0;n&=s|a^1}if(!n)throw new Error("aes/pkcs7: wrong padding");return e.subarray(0,r-i)}function qM(e){let t=new Uint8Array(16),r=vt(t);t.set(e);let i=At-e.length;for(let n=At-i;n<At;n++)t[n]=i;return r}function UM(e,t,r,i,n){let o=n?n.length:0,a=e.create(r,i.length+o);n&&a.update(n);let s=AM(8*i.length,8*o,t);a.update(i),a.update(s);let u=a.digest();return Rt(s),u}function FM(e){return e instanceof Uint32Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint32Array"}function l1(e,t){if(st(t,16,"block"),!FM(e))throw new Error("_encryptBlock accepts result of expandKeyLE");let r=vt(t);_t(r);let{s0:i,s1:n,s2:o,s3:a}=Si(e,r[0],r[1],r[2],r[3]);return r[0]=i,r[1]=n,r[2]=o,r[3]=a,_t(r),t}function HM(e,t){if(st(t,16,"block"),!FM(e))throw new Error("_decryptBlock accepts result of expandKeyLE");let r=vt(t);_t(r);let{s0:i,s1:n,s2:o,s3:a}=d1(e,r[0],r[1],r[2],r[3]);return r[0]=i,r[1]=n,r[2]=o,r[3]=a,_t(r),t}function h1(e){let t=0;for(let r=At-1;r>=0;r--){let i=(e[r]&128)>>>7;e[r]=e[r]<<1|t,t=i}return t&&(e[At-1]^=135),e}function xf(e,t){if(e.length!==t.length)throw new Error("xorBlock: blocks must have same length");for(let r=0;r<e.length;r++)e[r]=e[r]^t[r];return e}function zM(e,t){if(t.length>e.length)throw new Error("xorend: len(B) must be less than or equal to len(A)");let r=e.length-t.length;for(let i=0;i<t.length;i++)e[r+i]=e[r+i]^t[i];return e}function a8(e,t){T6(e);let r=t.length;if(r>127)throw new Error("s2v: number of input strings must be less than or equal to 127");if(r===0)return f1(gie,e);let i=f1(u1,e);for(let s=0;s<r-1;s++){h1(i);let u=f1(t[s],e);xf(i,u),Rt(u)}let n=t[r-1];st(n);let o;if(n.byteLength>=At)o=zM(Uint8Array.from(n),i);else{let s=new Uint8Array(At);s.set(n),s[n.length]=128,o=xf(h1(i),s),Rt(s)}let a=f1(o,e);return Rt(i,o),a}var At,s8,u1,gie,vie,c1,i8,mie,yie,r8,f8,MM,bie,wl,_ie,wie,Sie,xie,_l,Eie,P6,kM,Oie,RM,Iie,n8,jM,Aie,Pie,o8,f1,Tie,kie,Rie,Bie,l8=Xr(()=>{v();TM();J4();At=16,s8=4,u1=new Uint8Array(At),gie=Uint8Array.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]),vie=283;c1=(e,t,r=1)=>{if(!Number.isSafeInteger(r)||r>4294967040)throw new Error("incBytes: wrong carry "+r);st(e);for(let i=0;i<e.length;i++){let n=t?i:e.length-1-i;r=r+(e[n]&255)|0,e[n]=r&255,r>>>=8}},i8=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=u8(i))e[r]=i;let t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=(i^i>>4^i>>5^i>>6^i>>7^99)&255}return Rt(e),t})(),mie=i8.map((e,t)=>i8.indexOf(t)),yie=e=>e<<24|e>>>8,r8=e=>e<<8|e>>>24;f8=BM(i8,e=>yl(e,3)<<24|e<<16|e<<8|yl(e,2)),MM=BM(mie,e=>yl(e,11)<<24|yl(e,13)<<16|yl(e,9)<<8|yl(e,14)),bie=(()=>{let e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=u8(r))e[t]=r;return e})();wl=Ho({blockSize:16,nonceLength:16},function(t,r){function i(n,o){if(st(n),o!==void 0&&(st(o),!Yr(o)))throw new Error("unaligned destination");let a=io(t),s=tr(r),u=[a,s];Yr(n)||u.push(n=tr(n));let c=NM(a,s,n,o);return Rt(...u),c}return{encrypt:(n,o)=>i(n,o),decrypt:(n,o)=>i(n,o)}});_ie=Ho({blockSize:16},function(t,r={}){let i=!r.disablePadding;return{encrypt(n,o){let{b:a,o:s,out:u}=DM(n,i,o),c=io(t),l=0;for(;l+4<=a.length;){let{s0:m,s1:w,s2:E,s3:P}=Si(c,a[l+0],a[l+1],a[l+2],a[l+3]);s[l++]=m,s[l++]=w,s[l++]=E,s[l++]=P}if(i){let m=qM(n.subarray(l*4));_t(m);let{s0:w,s1:E,s2:P,s3:M}=Si(c,m[0],m[1],m[2],m[3]);s[l++]=w,s[l++]=E,s[l++]=P,s[l++]=M}return _t(s),Rt(c),u},decrypt(n,o){CM(n);let a=k6(t);o=Sf(n.length,o);let s=[a];n1(n,o),(!Sn||!Yr(n))&&s.push(n=tr(n));let u=vt(n),c=vt(o);_t(u);for(let l=0;l+4<=u.length;){let{s0:m,s1:w,s2:E,s3:P}=d1(a,u[l+0],u[l+1],u[l+2],u[l+3]);c[l++]=m,c[l++]=w,c[l++]=E,c[l++]=P}return _t(c),Rt(...s),LM(o,i)}}}),wie=Ho({blockSize:16,nonceLength:16},function(t,r,i={}){let n=!i.disablePadding;return{encrypt(o,a){let s=io(t),{b:u,o:c,out:l}=DM(o,n,a),m=r,w=[s];(!Sn||!Yr(m))&&w.push(m=tr(m));let E=vt(m);_t(E);let P=E[0],M=E[1],D=E[2],L=E[3],U=0;for(;U+4<=u.length;)P^=u[U+0],M^=u[U+1],D^=u[U+2],L^=u[U+3],{s0:P,s1:M,s2:D,s3:L}=Si(s,P,M,D,L),c[U++]=P,c[U++]=M,c[U++]=D,c[U++]=L;if(n){let K=qM(o.subarray(U*4));_t(K),P^=K[0],M^=K[1],D^=K[2],L^=K[3],{s0:P,s1:M,s2:D,s3:L}=Si(s,P,M,D,L),c[U++]=P,c[U++]=M,c[U++]=D,c[U++]=L}return _t(c),Rt(...w),l},decrypt(o,a){CM(o);let s=k6(t),u=r,c=[s];(!Sn||!Yr(u))&&c.push(u=tr(u));let l=vt(u);_t(l),a=Sf(o.length,a),n1(o,a),(!Sn||!Yr(o))&&c.push(o=tr(o));let m=vt(o),w=vt(a);_t(m);let E=l[0],P=l[1],M=l[2],D=l[3];for(let L=0;L+4<=m.length;){let U=E,K=P,N=M,C=D;E=m[L+0],P=m[L+1],M=m[L+2],D=m[L+3];let{s0:F,s1:H,s2:z,s3:G}=d1(s,E,P,M,D);w[L++]=F^U,w[L++]=H^K,w[L++]=z^N,w[L++]=G^C}return _t(w),Rt(...c),LM(a,n)}}}),Sie=Ho({blockSize:16,nonceLength:16},function(t,r){function i(n,o,a){st(n);let s=n.length;if(a=Sf(s,a),$4(n,a))throw new Error("overlapping src and dst not supported.");let u=io(t),c=r,l=[u];(!Sn||!Yr(c))&&l.push(c=tr(c)),(!Sn||!Yr(n))&&l.push(n=tr(n));let m=vt(n),w=vt(a),E=o?w:m,P=vt(c);_t(m),_t(P);let M=P[0],D=P[1],L=P[2],U=P[3];for(let N=0;N+4<=m.length;){let{s0:C,s1:F,s2:H,s3:z}=Si(u,M,D,L,U);w[N+0]=m[N+0]^C,w[N+1]=m[N+1]^F,w[N+2]=m[N+2]^H,w[N+3]=m[N+3]^z,M=E[N++],D=E[N++],L=E[N++],U=E[N++]}let K=At*Math.floor(m.length/s8);if(K<s){({s0:M,s1:D,s2:L,s3:U}=Si(u,M,D,L,U));let N=new Uint32Array([M,D,L,U]);_t(N);let C=I6(N);for(let F=K,H=0;F<s;F++,H++)a[F]=n[F]^C[H];Rt(C)}return _t(w),Rt(...l),a}return{encrypt:(n,o)=>i(n,!0,o),decrypt:(n,o)=>i(n,!1,o)}});xie=Ho({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,r,i){if(r.length<8)throw new Error("aes/gcm: invalid nonce length");let n=16;function o(s,u,c){let l=UM(t8,!1,s,c,i);for(let m=0;m<u.length;m++)l[m]^=u[m];return l}function a(){let s=io(t),u=u1.slice(),c=u1.slice();if(bl(s,!1,c,c,u),r.length===12)c.set(r);else{let m=u1.slice();ml(m).setBigUint64(8,BigInt(r.length*8),!1);let E=t8.create(u).update(r).update(m);E.digestInto(c),E.destroy()}let l=bl(s,!1,c,u1);return{xk:s,authKey:u,counter:c,tagMask:l}}return{encrypt(s){let{xk:u,authKey:c,counter:l,tagMask:m}=a(),w=new Uint8Array(s.length+n),E=[u,c,l,m];Yr(s)||E.push(s=tr(s)),bl(u,!1,l,s,w.subarray(0,s.length));let P=o(c,m,w.subarray(0,w.length-n));return E.push(P),w.set(P,s.length),Rt(...E),w},decrypt(s){let{xk:u,authKey:c,counter:l,tagMask:m}=a(),w=[u,c,m,l];Yr(s)||w.push(s=tr(s));let E=s.subarray(0,-n),P=s.subarray(-n),M=o(c,m,E);if(w.push(M),!o1(M,P))throw Rt(...w),new Error("aes/gcm: invalid ghash tag");let D=bl(u,!1,l,E);return Rt(...w),D}}}),_l=(e,t,r)=>i=>{if(!Number.isSafeInteger(i)||t>i||i>r){let n="["+t+".."+r+"]";throw new Error(""+e+": expected value in range "+n+", got "+i)}},Eie=Ho({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,r,i){let o=_l("AAD",0,68719476736),a=_l("plaintext",0,2**36),s=_l("nonce",12,12),u=_l("ciphertext",16,2**36+16);st(t),T6(t),s(r.length),i!==void 0&&o(i.length);function c(){let w=io(t),E=new Uint8Array(t.length),P=new Uint8Array(16),M=[w,E],D=r;(!Sn||!Yr(D))&&M.push(D=tr(D));let L=vt(D);_t(L);let U=0,K=L[0],N=L[1],C=L[2],F=0;for(let z of[P,E].map(vt)){let G=vt(z);for(let B=0;B<G.length;B+=2){let{s0:g,s1:O}=Si(w,U,K,N,C);G[B+0]=g,G[B+1]=O,U=++F}_t(G)}let H={authKey:P,encKey:io(E)};return Rt(...M),H}function l(w,E,P){let M=UM(PM,!0,E,P,i);for(let C=0;C<12;C++)M[C]^=r[C];M[15]&=127;let D=vt(M);_t(D);let L=D[0],U=D[1],K=D[2],N=D[3];return{s0:L,s1:U,s2:K,s3:N}=Si(w,L,U,K,N),D[0]=L,D[1]=U,D[2]=K,D[3]=N,_t(D),M}function m(w,E,P){let M=tr(E);M[15]|=128;let D=bl(w,!0,M,P);return Rt(M),D}return{encrypt(w){a(w.length);let{encKey:E,authKey:P}=c(),M=l(E,P,w),D=[E,P,M];Yr(w)||D.push(w=tr(w));let L=new Uint8Array(w.length+16);return L.set(M,w.length),L.set(m(E,M,w)),Rt(...D),L},decrypt(w){u(w.length);let E=w.subarray(-16),{encKey:P,authKey:M}=c(),D=[P,M];Yr(w)||D.push(w=tr(w));let L=m(P,E,w.subarray(0,-16)),U=l(P,M,L);if(D.push(U),!o1(E,U))throw Rt(...D),new Error("invalid polyval tag");return Rt(...D),L}}});P6={encrypt(e,t){if(t.length>=2**32)throw new Error("plaintext should be less than 4gb");let r=io(e);if(t.length===16)l1(r,t);else{let i=vt(t);_t(i);let n=i[0],o=i[1];for(let a=0,s=1;a<6;a++)for(let u=2;u<i.length;u+=2,s++){let{s0:c,s1:l,s2:m,s3:w}=Si(r,n,o,i[u],i[u+1]);n=c,o=l^wf(s),i[u]=m,i[u+1]=w}i[0]=n,i[1]=o,_t(i)}r.fill(0)},decrypt(e,t){if(t.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");let r=k6(e),i=t.length/8-1;if(i===1)HM(r,t);else{let n=vt(t);_t(n);let o=n[0],a=n[1];for(let s=0,u=i*6;s<6;s++)for(let c=i*2;c>=1;c-=2,u--){a^=wf(u);let{s0:l,s1:m,s2:w,s3:E}=d1(r,o,a,n[c],n[c+1]);o=l,a=m,n[c]=w,n[c+1]=E}n[0]=o,n[1]=a,_t(n)}r.fill(0)}},kM=new Uint8Array(8).fill(166),Oie=Ho({blockSize:8},e=>({encrypt(t){if(!t.length||t.length%8!==0)throw new Error("invalid plaintext length");if(t.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");let r=X4(kM,t);return P6.encrypt(e,r),r},decrypt(t){if(t.length%8!==0||t.length<24)throw new Error("invalid ciphertext length");let r=tr(t);if(P6.decrypt(e,r),!o1(r.subarray(0,8),kM))throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8)}})),RM=2790873510,Iie=Ho({blockSize:8},e=>({encrypt(t){if(!t.length)throw new Error("invalid plaintext length");let r=Math.ceil(t.length/8)*8,i=new Uint8Array(8+r);i.set(t,8);let n=vt(i);return n[0]=ut(RM),n[1]=ut(wf(t.length)),P6.encrypt(e,i),i},decrypt(t){if(t.length<16)throw new Error("invalid ciphertext length");let r=tr(t),i=vt(r);P6.decrypt(e,r);let n=wf(ut(i[1]))>>>0,o=Math.ceil(n/8)*8;if(ut(i[0])!==RM||r.length-8!==o)throw new Error("integrity check failed");for(let a=n;a<o;a++)if(r[8+a]!==0)throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8,8+n)}})),n8=class{constructor(t,r,i){Z(this,"blockLen");Z(this,"key");Z(this,"nonce");Z(this,"state");Z(this,"reseedCnt");this.blockLen=wl.blockSize;let n=t/8,o=16;this.state=new Uint8Array(n+o),this.key=this.state.subarray(0,n),this.nonce=this.state.subarray(n,n+o),this.reseedCnt=1,c1(this.nonce,!1,1),this.addEntropy(r,i)}update(t){if(wl(this.key,this.nonce).encrypt(new Uint8Array(this.state.length),this.state),t){st(t);for(let r=0;r<t.length;r++)this.state[r]^=t[r]}c1(this.nonce,!1,1)}addEntropy(t,r){st(t,this.state.length,"seed");let i=t.slice();if(r){if(st(r),r.length>i.length)throw new Error("info length is too big");for(let n=0;n<r.length;n++)i[n]^=r[n]}this.update(i),i.fill(0),this.reseedCnt=1}randomBytes(t,r){if(O6(t),t>2**16)throw new Error("requested output is too big");if(this.reseedCnt>2**48)throw new Error("entropy exhausted");if(r){if(st(r),r.length>this.state.length)throw new Error("info length is too big");this.update(r)}let i=new Uint8Array(t);return wl(this.key,this.nonce).encrypt(i,i),c1(this.nonce,!1,Math.ceil(t/this.blockLen)),this.update(r),this.reseedCnt++,i}clean(){this.state.fill(0),this.reseedCnt=0}},jM=e=>(t,r=void 0)=>new n8(e,t,r),Aie=jM(128),Pie=jM(256);o8=class{constructor(t){Z(this,"blockLen",At);Z(this,"outputLen",At);Z(this,"buffer");Z(this,"pos");Z(this,"finished");Z(this,"destroyed");Z(this,"k1");Z(this,"k2");Z(this,"x");Z(this,"xk");st(t),T6(t),this.xk=io(t),this.buffer=new Uint8Array(At),this.pos=0,this.finished=!1,this.destroyed=!1,this.x=new Uint8Array(At);let r=new Uint8Array(At);l1(this.xk,r),this.k1=h1(r),this.k2=h1(new Uint8Array(this.k1))}process(t){xf(this.x,t),l1(this.xk,this.x)}update(t){if(this.destroyed)throw new Error("Hash instance has been destroyed");if(this.finished)throw new Error("Hash#digest() has already been called");st(t);let r=0;if(this.pos){let i=Math.min(At-this.pos,t.length);this.buffer.set(t.subarray(0,i),this.pos),this.pos+=i,r=i,this.pos===At&&r<t.length&&(this.process(this.buffer),this.pos=0)}for(;r+At<t.length;)this.process(t.subarray(r,r+At)),r+=At;return r<t.length&&(this.buffer.set(t.subarray(r),0),this.pos=t.length-r),this}digestInto(t){if(this.destroyed)throw new Error("Hash instance has been destroyed");if(this.finished)throw new Error("Hash#digest() has already been called");i1(t,this,!0),this.finished=!0;let r=t.subarray(0,this.outputLen),i=new Uint8Array(At);this.pos===At?(i.set(this.buffer),xf(i,this.k1)):(i.set(this.buffer.subarray(0,this.pos)),i[this.pos]=128,xf(i,this.k2)),r.set(this.x),xf(r,i),l1(this.xk,r),Rt(i)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}destroy(){let{buffer:t,destroyed:r,x:i,xk:n,k1:o,k2:a}=this;r||(this.destroyed=!0,Rt(t,i,n,o,a))}},f1=a1(16,e=>new o8(e));Tie=()=>{throw new Error('"siv" from v1 is now "gcmsiv"')},kie=Ho({blockSize:16,tagLength:16},function(t,...r){let i=_l("plaintext",0,5444517870735016e24),n=_l("ciphertext",16,2**132+16);if(r.length>126)throw new Error('"AAD" number of elements must be less than or equal to 126');if(r.forEach(s=>st(s)),st(t),![32,48,64].includes(t.length))throw new Error('"aes key" expected Uint8Array of length 32/48/64, got length='+t.length);let o=t.subarray(0,t.length/2),a=t.subarray(t.length/2);return{encrypt(s){i(s.length);let u=a8(o,[...r,s]),c=Uint8Array.from(u);c[8]&=127,c[12]&=127;let l=wl(a,c).encrypt(s);return X4(u,l)},decrypt(s){n(s.length);let u=s.subarray(0,At),c=s.subarray(At),l=Uint8Array.from(u);l[8]&=127,l[12]&=127;let m=wl(a,l).decrypt(c),w=a8(o,[...r,m]);if(o1(w,u))return m;throw new Error("invalid siv tag")}}}),Rie=Object.freeze({expandKeyLE:io,expandKeyDecLE:k6,encrypt:Si,decrypt:d1,encryptBlock:l1,decryptBlock:HM,ctrCounter:NM,ctr32:bl,dbl:h1,xorBlock:xf,xorend:zM,s2v:a8}),Bie=Object.freeze({incBytes:c1})});var ZM=k((rge,GM)=>{"use strict";v();var{secp256k1:KM}=(g0(),lo(p0)),{sha512:Mie,sha256:Nie}=(fp(),lo(Xm)),{hmac:Cie}=(_p(),lo(dy)),{cbc:VM}=(l8(),lo(c8)),d8=Te(),Die=d8.PublicKey,Ds=d8.util.preconditions,Lie=d8.crypto.Random;function p1(e){return h.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function h8(e,t){return p1(Cie(Nie,e,t))}function qie(e,t){if(e.length!==t.length)return!1;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return r===0}var R6=function(){};R6.encrypt=function(e,t,r){Ds.checkArgument(e),Ds.checkArgument(t),Ds.checkArgument(r),r=r||Lie.getRandomBuffer(128/8);var i=VM(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e));return h.Buffer.concat([h.Buffer.from(r),p1(i)])};R6.decrypt=function(e,t){Ds.checkArgument(e),Ds.checkArgument(t);var r=e.slice(0,128/8),i=e.slice(128/8),n=VM(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(i));return p1(n)};var Sl=function e(t){if(!(this instanceof e))return new e(t);this.opts=t||{}};Sl.prototype.privateKey=function(e){return Ds.checkArgument(e,"no private key provided"),this._privateKey=e||null,this};Sl.prototype.publicKey=function(e){return Ds.checkArgument(e,"no public key provided"),this._publicKey=e||null,this};var B6=function(e,t){var r="_"+e;Object.defineProperty(Sl.prototype,e,{configurable:!1,enumerable:!0,get:function(){var i=this[r];return i||(i=this[r]=t.apply(this)),i}})};B6("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return p1(KM.getPublicKey(Uint8Array.from(e),!0))});B6("kEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=KM.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0),i=r.slice(1);return p1(Mie(i))});B6("kE",function(){return this.kEkM.slice(0,32)});B6("kM",function(){return this.kEkM.slice(32,64)});Sl.prototype.encrypt=function(e,t){h.Buffer.isBuffer(e)||(e=h.Buffer.from(e)),t===void 0&&(t=h8(this._privateKey.toBuffer(),e).slice(0,16));var r=R6.encrypt(e,this.kE,t),i=h8(this.kM,r);return this.opts.shortTag&&(i=i.slice(0,4)),this.opts.noKey?h.Buffer.concat([r,i]):h.Buffer.concat([this.Rbuf,r,i])};Sl.prototype.decrypt=function(e){Ds.checkArgument(e);var t=0,r=this.opts.shortTag?4:32;if(!this.opts.noKey){var i;switch(e[0]){case 4:i=e.slice(0,65);break;case 3:case 2:i=e.slice(0,33);break;default:throw new Error("Invalid type: "+e[0])}this._publicKey=Die.fromDER(i),t+=i.length}var n=e.slice(t,e.length-r),o=e.slice(e.length-r,e.length),a=h8(this.kM,n);if(this.opts.shortTag&&(a=a.slice(0,4)),!qie(o,a))throw new Error("Invalid checksum");return R6.decrypt(n,this.kE)};GM.exports=Sl});var YM=k((nge,WM)=>{"use strict";v();var Uie={name:"ECIES",message:"Internal Error on bsv-ecies Module {0}",errors:[{name:"DecryptionError",message:"Invalid Message: {0}"},{name:"UnsupportAlgorithm",message:"Unsupport Algorithm: {0}"}]};WM.exports=Te().errors.extend(Uie)});var tN=k((age,eN)=>{"use strict";v();var N6=Te(),p8=N6.PublicKey,$M=N6.PrivateKey,zi=N6.util.preconditions,Fie=ZM(),M6=YM(),{secp256k1:XM}=(g0(),lo(p0)),{sha512:Hie,sha256:jie}=(fp(),lo(Xm)),{hmac:zie}=(_p(),lo(dy)),{cbc:JM}=(l8(),lo(c8));function g1(e){return h.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function QM(e,t){return g1(zie(jie,t,e))}var C6=function(){};C6.encrypt=function(e,t,r){return zi.checkArgument(e),zi.checkArgument(t),zi.checkArgument(r),zi.checkArgument(t.length===16,"keybuf length must be 16"),zi.checkArgument(r.length===16,"ivbuf length must be 16"),g1(JM(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e)))};C6.decrypt=function(e,t,r){return zi.checkArgument(e),zi.checkArgument(t),zi.checkArgument(r),zi.checkArgument(t.length===16,"keybuf length must be 16"),zi.checkArgument(r.length===16,"ivbuf length must be 16"),g1(JM(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(e)))};var Ef=function e(t,r="BIE1"){if(r!=="BIE1")throw new M6.UnsupportAlgorithm(r);if(!(this instanceof e))return new e(t,r);this._privateKey=new N6.PrivateKey,this.opts=t||{},this.opts.ephemeralKey=!0};Ef.prototype.privateKey=function(e){return zi.checkArgument($M.isValid(e),"no private key provided"),this._privateKey=$M(e.toHex())||null,this.opts.ephemeralKey=!1,this};Ef.prototype.publicKey=function(e){return zi.checkArgument(p8.isValid(e),"no public key provided"),this._publicKey=p8(e.toString())||null,this._publicKey!=null&&(this.opts.fixedPublicKey=!0),this};var v1=function(e,t){var r="_"+e;Object.defineProperty(Ef.prototype,e,{configurable:!1,enumerable:!0,get:function(){var i=this[r];return i=this[r]=t.apply(this),i}})};v1("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return g1(XM.getPublicKey(Uint8Array.from(e),!0))});v1("ivkEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=XM.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0);return g1(Hie(r))});v1("iv",function(){return this.ivkEkM.slice(0,16)});v1("kE",function(){return this.ivkEkM.slice(16,32)});v1("kM",function(){return this.ivkEkM.slice(32,64)});Ef.prototype.encrypt=function(e){h.Buffer.isBuffer(e)||(e=h.Buffer.from(e));var t=C6.encrypt(e,this.kE,this.iv),r,i=h.Buffer.from("BIE1");this.opts.noKey&&!this.opts.ephemeralKey?r=h.Buffer.concat([i,t]):r=h.Buffer.concat([i,this.Rbuf,t]);var n=QM(r,this.kM);return this.opts.shortTag&&(n=n.slice(0,4)),h.Buffer.concat([r,n])};Ef.prototype.decrypt=function(e){zi.checkArgument(h.Buffer.isBuffer(e),"ciphetext must be a buffer");var t=this.opts.shortTag?4:32,r=4,i=e.slice(0,4);if(!i.equals(h.Buffer.from("BIE1")))throw new M6.DecryptionError("Invalid Magic");if(!this.opts.noKey){var n=e.slice(4,37);this.opts.fixedPublicKey?console.log('Notice: Overriding PublicKey in message. Consider use "noKey" option if you are not sending message to electrum and do not want to use ephemeral key'):this._publicKey=p8.fromDER(n),r=37}var o=e.slice(r,e.length-t),a=e.slice(e.length-t,e.length),s=QM(e.slice(0,e.length-t),this.kM);if(this.opts.shortTag&&(s=s.slice(0,4)),a.length!==s.length)throw new M6.DecryptionError("Invalid checksum");for(var u=0,c=0;c<s.length;c++)u|=a[c]^s[c];if(u!==0)throw new M6.DecryptionError("Invalid checksum");return C6.decrypt(o,this.kE,this.iv)};Ef.bitcoreECIES=Fie;eN.exports=Ef});var iN=k((uge,rN)=>{v();rN.exports=tN()});var D6=k((cge,oN)=>{"use strict";v();function Ko(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function nN(e,t){for(var r="",i=0,n=-1,o=0,a,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===47)break;a=47}if(a===47){if(!(n===s-1||o===1))if(n!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){u===-1?(r="",i=0):(r=r.slice(0,u),i=r.length-1-r.lastIndexOf("/")),n=s,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=s,o=0;continue}}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(n+1,s):r=e.slice(n+1,s),i=s-n-1;n=s,o=0}else a===46&&o!==-1?++o:o=-1}return r}function Kie(e,t){var r=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+i:r+e+i:i}var xl={resolve:function(){for(var t="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=A.default.cwd()),o=i),Ko(o),o.length!==0&&(t=o+"/"+t,r=o.charCodeAt(0)===47)}return t=nN(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(Ko(t),t.length===0)return".";var r=t.charCodeAt(0)===47,i=t.charCodeAt(t.length-1)===47;return t=nN(t,!r),t.length===0&&!r&&(t="."),t.length>0&&i&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return Ko(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];Ko(i),i.length>0&&(t===void 0?t=i:t+="/"+i)}return t===void 0?".":xl.normalize(t)},relative:function(t,r){if(Ko(t),Ko(r),t===r||(t=xl.resolve(t),r=xl.resolve(r),t===r))return"";for(var i=1;i<t.length&&t.charCodeAt(i)===47;++i);for(var n=t.length,o=n-i,a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var s=r.length,u=s-a,c=o<u?o:u,l=-1,m=0;m<=c;++m){if(m===c){if(u>c){if(r.charCodeAt(a+m)===47)return r.slice(a+m+1);if(m===0)return r.slice(a+m)}else o>c&&(t.charCodeAt(i+m)===47?l=m:m===0&&(l=0));break}var w=t.charCodeAt(i+m),E=r.charCodeAt(a+m);if(w!==E)break;w===47&&(l=m)}var P="";for(m=i+l+1;m<=n;++m)(m===n||t.charCodeAt(m)===47)&&(P.length===0?P+="..":P+="/..");return P.length>0?P+r.slice(a+l):(a+=l,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(Ko(t),t.length===0)return".";for(var r=t.charCodeAt(0),i=r===47,n=-1,o=!0,a=t.length-1;a>=1;--a)if(r=t.charCodeAt(a),r===47){if(!o){n=a;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":t.slice(0,n)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Ko(t);var i=0,n=-1,o=!0,a;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,u=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!o){i=a+1;break}}else u===-1&&(o=!1,u=a+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(n=a):(s=-1,n=u))}return i===n?n=u:n===-1&&(n=t.length),t.slice(i,n)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!o){i=a+1;break}}else n===-1&&(o=!1,n=a+1);return n===-1?"":t.slice(i,n)}},extname:function(t){Ko(t);for(var r=-1,i=0,n=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(u===47){if(!o){i=s+1;break}continue}n===-1&&(o=!1,n=s+1),u===46?r===-1?r=s:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||n===-1||a===0||a===1&&r===n-1&&r===i+1?"":t.slice(r,n)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Kie("/",t)},parse:function(t){Ko(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var i=t.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var a=-1,s=0,u=-1,c=!0,l=t.length-1,m=0;l>=o;--l){if(i=t.charCodeAt(l),i===47){if(!c){s=l+1;break}continue}u===-1&&(c=!1,u=l+1),i===46?a===-1?a=l:m!==1&&(m=1):a!==-1&&(m=-1)}return a===-1||u===-1||m===0||m===1&&a===u-1&&a===s+1?u!==-1&&(s===0&&n?r.base=r.name=t.slice(1,u):r.base=r.name=t.slice(s,u)):(s===0&&n?(r.name=t.slice(1,a),r.base=t.slice(1,u)):(r.name=t.slice(s,a),r.base=t.slice(s,u)),r.ext=t.slice(a,u)),s>0?r.dir=t.slice(0,s-1):n&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};xl.posix=xl;oN.exports=xl});var uN=k((hge,sN)=>{"use strict";v();var Yt=Te(),aN=D6(),Za;try{Za=fs()}catch{Za=null}var Vie=function(){var e=typeof A.default<"u"&&A.default.env&&A.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)};function Mi(e,t){if(!(this instanceof Mi))return new Mi(e,t);this.privateKey=e,this.publicKey=e.publicKey,this.address=e.toAddress(),t=t||{},this.storageDir=t.storageDir||(typeof A.default<"u"?aN.join(A.default.cwd(),".bsv-covenants"):".bsv-covenants"),this.covenantUtxoPath=aN.join(this.storageDir,"covenant_utxos.json"),this.sighashType=Yt.crypto.Signature.SIGHASH_ALL|Yt.crypto.Signature.SIGHASH_FORKID,this.allowNonEnforcing=t.allowNonEnforcing===!0,Za&&this._ensureStorageDir()}Mi.prototype.createFromP2PKH=function(e){if(!this.allowNonEnforcing)throw new Error("SmartContract.Covenant builds a NON-ENFORCING script that reduces to plain P2PK \u2014 it does not constrain the spend. Use SmartContract.PushTx.valueCovenant (output binding) or SmartContract.Token / perpetualCovenant (stateful covenants) for real covenants. To use this demo anyway, construct with { allowNonEnforcing: true }.");e.script||(e.script=Mi.reconstructP2pkhScript(this.address));var t=new Yt.Transaction().from({txId:e.txid,outputIndex:e.vout,script:e.script,satoshis:e.satoshis}).to(this.address,e.satoshis-1e3),r=Yt.Script.fromHex(e.script),i=Yt.Transaction.sighash.sighashPreimage(t,this.sighashType,0,r,new Yt.crypto.BN(e.satoshis)),n=Yt.crypto.Hash.sha256sha256(i),o=new Yt.Script().add("OP_DUP").add("OP_HASH256").add(n).add("OP_EQUALVERIFY").add("OP_DROP").add(this.publicKey.toBuffer()).add("OP_CHECKSIG");t.outputs[0].setScript(o),t.sign(this.privateKey);var a={txid:t.id,vout:0,satoshis:e.satoshis-1e3,script:o.toHex(),scriptPubKey:o.toHex(),preimageHash:n.toString("hex"),originalPreimage:i.toString("hex"),status:"local",createdAt:new Date().toISOString(),type:"preimage_covenant"};return{transaction:t,covenantUtxo:a}};Mi.prototype.createSpendingTx=function(e,t,r){var i=t||this.address,n=r||e.satoshis-500,o=new Yt.Transaction;o.addInput(new Yt.Transaction.Input({prevTxId:e.txid,outputIndex:e.vout,script:Yt.Script.empty()}),Yt.Script.fromHex(e.script),e.satoshis),o.to(i,n);var a=Yt.Script.fromHex(e.script),s=Yt.Transaction.sighash.sign(o,this.privateKey,this.sighashType,0,a,new Yt.crypto.BN(e.satoshis)),u=h.Buffer.concat([s.toDER(),h.Buffer.from([this.sighashType])]),c=h.Buffer.from(e.originalPreimage,"hex"),l=new Yt.Script().add(u).add(c);return o.inputs[0].setScript(l),o};Mi.prototype.validate=function(e,t){var r=new Yt.Script.Interpreter,i=Yt.Script.Interpreter.SCRIPT_VERIFY_P2SH|Yt.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|Yt.Script.Interpreter.SCRIPT_VERIFY_DERSIG|Yt.Script.Interpreter.SCRIPT_VERIFY_LOW_S|Yt.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,n=e.inputs[0].script,o=Yt.Script.fromHex(t.script),a=r.verify(n,o,e,0,i,new Yt.crypto.BN(t.satoshis));return{valid:a,error:a?null:r.errstr}};Mi.prototype.save=function(e){if(!Za)return Vie("File system operations not available in browser environment"),e;var t=this.list();return t.push(e),Za.writeFileSync(this.covenantUtxoPath,JSON.stringify(t,null,2)),e};Mi.prototype.load=function(e){var t=this.list();if(e){var r=t.find(function(i){return i.txid===e});if(!r)throw new Error("Covenant UTXO with TXID "+e+" not found");return r}else{var r=t.find(function(n){return n.type==="preimage_covenant"});if(!r)throw new Error("No preimage covenant UTXO found");return r}};Mi.prototype.list=function(){return Za.existsSync(this.covenantUtxoPath)?JSON.parse(Za.readFileSync(this.covenantUtxoPath,"utf8")):[]};Mi.prototype.getPortfolio=function(){var e=this.list(),t={total:e.length,totalValue:e.reduce(function(r,i){return r+i.satoshis},0),byStatus:{},recent:e.slice(-5)};return e.forEach(function(r){var i=r.status||"local";t.byStatus[i]||(t.byStatus[i]={count:0,value:0}),t.byStatus[i].count++,t.byStatus[i].value+=r.satoshis}),t};Mi.prototype.completeFlow=function(e,t){var r=this.createFromP2PKH(e),i=this.save(r.covenantUtxo);t&&t(r.transaction,"creation");var n=this.createSpendingTx(i),o=this.validate(n,i);return t&&o.valid&&t(n,"spending"),{creationTx:r.transaction,spendingTx:n,covenantUtxo:i,validation:o,success:o.valid}};Mi.prototype._ensureStorageDir=function(){Za.existsSync(this.storageDir)||Za.mkdirSync(this.storageDir,{recursive:!0})};Mi.reconstructP2pkhScript=function(e){return Yt.Script.buildPublicKeyHashOut(e).toHex()};sN.exports=Mi});var Vo=k((gge,fN)=>{"use strict";v();var El=Te(),pge=_r();function Oe(e,t){if(!(this instanceof Oe))return new Oe(e,t);this.preimage=h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"hex"),this.options=t||{},this.strategy=this.options.strategy||"DYNAMIC",this.fields=null,this.sighashInfo=null,this.options.deferExtraction||this._extractFields()}Oe.LEFT_FIXED_LENGTH=104;Oe.RIGHT_FIXED_LENGTH=52;Oe.MIN_PREIMAGE_LENGTH=Oe.LEFT_FIXED_LENGTH+1+Oe.RIGHT_FIXED_LENGTH;Oe.prototype.extract=function(e){return this.strategy=e||this.strategy,this._extractFields(),this.fields};Oe.prototype.getSighashInfo=function(){return this.fields||this._extractFields(),this.sighashInfo};Oe.prototype.getField=function(e){return this.fields||this._extractFields(),this.fields[e]};Oe.prototype.extractField=function(e,t){t=t||{},this.fields||this._extractFields();var r=this._parsePreimageStructure(),i=this._generateBidirectionalASM(e,r,t.includeComments),n=this._extractSpecificField(e,r),o=this._interpretField(e,n,r);return{field:e,value:n?n.toString("hex"):null,buffer:n,asm:i,interpretation:o,strategy:this._getExtractionStrategy(e),structure:r._structure}};Oe.prototype.generateASM=function(e,t){var r=this._parsePreimageStructure();return this._generateBidirectionalASM(e,r,t)};Oe.prototype.extractFields=function(e){var t={};return e.forEach(function(r){t[r]=this.extractField(r)}.bind(this)),t};Oe.prototype.validate=function(){var e=[],t=[];if(this.preimage.length<Oe.MIN_PREIMAGE_LENGTH)return e.push("Preimage too short: "+this.preimage.length+" bytes (BIP-143 preimage requires at least "+Oe.MIN_PREIMAGE_LENGTH+")"),{valid:!1,errors:e,warnings:t,sighashInfo:this.sighashInfo};this.fields||this._extractFields();var r=["version","hashPrevouts","hashSequence","outpoint","scriptCode","amount","sequence","hashOutputs","locktime","sighash"];return r.forEach(function(i){this.fields[i]||e.push("Missing required field: "+i)}.bind(this)),this.sighashInfo.hasZeroHashes&&t.push("Zero hashes detected - check SIGHASH flags: "+this.sighashInfo.zeroFields.join(", ")),{valid:e.length===0,errors:e,warnings:t,sighashInfo:this.sighashInfo}};Oe.prototype.toObject=function(){return this.fields||this._extractFields(),{preimage:this.preimage.toString("hex"),length:this.preimage.length,strategy:this.strategy,fields:{version:this.fields.version?this.fields.version.toString("hex"):null,hashPrevouts:this.fields.hashPrevouts?this.fields.hashPrevouts.toString("hex"):null,hashSequence:this.fields.hashSequence?this.fields.hashSequence.toString("hex"):null,outpoint:this.fields.outpoint?this.fields.outpoint.toString("hex"):null,scriptCode:this.fields.scriptCode?this.fields.scriptCode.toString("hex"):null,scriptCodeLength:this.fields.scriptCodeLength,amount:this.fields.amount?this.fields.amount.toString("hex"):null,sequence:this.fields.sequence?this.fields.sequence.toString("hex"):null,hashOutputs:this.fields.hashOutputs?this.fields.hashOutputs.toString("hex"):null,locktime:this.fields.locktime?this.fields.locktime.toString("hex"):null,sighash:this.fields.sighash?this.fields.sighash.toString("hex"):null},sighashInfo:this.sighashInfo,validation:this.validate()}};Oe.prototype._extractFields=function(){if(this.fields={},this.sighashInfo={flag:null,hasZeroHashes:!1,zeroFields:[],warnings:[]},this.preimage.length<Oe.MIN_PREIMAGE_LENGTH)throw new Error("Preimage too short: "+this.preimage.length+" bytes (BIP-143 preimage requires at least "+Oe.MIN_PREIMAGE_LENGTH+")");try{this.strategy==="LEFT"||this.strategy==="DYNAMIC"?this._extractFromLeft():this.strategy==="RIGHT"&&this._extractFromRight(),this._analyzeSighash()}catch(e){if(this.strategy==="DYNAMIC")try{this.strategy="RIGHT",this._extractFromRight(),this._analyzeSighash()}catch{throw new Error("Failed to extract preimage fields with any strategy: "+e.message)}else throw e}};Oe.prototype._extractFromLeft=function(){var e=0;this.fields.version=this.preimage.slice(e,e+4),e+=4,this.fields.hashPrevouts=this.preimage.slice(e,e+32),e+=32,this.fields.hashSequence=this.preimage.slice(e,e+32),e+=32,this.fields.outpoint=this.preimage.slice(e,e+36),e+=36;var t=Oe.decodeCompactSize(this.preimage,e);this.fields.scriptCodeLength=t.value,e=t.nextOffset,this.fields.scriptCode=this.preimage.slice(e,e+this.fields.scriptCodeLength),e+=this.fields.scriptCodeLength,this.fields.amount=this.preimage.slice(e,e+8),e+=8,this.fields.sequence=this.preimage.slice(e,e+4),e+=4,this.fields.hashOutputs=this.preimage.slice(e,e+32),e+=32,this.fields.locktime=this.preimage.slice(e,e+4),e+=4,this.fields.sighash=this.preimage.slice(e,e+4)};Oe.prototype._extractFromRight=function(){var e=this.preimage.length,t=e;t-=4,this.fields.sighash=this.preimage.slice(t,t+4),t-=4,this.fields.locktime=this.preimage.slice(t,t+4),t-=32,this.fields.hashOutputs=this.preimage.slice(t,t+32),t-=4,this.fields.sequence=this.preimage.slice(t,t+4),t-=8,this.fields.amount=this.preimage.slice(t,t+8);var r=104,i=Oe.decodeCompactSize(this.preimage,r);this.fields.scriptCodeLength=i.value,this.fields.scriptCode=this.preimage.slice(i.nextOffset,i.nextOffset+this.fields.scriptCodeLength),this.fields.version=this.preimage.slice(0,4),this.fields.hashPrevouts=this.preimage.slice(4,36),this.fields.hashSequence=this.preimage.slice(36,68),this.fields.outpoint=this.preimage.slice(68,104)};Oe.prototype._analyzeSighash=function(){if(this.fields.sighash){var e=this.fields.sighash.readUInt32LE(0);this.sighashInfo.flag=e;var t=e&31,r=(e&128)!==0,i=(e&64)!==0,n=h.Buffer.alloc(32);r&&this.fields.hashPrevouts.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashPrevouts"),this.sighashInfo.warnings.push("ANYONECANPAY flag detected - hashPrevouts is zero")),t===2&&this.fields.hashSequence.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashSequence"),this.sighashInfo.warnings.push("SIGHASH_NONE flag detected - hashSequence is zero")),(t===2||t===3)&&this.fields.hashOutputs.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashOutputs"),this.sighashInfo.warnings.push("SIGHASH_NONE/SINGLE flag detected - hashOutputs is zero"));var o=[];t===1?o.push("ALL"):t===2?o.push("NONE"):t===3&&o.push("SINGLE"),r&&o.push("ANYONECANPAY"),i&&o.push("FORKID"),this.sighashInfo.flagName=o.join(" | ")}};Oe.prototype._parsePreimageStructure=function(){for(var e=this.preimage,t=0,r={},i=[{name:"nVersion",len:4},{name:"hashPrevouts",len:32},{name:"hashSequence",len:32},{name:"outpoint_txid",len:32},{name:"outpoint_vout",len:4}],n=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],o=0;o<i.length;o++){var a=i[o];r[a.name]=e.slice(t,t+a.len).toString("hex"),t+=a.len}var s=Oe.decodeCompactSize(e,t);r.scriptLen=s.value,r.scriptLenSize=s.bytes,r.scriptLenRaw=e.slice(t,t+s.bytes).toString("hex"),t+=s.bytes,r.scriptCode=e.slice(t,t+r.scriptLen).toString("hex"),t+=r.scriptLen;for(var u=0;u<n.length;u++){var c=n[u];r[c.name]=e.slice(t,t+c.len).toString("hex"),t+=c.len}var l=i.reduce(function(w,E){return w+E.len},0),m=n.reduce(function(w,E){return w+E.len},0);return r._structure={leftFixed:l,scriptLenVarint:s.bytes,scriptCode:r.scriptLen,rightFixed:m,totalCalculated:l+s.bytes+r.scriptLen+m,totalActual:e.length},r};Oe.prototype._generateBidirectionalASM=function(e,t,r){var i=["value","nSequence","hashOutputs","nLocktime","sighashType"],n=["nVersion","hashPrevouts","hashSequence","outpoint_txid","outpoint_vout"];if(i.includes(e))return this._generateRightExtractionASM(e,r);if(n.includes(e))return this._generateLeftExtractionASM(e,r);if(e==="scriptCode")return this._generateDynamicExtractionASM(t,r);if(e==="scriptLen")return this._generateScriptLenExtractionASM(t,r);throw new Error("Unknown field: "+e)};Oe.prototype._generateRightExtractionASM=function(e,t){for(var r=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],i=0,n=0,o=!1,a=0;a<r.length;a++){var s=r[a];if(s.name===e){n=s.len,o=!0;break}i+=s.len}if(!o)throw new Error("Field not found in RIGHT fields: "+e);var u=52,c=u-i,l=[];return t?(l.push("# \u{1F504} Extract "+e+" from RIGHT side (bidirectional strategy)"),l.push("OP_SIZE # Push preimage size: [preimage, size]")):l.push("OP_SIZE"),t?l=l.concat([c+" OP_SUB # Calculate split point: [preimage, split_point]","OP_SPLIT # Split: [left_part, right_part]","OP_NIP # Drop left (OP_SPLIT leaves right on top): [right_part]",n+" OP_SPLIT # Extract field: ["+e+", remaining]","OP_DROP # Clean up: ["+e+"]","# \u2705 Result: "+e+" is now on top of stack"]):l=l.concat([c+" OP_SUB","OP_SPLIT","OP_NIP",n+" OP_SPLIT","OP_DROP"]),l.join(`
|
|
77
77
|
`)};Oe.prototype._generateLeftExtractionASM=function(e,t){var r=[{name:"nVersion",len:4,offset:0},{name:"hashPrevouts",len:32,offset:4},{name:"hashSequence",len:32,offset:36},{name:"outpoint_txid",len:32,offset:68},{name:"outpoint_vout",len:4,offset:100}],i=r.find(function(o){return o.name===e});if(!i)throw new Error("Field not found in LEFT fields: "+e);var n=[];return t?n=["# \u{1F504} Extract "+e+" from LEFT side (bidirectional strategy)",i.offset+" OP_SPLIT # Skip to field: [prefix, remainder]","OP_NIP # Drop prefix (OP_SPLIT leaves remainder on top): [remainder]",i.len+" OP_SPLIT # Extract field: ["+e+", suffix]","OP_DROP # Clean up: ["+e+"]","# \u2705 Result: "+e+" is now on top of stack"]:n=[i.offset+" OP_SPLIT","OP_NIP",i.len+" OP_SPLIT","OP_DROP"],n.join(`
|
|
78
78
|
`)};Oe.prototype._generateDynamicExtractionASM=function(e,t){var r=104+e.scriptLenSize;return["# \u{1F3AF} Extract scriptCode DYNAMICALLY with CompactSize varint support",r+" OP_SPLIT # Skip left zone + scriptLen varint: [left_zone, remainder]","OP_NIP # Drop left (OP_SPLIT leaves remainder on top): [remainder]",e.scriptLen+" OP_SPLIT # Extract scriptCode: [scriptCode, right_zone]","OP_DROP # Clean up: [scriptCode]","# \u2705 Result: scriptCode extracted with "+e.scriptLenSize+"-byte varint awareness"].join(`
|
|
@@ -95,7 +95,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
95
95
|
[${a+1}/${n.length}] Step (${u})`);try{if(typeof i.step=="function")i.step();else{console.log("\u26A0\uFE0F Step-by-step execution not supported in this BSV version"),console.log("\u{1F4A1} Consider using runFullEvaluation instead");break}console.log(`\u{1F9E9} Executed: ${u}`),k8(i.stack,i.altstack)}catch(c){console.log(`\u26A0\uFE0F Error executing ${u}: ${c.message}`);break}}o&&o.close(),console.log(`
|
|
96
96
|
===========================================`),console.log("\u2705 Final Stack State:"),k8(i.stack||[],i.altstack||[]),console.log("===========================================")}function CN(e,t,r){console.log("==========================================="),console.log("\u{1F50D} SCRIPT INTERPRETER DEBUGGER (FULL RUN)"),console.log(`===========================================
|
|
97
97
|
`);let i=new Lr.Script.Interpreter,n=new Lr.crypto.BN(1e5),o=i.verify(e,t,r,0,Lr.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,n);console.log("\u{1F510} Locking Script:",t.toASM()),console.log("\u{1F513} Unlocking Script:",e.toASM()),console.log("-------------------------------------------"),console.log("\u2705 Result:",o?"TRUE (Success)":"\u274C FALSE (Failure)"),console.log("Final Stack:",i.stack.map(a=>a.toString("hex"))),console.log("AltStack:",i.altstack.map(a=>a.toString("hex"))),console.log("===========================================")}async function DN(){if(typeof A.default>"u"||!A.default.argv){console.log("\u2699\uFE0F CLI mode not available in browser environment");return}let e=A.default.argv.slice(2),t=w=>{let E=e.indexOf(w);return E!==-1&&e[E+1]?e[E+1]:null},r=t("--unlocking"),i=t("--locking"),n=t("--combined"),o=e.includes("--step"),a=e.includes("--truth"),s,u,c;if(n)c=q6(n);else{s=q6(r),u=q6(i);let w=h.Buffer.concat([s.toBuffer(),u.toBuffer()]);c=Lr.Script.fromBuffer(w)}let l=new Lr.Transaction,m=new Lr.Transaction.Input({prevTxId:"0".repeat(64),outputIndex:0,script:Lr.Script.empty(),satoshis:1e5,output:new Lr.Transaction.Output({satoshis:1e5,script:Lr.Script.empty()})});l.addInput(m),l.addOutput(new Lr.Transaction.Output({satoshis:1e5,script:Lr.Script.empty()})),o?await NN(c,l,!0):a?CN(s||Lr.Script.empty(),u||Lr.Script.empty(),l):console.log("\u2699\uFE0F No mode specified. Use --step or --truth")}R8.exports={parseScript:q6,printStack:k8,stepThroughScript:NN,runFullEvaluation:CN,main:DN};typeof Fr<"u"&&Fr.main===R8&&DN()});var Go=k((Gge,HN)=>{"use strict";v();var vi=Te(),F6=fr(),fne=cr(),qN=Vr(),B8=qN.SIGHASH_ALL|qN.SIGHASH_FORKID;function UN(){var e=vi.Script.Interpreter;return e.SCRIPT_VERIFY_P2SH|e.SCRIPT_VERIFY_STRICTENC|e.SCRIPT_VERIFY_DERSIG|e.SCRIPT_VERIFY_LOW_S|e.SCRIPT_VERIFY_MINIMALDATA|e.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|e.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY|e.SCRIPT_ENABLE_SIGHASH_FORKID|e.SCRIPT_ENABLE_MAGNETIC_OPCODES|e.SCRIPT_ENABLE_MONOLITH_OPCODES}function cne(e){return vi.Script.Interpreter.useGenesisLimits(e)}function lne(e,t,r){r=r||{};var i=new vi.Script.Interpreter,n=i.verify(e,t,r.tx||new vi.Transaction,r.inputIndex||0,r.flags||UN(),new F6(r.satoshis||0));return{ok:n,err:i.errstr||""}}function FN(e,t,r,i,n){return vi.Transaction.sighash.sighashPreimage(e,n||B8,t,r,new F6(i))}function hne(e,t,r,i,n){return fne.sha256sha256(FN(e,t,r,i,n))}function dne(e,t,r,i,n,o){o=o||B8;var a=vi.Transaction.sighash.sign(e,t,o,r,i,new F6(n));return h.Buffer.concat([a.toDER(),h.Buffer.from([o])])}function pne(e,t,r){r=r||{};var i=new vi.Transaction().addOutput(new vi.Transaction.Output({script:e,satoshis:t})),n=new vi.Transaction;return n.addInput(new vi.Transaction.Input({prevTxId:i.hash,outputIndex:0,script:vi.Script.empty()}),e,t),r.outputs&&r.outputs.forEach(function(o){n.addOutput(o)}),{funding:i,spend:n}}function gne(e,t){var r=e.toAddress?e.toAddress():e;return new vi.Transaction.Output({script:vi.Script.buildPublicKeyHashOut(r),satoshis:t})}function vne(e){return e===0?vi.Opcode.OP_0:e===-1?vi.Opcode.OP_1NEGATE:e>=1&&e<=16?vi.Opcode["OP_"+e]:new F6(e).toScriptNumBuffer()}HN.exports={SIGHASH:B8,flags:UN,enableGenesis:cne,verify:lne,rawPreimage:FN,sighashDigest:hne,signInput:dne,fundAndSpend:pne,p2pkhOutput:gne,scriptNum:vne}});var ZN=k((Wge,GN)=>{"use strict";v();var jN=Te(),zN=cr(),KN=Go(),ao=jN.Script,Ar=jN.Opcode,b1=KN.signInput,VN=KN.scriptNum;function mne(e){var t=zN.sha256(e),r=new ao().add(Ar.OP_SHA256).add(t).add(Ar.OP_EQUAL);return{lock:r,meta:{name:"hash-lock",digest:t.toString("hex")},unlock:function(i,n,o){return new ao().add(o||e)}}}function yne(e){var t=e.toPublicKey(),r=ao.buildPublicKeyHashOut(t.toAddress());return{lock:r,meta:{name:"p2pkh",address:t.toAddress().toString()},unlock:function(i,n){return new ao().add(b1(i,e,0,r,n)).add(t.toBuffer())}}}function bne(e,t){var r=e.toPublicKey(),i=new ao().add(VN(t)).add(Ar.OP_CHECKLOCKTIMEVERIFY).add(Ar.OP_DROP).add(r.toBuffer()).add(Ar.OP_CHECKSIG);return{lock:i,meta:{name:"cltv-timelock",locktime:t},unlock:function(n,o){return new ao().add(b1(n,e,0,i,o))}}}function _ne(e,t){var r=t.map(function(n){return n.toPublicKey()}),i=new ao().add(Ar["OP_"+e]);return r.forEach(function(n){i.add(n.toBuffer())}),i.add(Ar["OP_"+r.length]).add(Ar.OP_CHECKMULTISIG),{lock:i,meta:{name:e+"-of-"+r.length+"-multisig"},unlock:function(n,o,a){a=a||t.slice(0,e);var s=new ao().add(Ar.OP_0);return a.forEach(function(u){s.add(b1(n,u,0,i,o))}),s}}}function wne(e){var t=zN.sha256(e.secret),r=new ao().add(Ar.OP_IF).add(Ar.OP_SHA256).add(t).add(Ar.OP_EQUALVERIFY).add(e.receiver.toPublicKey().toBuffer()).add(Ar.OP_CHECKSIG).add(Ar.OP_ELSE).add(VN(e.timeout)).add(Ar.OP_CHECKLOCKTIMEVERIFY).add(Ar.OP_DROP).add(e.sender.toPublicKey().toBuffer()).add(Ar.OP_CHECKSIG).add(Ar.OP_ENDIF);return{lock:r,meta:{name:"htlc",digest:t.toString("hex"),timeout:e.timeout},unlockClaim:function(i,n){return new ao().add(b1(i,e.receiver,0,r,n)).add(e.secret).add(Ar.OP_1)},unlockRefund:function(i,n){return new ao().add(b1(i,e.sender,0,r,n)).add(Ar.OP_0)}}}GN.exports={hashLock:mne,p2pkh:yne,timeLockCLTV:bne,multisig:_ne,htlc:wne}});var Tl=k(($ge,tC)=>{"use strict";v();var N8=Te(),H6=fr(),WN=cr(),C8=Go(),YN=N8.Script,Nt=N8.Opcode,D8=C8.SIGHASH,j6=C8.scriptNum,Pl=h.Buffer.from("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","hex"),L8=new H6("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16),Sne=h.Buffer.concat([h.Buffer.from([2]),Pl]),$N=h.Buffer.from(Pl).reverse(),XN=h.Buffer.concat([h.Buffer.from(L8.toBuffer()).reverse(),h.Buffer.from([0])]),xne=h.Buffer.concat([h.Buffer.from([48,68,2,32]),Pl,h.Buffer.from([2,32])]);function M8(e,t){var r;for(r=0;r<t-1;r++)e.add(Nt.OP_1).add(Nt.OP_SPLIT);for(r=0;r<t-1;r++)e.add(Nt.OP_SWAP).add(Nt.OP_CAT);return e}var Zo=N8.crypto.Signature,Ene=Zo.SIGHASH_ALL|Zo.SIGHASH_FORKID,One=Zo.SIGHASH_SINGLE|Zo.SIGHASH_FORKID,Ine=Zo.SIGHASH_SINGLE|Zo.SIGHASH_ANYONECANPAY|Zo.SIGHASH_FORKID,Ane=Zo.SIGHASH_ALL|Zo.SIGHASH_ANYONECANPAY|Zo.SIGHASH_FORKID;function q8(e,t){var r=t&&t.sighashType||D8;return e.add(Nt.OP_HASH256),M8(e,32),e.add($N).add(Nt.OP_ADD),e.add(XN).add(Nt.OP_MOD),e.add(j6(32)).add(Nt.OP_NUM2BIN),M8(e,32),e.add(Pl).add(Nt.OP_DUP),e.add(Nt.OP_2).add(Nt.OP_SWAP).add(Nt.OP_CAT),e.add(Nt.OP_TOALTSTACK),e.add(h.Buffer.from([48,68,2,32])).add(Nt.OP_SWAP).add(Nt.OP_CAT),e.add(h.Buffer.from([2,32])).add(Nt.OP_CAT),e.add(Nt.OP_SWAP).add(Nt.OP_CAT),e.add(h.Buffer.from([r])).add(Nt.OP_CAT),e.add(Nt.OP_FROMALTSTACK).add(Nt.OP_CHECKSIG),e}function Pne(){return q8(new YN)}function JN(e){return e.add(j6(40)).add(Nt.OP_RIGHT).add(j6(32)).add(Nt.OP_LEFT),e}function Tne(e){return QN(e,D8)}function QN(e,t){var r=h.Buffer.from([t&255,0,0,0]);return e.add(Nt.OP_DUP).add(j6(4)).add(Nt.OP_RIGHT).add(r).add(Nt.OP_EQUALVERIFY),e}function kne(e){var t=h.Buffer.concat(e.map(function(r){return r.toBufferWriter().toBuffer()}));return WN.sha256sha256(t)}function Rne(e){var t=new YN().add(Nt.OP_DUP);return q8(t),t.add(Nt.OP_VERIFY),JN(t),t.add(h.Buffer.from(e)).add(Nt.OP_EQUAL),t}var Bne=new H6("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex");function eC(e){var t=WN.sha256sha256(e);if(t[0]<1||t[0]>127)return null;var r=new H6(t).add(new H6(Pl)).mod(L8);if(r.gt(Bne))return null;var i=r.toBuffer("be",32);return i[0]>=1?i:null}function Mne(e,t,r,i,n){typeof n=="number"&&(n={maxTries:n}),n=n||{};var o=n.maxTries||5e3,a=n.start||0,s=n.field||"nLockTime",u=n.sighashType||D8;if(s!=="nLockTime"&&s!=="sequence")throw new Error("grind field must be 'nLockTime' or 'sequence'");for(var c=e.inputs[t],l=0;l<o;l++){var m=a+l;s==="nLockTime"?e.nLockTime=m:c.sequenceNumber=4294967294-m;var w=C8.rawPreimage(e,t,r,i,u);if(eC(w))return{preimage:w,tries:l+1,field:s,nonce:m}}throw new Error("OP_PUSH_TX grind failed after "+o+" tries")}tC.exports={Gx:Pl,N:L8,PUBKEY:Sne,gxLe:$N,N_LE:XN,DER_PREFIX:xne,reverseBytes:M8,pushTxCore:q8,authenticator:Pne,extractHashOutputs:JN,assertSighashAll:Tne,assertSighashType:QN,SIGHASH_ALL_FORKID:Ene,SIGHASH_SINGLE_FORKID:One,SIGHASH_SINGLE_ANYONECANPAY_FORKID:Ine,SIGHASH_ALL_ANYONECANPAY_FORKID:Ane,hashOutputs:kne,valueCovenant:Rne,sFromPreimage:eC,grind:Mne}});var F8=k((Jge,iC)=>{"use strict";v();var rC=Te(),U8=Tl(),Nne=Go(),Cne=rC.Script,Pr=rC.Opcode,kl=Nne.scriptNum;function Dne(e){var t=new Cne;return t.add(Pr.OP_DUP),U8.pushTxCore(t),t.add(Pr.OP_VERIFY),U8.assertSighashAll(t),t.add(Pr.OP_DUP),t.add(kl(104)).add(Pr.OP_SPLIT).add(Pr.OP_NIP),t.add(Pr.OP_SIZE).add(kl(52)).add(Pr.OP_SUB).add(Pr.OP_SPLIT).add(Pr.OP_DROP),t.add(Pr.OP_OVER),t.add(kl(52)).add(Pr.OP_RIGHT).add(kl(8)).add(Pr.OP_LEFT),t.add(Pr.OP_BIN2NUM).add(kl(e)).add(Pr.OP_SUB),t.add(kl(8)).add(Pr.OP_NUM2BIN),t.add(Pr.OP_SWAP).add(Pr.OP_CAT),t.add(Pr.OP_HASH256),t.add(Pr.OP_SWAP),U8.extractHashOutputs(t),t.add(Pr.OP_EQUAL),t}iC.exports={pelsCovenant:Dne}});var z8=k((eve,oC)=>{"use strict";v();var K6=Te(),nC=cr(),j8=Go(),$t=K6.Opcode,Rl=j8.scriptNum;function z6(e){return e instanceof K6.PrivateKey?e.toPublicKey().toBuffer():e instanceof K6.PublicKey?e.toBuffer():e}function Lne(){return{name:"single-key",commit:function(e){return nC.sha256ripemd160(z6(e))},emit:function(e){return e.add($t.OP_OVER).add($t.OP_HASH160).add($t.OP_EQUALVERIFY),e.add($t.OP_CHECKSIGVERIFY),e},unlockArgs:function(e,t,r,i,n){var o=j8.signInput(e,n,t,r,i);return[o,n.toPublicKey().toBuffer()]}}}function H8(e,t){var r=t.length;if(e<1||e>r||r<1||r>16)throw new Error("multisig requires 1 <= m <= n <= 16");var i=new K6.Script().add($t["OP_"+e]);return t.forEach(function(n){i.add(h.Buffer.from(n))}),i.add($t["OP_"+r]).add($t.OP_CHECKMULTISIG),i.toBuffer()}function qne(e,t){if(e<1||e>t||t<1||t>16)throw new Error("multisig requires 1 <= m <= n <= 16");return{name:e+"-of-"+t+"-multisig",m:e,n:t,commit:function(r){if(r.length!==t)throw new Error("expected "+t+" public keys");return nC.sha256ripemd160(H8(e,r.map(z6)))},emit:function(r){r.add($t.OP_OVER).add($t.OP_HASH160).add($t.OP_EQUALVERIFY),r.add(Rl(1)).add($t.OP_SPLIT).add($t.OP_NIP),r.add($t.OP_SIZE).add(Rl(2)).add($t.OP_SUB).add($t.OP_SPLIT).add($t.OP_DROP);for(var i=0;i<this.n;i++)r.add(Rl(34)).add($t.OP_SPLIT),r.add($t.OP_SWAP).add(Rl(1)).add($t.OP_SPLIT).add($t.OP_NIP),r.add($t.OP_TOALTSTACK);for(r.add($t.OP_DROP),r.add(Rl(this.m)),i=0;i<this.n;i++)r.add($t.OP_FROMALTSTACK);return r.add(Rl(this.n)),r.add($t.OP_CHECKMULTISIGVERIFY),r},unlockArgs:function(r,i,n,o,a){var s=a.keys;if(s.length!==t)throw new Error("expected "+t+" public keys in signer.keys");var u=H8(e,s.map(z6)),c=s.map(z6).map(function(w){return w.toString("hex")}),l=a.signWith.map(function(w){var E=c.indexOf(w.toPublicKey().toBuffer().toString("hex"));if(E<0)throw new Error("signWith key is not in the committed key set");return{idx:E,priv:w}}).sort(function(w,E){return E.idx-w.idx}).slice(0,e);if(l.length<e)throw new Error("need at least "+e+" signing keys");var m=l.map(function(w){return j8.signInput(r,w.priv,i,n,o)});return[$t.OP_0].concat(m).concat([u])}}}function Une(e){if(!e||typeof e.emit!="function"||typeof e.unlockArgs!="function"||typeof e.commit!="function")throw new Error("predicate authorizer needs { commit, emit, unlockArgs } functions");return{name:e.name||"predicate",commit:e.commit,emit:e.emit,unlockArgs:e.unlockArgs}}oC.exports={singleKey:Lne,multisig:qne,predicate:Une,redeemScript:H8}});var G8=k((rve,dC)=>{"use strict";v();var K8=Te(),_1=Tl(),V8=Go(),w1=z8(),V6=K8.Script,Ie=K8.Opcode,Wo=V8.scriptNum;function sC(e,t){var r=h.Buffer.isBuffer(e)?e:t.commit(e);if(r.length!==20)throw new Error("owner commitment must be 20 bytes (HASH160)");return r}function aC(e,t){return t.length?e.add(h.Buffer.from(t)):e.add(Ie.OP_0)}function uC(e,t){return e.add(Ie.OP_DUP),_1.pushTxCore(e),e.add(Ie.OP_VERIFY),_1.assertSighashAll(e),e.add(Ie.OP_DUP).add(Wo(52)).add(Ie.OP_RIGHT).add(Wo(8)).add(Ie.OP_LEFT).add(Ie.OP_TOALTSTACK),e.add(Ie.OP_DUP),_1.extractHashOutputs(e),e.add(Ie.OP_TOALTSTACK),e.add(Wo(104)).add(Ie.OP_SPLIT).add(Ie.OP_NIP).add(Ie.OP_SIZE).add(Wo(52)).add(Ie.OP_SUB).add(Ie.OP_SPLIT).add(Ie.OP_DROP),e.add(Ie.OP_DUP).add(Wo(4)).add(Wo(20)).add(Ie.OP_SUBSTR),e.add(Ie.OP_SWAP).add(Ie.OP_TOALTSTACK),t.emit(e),e.add(Ie.OP_FROMALTSTACK),e}function fC(e){return e.add(Wo(4)).add(Ie.OP_SPLIT).add(Wo(20)).add(Ie.OP_SPLIT).add(Ie.OP_NIP),e.add(Ie.OP_TOALTSTACK),e.add(Ie.OP_SWAP).add(Ie.OP_CAT),e.add(Ie.OP_FROMALTSTACK).add(Ie.OP_CAT),e}function cC(e){var t=e.toBuffer().length;if(t<=252||t>65535)throw new Error("token script length must use a 3-byte varint (253..65535); got "+t);return e}function Fne(e,t,r){r=r||w1.singleKey();var i=new V6;return i.add(sC(t,r)),i.add(Ie.OP_DROP),uC(i,r),fC(i),i.add(Ie.OP_FROMALTSTACK),i.add(Ie.OP_SWAP),i.add(Ie.OP_FROMALTSTACK),i.add(Ie.OP_BIN2NUM).add(Wo(e)).add(Ie.OP_SUB).add(Wo(8)).add(Ie.OP_NUM2BIN),i.add(Ie.OP_SWAP).add(Ie.OP_CAT),i.add(Ie.OP_HASH256),i.add(Ie.OP_EQUAL),cC(i)}function lC(e,t){t=t||w1.singleKey();var r=new V6;return r.add(sC(e,t)),r.add(Ie.OP_DROP),uC(r,t),fC(r),r.add(Ie.OP_CAT),r.add(Ie.OP_SWAP).add(Ie.OP_CAT),r.add(Ie.OP_CAT),r.add(Ie.OP_FROMALTSTACK),r.add(Ie.OP_FROMALTSTACK).add(Ie.OP_DROP),r.add(Ie.OP_SWAP).add(Ie.OP_HASH256).add(Ie.OP_EQUAL),cC(r)}function Hne(e){return w1.singleKey().commit(e)}function jne(e,t,r,i,n,o){o=o||{};var a=o.auth||w1.singleKey(),s=o.inputIndex||0;if(t.length!==20)throw new Error("newOwnerHash must be 20 bytes (HASH160)");if(i<=1&&!o.allowLowValue)throw new Error("unlockTransfer: single-output token sets output = input - fee, which burns a "+i+"-sat UTXO (e.g. a 1-sat ordinal). Use Token.transferOrdinal / ownershipTokenMulti to preserve the satoshi.");_1.grind(r,s,n,i,o.grind);var u=V8.rawPreimage(r,s,n,i),c=a.unlockArgs(r,s,n,i,e),l=new V6().add(h.Buffer.from(t));return c.forEach(function(m){l.add(m)}),l.add(h.Buffer.from(u)),l}function hC(e,t,r,i,n,o,a){a=a||{};var s=a.auth||w1.singleKey(),u=a.inputIndex||0;if(t.length!==20)throw new Error("newOwnerHash must be 20 bytes (HASH160)");if(!o||o.tokenValue==null||o.tokenValue.length!==8)throw new Error("layout.tokenValue must be the 8-byte LE value of the token output");_1.grind(r,u,n,i,a.grind);var c=V8.rawPreimage(r,u,n,i),l=s.unlockArgs(r,u,n,i,e),m=new V6;return aC(m,o.before||h.Buffer.alloc(0)),aC(m,o.after||h.Buffer.alloc(0)),m.add(h.Buffer.from(o.tokenValue)),m.add(h.Buffer.from(t)),l.forEach(function(w){m.add(w)}),m.add(h.Buffer.from(c)),m}function zne(e,t){return lC(e,t)}function Kne(e,t,r,i,n,o){o=o||{},i==null&&(i=1);var a=o.tokenIndex||0,s=r.outputs||[],u=s[a];if(!u)throw new Error("transferOrdinal: spend has no output at tokenIndex "+a);if(u.satoshis!==i)throw new Error("transferOrdinal: token output value ("+u.satoshis+" sat) must equal the ordinal value ("+i+" sat) to avoid burning the inscription");function c(E){return E.toBufferWriter().toBuffer()}var l=h.Buffer.concat(s.slice(0,a).map(c)),m=h.Buffer.concat(s.slice(a+1).map(c)),w=new K8.crypto.BN(i).toBuffer({endian:"little",size:8});return hC(e,t,r,i,n,{before:l,after:m,tokenValue:w},o)}dC.exports={ownershipToken:Fne,ownershipTokenMulti:lC,ordinalLock:zne,ownerId:Hne,unlockTransfer:jne,unlockTransferMulti:hC,transferOrdinal:Kne}});var Q8=k((nve,pC)=>{"use strict";v();var $8=Te(),G6=Tl(),Vne=F8(),Gne=G8(),X8=Go(),W8=$8.Script,xn=$8.Opcode,Y8=$8.Transaction,Z8=X8.scriptNum;function Zne(e,t){return e instanceof Y8.Output?e:e instanceof W8?new Y8.Output({script:e,satoshis:t}):X8.p2pkhOutput(e,t)}function Wne(e,t,r,i,n,o){o=o||5e4;for(var a=0;a<o;a++){e.nLockTime=n+a;var s=X8.rawPreimage(e,t,r,i);if(G6.sFromPreimage(s))return s}throw new Error("covenant grind failed after "+o+" tries")}function $a(){if(!(this instanceof $a))return new $a;this._outputs=[],this._minLockTime=null}$a.prototype.payTo=function(e,t){return this._outputs.push(Zne(e,t)),this};$a.prototype.lockUntil=function(e){return this._minLockTime=e,this};$a.prototype.outputs=function(){return this._outputs.map(function(e){return new Y8.Output(e.toObject())})};$a.prototype.describe=function(){var e=[];return this._outputs.forEach(function(t,r){e.push("output["+r+"] = "+t.satoshis+" sat to "+t.script.toASM().slice(0,24)+"...")}),this._minLockTime!==null&&e.push("nLockTime >= "+this._minLockTime),"spend allowed iff: "+e.join(" AND ")};$a.prototype.compile=function(){if(this._outputs.length===0&&this._minLockTime===null)throw new Error("empty policy: add at least one constraint (payTo / lockUntil)");var e=this,t=new W8().add(xn.OP_DUP);if(G6.pushTxCore(t),t.add(xn.OP_VERIFY),this._outputs.length){var r=G6.hashOutputs(this._outputs);t.add(xn.OP_DUP),G6.extractHashOutputs(t),t.add(h.Buffer.from(r)).add(xn.OP_EQUALVERIFY)}return this._minLockTime!==null&&(t.add(xn.OP_DUP),t.add(Z8(8)).add(xn.OP_RIGHT).add(Z8(4)).add(xn.OP_LEFT),t.add(xn.OP_BIN2NUM).add(Z8(this._minLockTime)).add(xn.OP_GREATERTHANOREQUAL).add(xn.OP_VERIFY)),t.add(xn.OP_DROP).add(xn.OP_1),{lock:t,outputs:e.outputs(),describe:function(){return e.describe()},unlock:function(i,n,o){o=o||0;var a=e._minLockTime===null?0:e._minLockTime;return e._minLockTime!==null&&(i.inputs[o].sequenceNumber=4294967294),new W8().add(Wne(i,o,t,n,a))}}};function J8(){return new $a}J8.perpetual=function(e){return Vne.pelsCovenant(e)};J8.token=function(e,t){return Gne.ownershipToken(e,t)};pC.exports={policy:J8,Policy:$a}});var bC=k((ave,yC)=>{"use strict";v();var Z6=Te(),Yne=Go();function vC(e){if(e===0)return"OP_0";if(e>=1&&e<=75)return"PUSH("+e+")";if(e===76)return"OP_PUSHDATA1";if(e===77)return"OP_PUSHDATA2";if(e===78)return"OP_PUSHDATA4";try{return Z6.Opcode.fromNumber(e).toString()}catch{return"0x"+e.toString(16)}}function gC(e,t){t=t||16;var r=h.Buffer.from(e).toString("hex");return r.length<=t*2?r||"0":r.slice(0,t*2)+"...("+e.length+"B)"}function $ne(e,t,r){r=r||{};var i=new Z6.Script.Interpreter,n=[];i.stepListener=function(a,s,u){n.push({phase:i.script===t?"lock":"unlock",op:vC(a.opcode&&typeof a.opcode.toNumber=="function"?a.opcode.toNumber():a.opcode.num),stack:s.map(function(c){return gC(c)}),altstack:u.map(function(c){return gC(c)})})};var o=i.verify(e,t,r.tx||new Z6.Transaction,r.inputIndex||0,typeof r.flags=="number"?r.flags:Yne.flags(),new Z6.crypto.BN(r.satoshis||0));return{ok:o,err:i.errstr||"",steps:n}}function mC(e){var t=[],r=null;return e.steps.forEach(function(i,n){i.phase!==r&&(t.push("-- "+i.phase+" script --"),r=i.phase);var o=i.stack.length?i.stack.join(" | "):"(empty)",a=i.altstack.length?" alt:["+i.altstack.join(" | ")+"]":"";t.push(String(n).padStart(3)+" "+i.op.padEnd(16)+" -> ["+o+"]"+a)}),t.push((e.ok?"VALID":"INVALID")+(e.err?" ("+e.err+")":"")),t.join(`
|
|
98
|
-
`)}function Xne(e){return console.log(mC(e)),e}yC.exports={trace:$ne,format:mC,print:Xne,opLabel:vC}});var wC=k((uve,_C)=>{"use strict";v();var S1=Te(),re={Covenant:uN(),Preimage:Vo(),SIGHASH:lN(),Builder:dN(),UTXOGenerator:SN(),ScriptTester:EN(),CovenantBuilder:O8().CovenantBuilder,CovenantTemplates:O8().CovenantTemplates,OpcodeMap:S8(),ScriptUtils:RN(),StackExaminer:MN(),ScriptInterpreter:LN(),CovenantHelpers:Go(),Locks:ZN(),PushTx:Tl(),PELS:F8(),Token:G8(),Authorizers:z8(),DSL:Q8(),Policy:Q8().Policy,Debugger:bC()};re.policy=re.DSL.policy;re.trace=function(e,t,r){return re.Debugger.trace(e,t,r)};re.enableGenesis=function(e){return re.CovenantHelpers.enableGenesis(e)};re.verifyScript=function(e,t,r){return re.CovenantHelpers.verify(e,t,r)};re.perpetualCovenant=function(e){return re.PELS.pelsCovenant(e)};re.ownershipToken=function(e,t){return re.Token.ownershipToken(e,t)};re.valueCovenant=function(e){return re.PushTx.valueCovenant(e)};re.ordinalLock=function(e,t){return re.Token.ordinalLock(e,t)};re.transferOrdinal=function(e,t,r,i,n,o){return re.Token.transferOrdinal(e,t,r,i,n,o)};re.createCovenant=function(e,t){return new re.Covenant(e,t)};re.extractPreimage=function(e,t){return new re.Preimage(e,t)};re.analyzeSIGHASH=function(e){return new re.SIGHASH(e)};re.buildCovenant=function(e,t){return new re.Builder(e,t)};re.createUTXOGenerator=function(e){return new re.UTXOGenerator(e)};re.createTestEnvironment=function(e){return re.UTXOGenerator.createTestEnvironment(e)};re.testScript=function(e,t,r){return re.ScriptTester.test(e,t,r)};re.testCovenant=function(e,t,r){return re.ScriptTester.testCovenant(e,t,r)};re.testFieldExtraction=function(e,t,r){return re.ScriptTester.testFieldExtraction(e,t,r)};re.debugScript=function(e,t){var r=new re.ScriptTester(t);return r.debug(e)};re.explainZeroHashes=function(){return re.SIGHASH.explainZeroMystery()};re.getAllSIGHASHTypes=function(){return re.SIGHASH.getAllTypes()};re.demonstrateAllSIGHASH=function(){return re.SIGHASH.generateAllDemonstrations()};re.createCovenantBuilder=function(){return new re.CovenantBuilder};re.createValueLockCovenant=function(e){return re.CovenantTemplates.valueLock(e)};re.createHashLockCovenant=function(e){return re.CovenantTemplates.hashLock(e)};re.createComplexValidationCovenant=function(e){return re.CovenantTemplates.complexValidation(e)};re.getOpcodeMap=function(){return re.OpcodeMap.opcodeMap};re.simulateScript=function(e,t){return re.OpcodeMap.utils.simulate(e,t)};re.createASMFromJS=function(e){return re.OpcodeMap.utils.createASM(e)};re.scriptToASM=function(e){return re.ScriptUtils.scriptToASM(e)};re.asmToScript=function(e){return re.ScriptUtils.asmToScript(e)};re.asmToHex=function(e){return re.ScriptUtils.asmToHex(e)};re.hexToASM=function(e){return re.ScriptUtils.hexToASM(e)};re.scriptToHex=function(e){return re.ScriptUtils.scriptToHex(e)};re.validateASM=function(e){return re.ScriptUtils.validateASM(e)};re.validateScript=function(e){return re.ScriptUtils.validateScript(e)};re.estimateScriptSize=function(e){return re.ScriptUtils.estimateScriptSize(e)};re.optimizeScript=function(e){return re.ScriptUtils.optimizeScript(e)};re.compareScripts=function(e,t){return re.ScriptUtils.compareScripts(e,t)};re.explainScript=function(e){return re.ScriptUtils.explainScript(e)};re.scriptMetrics=function(e){return re.ScriptUtils.scriptMetrics(e)};re.analyzeComplexity=function(e){return re.ScriptUtils.analyzeComplexity(e)};re.findOptimizations=function(e){return re.ScriptUtils.findOptimizations(e)};re.covenantToEnglish=function(e){return re.ScriptUtils.covenantToEnglish(e)};re.batchTestScripts=function(e,t){return re.ScriptUtils.batchTestScripts(e,t)};re.examineStack=function(e,t){return re.StackExaminer.runScript(e,t)};re.debugScriptExecution=function(e,t,r){return r=r||{},r.stepMode?re.ScriptInterpreter.stepThroughScript(re.ScriptInterpreter.parseScript(e+" "+t),new S1.Transaction,!0):re.ScriptInterpreter.runFullEvaluation(re.ScriptInterpreter.parseScript(e),re.ScriptInterpreter.parseScript(t),new S1.Transaction)};re.parseScript=function(e){return re.ScriptInterpreter.parseScript(e)};re.printStack=function(e,t){return re.ScriptInterpreter.printStack(e,t)};re.createQuickCovenant=function(e,t){let r=re.createCovenantBuilder();switch(e){case"value_lock":return r.comment(`Value lock: minimum ${t.value} satoshis`).extractField("value").push(t.value).greaterThanOrEqual().verify().build();case"hash_lock":return r.comment(`Hash lock: requires preimage of ${t.hash}`).push("secret_placeholder").sha256().push(t.hash).equalVerify().build();case"time_lock":return r.comment(`Time lock: requires nLockTime > ${t.timestamp}`).extractField("nLockTime").push(t.timestamp).greaterThan().verify().build();case"multi_condition":let i=r.comment("Multi-condition covenant");return t.conditions.forEach(n=>{switch(n.type){case"value":i=i.extractField("value").push(n.value).greaterThanOrEqual().verify();break;case"hash":i=i.push("secret_placeholder").sha256().push(n.hash).equalVerify();break;case"time":i=i.extractField("nLockTime").push(n.timestamp).greaterThan().verify();break}}),i.build();default:throw new Error(`Unknown covenant type: ${e}`)}};re.completeCovenantFlow=function(e,t,r){var i=new re.Covenant(e);return i.completeFlow(t,r)};re.getEducationalResources=function(){return{zeroHashMystery:re.SIGHASH.explainZeroMystery(),sighashTypes:re.SIGHASH.getAllTypes(),exampleDemonstrations:re.SIGHASH.generateAllDemonstrations()}};re.utils={};re.utils.reconstructP2pkhScript=function(e){return S1.Script.buildPublicKeyHashOut(e).toHex()};re.utils.createCovenantAddress=function(e){var t=S1.crypto.Hash.sha256ripemd160(e.toBuffer());return S1.Address.fromScriptHash(t)};re.utils.decodeCompactSize=function(e,t){return re.Preimage.decodeCompactSize(e,t)};re.version=zm();re.description="Smart Contract Framework for Bitcoin SV";re.features={BIP143_PREIMAGE:!0,COMPACT_SIZE_VARINT:!0,BIDIRECTIONAL_EXTRACTION:!0,SIGHASH_DETECTION:!0,ZERO_HASH_WARNINGS:!0,MULTI_FIELD_VALIDATION:!0,REAL_UTXO_GENERATION:!0,SCRIPT_TESTING:!0,LOCAL_VERIFICATION:!0,JAVASCRIPT_TO_SCRIPT:!0,OPCODE_MAPPING:!0,COVENANT_BUILDER:!0,SCRIPT_ANALYSIS:!0,SCRIPT_OPTIMIZATION:!0,SCRIPT_CONVERSION:!0,BATCH_TESTING:!0,QUICK_COVENANTS:!0,SCRIPT_EXPLANATIONS:!0,STACK_EXAMINATION:!0,SCRIPT_DEBUGGING:!0,STEP_BY_STEP_EXECUTION:!0,INTERACTIVE_DEBUGGING:!0};re.interpretScript=re.debugScriptExecution;re.getScriptMetrics=re.scriptMetrics;_C.exports=re});var SC=k((cve,x1)=>{"use strict";v();var W6=function(){var e=typeof A.default<"u"&&A.default.env&&A.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)},Xa={MEMORY:"memory",SESSION:"session",LOCAL:"local"};function xi(e){e=e||{},this.options={storage:e.storage||Xa.MEMORY,storageKey:e.storageKey||"smartledger-utxos",autoSave:e.autoSave!==!1,maxUTXOs:e.maxUTXOs||1e3};var t=[Xa.MEMORY,Xa.SESSION,Xa.LOCAL];if(t.indexOf(this.options.storage)===-1)throw new Error("Invalid storage type: "+this.options.storage);this.utxos=new Map,this.addressIndex=new Map,this.spentUTXOs=new Map,this.metadata={totalUTXOs:0,totalValue:0,createdAt:new Date().toISOString(),lastModified:new Date().toISOString()},this.loadFromStorage()}xi.prototype.getStorage=function(){return this.options.storage===Xa.SESSION?typeof sessionStorage<"u"?sessionStorage:null:this.options.storage===Xa.LOCAL&&typeof localStorage<"u"?localStorage:null};xi.prototype.loadFromStorage=function(){var e=this.getStorage();if(e)try{var t=e.getItem(this.options.storageKey);if(!t)return;var r=JSON.parse(t);if(!r.utxos)return;var i=this;r.utxos.forEach(function(n){var o=n.txid+":"+n.vout;i.utxos.set(o,n),i.addressIndex.has(n.address)||i.addressIndex.set(n.address,new Set),i.addressIndex.get(n.address).add(o)}),r.metadata&&(this.metadata=r.metadata),W6("\u2705 BrowserUTXOManager: Loaded "+this.utxos.size+" UTXOs from "+this.options.storage+" storage")}catch(n){console.error("Failed to load UTXOs from storage:",n)}};xi.prototype.saveToStorage=function(){if(this.options.storage!==Xa.MEMORY){var e=this.getStorage();if(e)try{var t={utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",timestamp:new Date().toISOString()};e.setItem(this.options.storageKey,JSON.stringify(t)),W6("\u{1F4BE} BrowserUTXOManager: Saved "+this.utxos.size+" UTXOs to "+this.options.storage+" storage")}catch(r){console.error("Failed to save UTXOs to storage:",r)}}};xi.prototype.addUTXO=function(e){if(!e||!e.txid||typeof e.vout!="number")throw new Error("Invalid UTXO: missing txid or vout");var t=e.txid+":"+e.vout;if(this.utxos.has(t))return W6("\u26A0\uFE0F UTXO already exists: "+t),!1;var r={txid:e.txid,vout:e.vout,address:e.address||"",satoshis:e.satoshis||0,script:e.script||"",status:"available",addedAt:new Date().toISOString()};return this.utxos.set(t,r),r.address&&(this.addressIndex.has(r.address)||this.addressIndex.set(r.address,new Set),this.addressIndex.get(r.address).add(t)),this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),!0};xi.prototype.getUTXOsForAddress=function(e){var t=this.addressIndex.get(e);if(!t)return[];var r=[],i=this;return t.forEach(function(n){var o=i.utxos.get(n);o&&o.status==="available"&&r.push(o)}),r};xi.prototype.getBalance=function(e){var t=this.getUTXOsForAddress(e);return t.reduce(function(r,i){return r+(i.satoshis||0)},0)};xi.prototype.spendUTXOs=function(e,t){t=t||"browser-spend";for(var r=[],i=0;i<e.length;i++){var n=e[i],o=n.txid+":"+n.vout,a=this.utxos.get(o);a&&a.status==="available"&&(a.status="spent",a.spentAt=new Date().toISOString(),a.spentInTx=t,this.spentUTXOs.set(o,{txid:a.txid,vout:a.vout,spentInTx:t,spentAt:a.spentAt}),r.push(a))}return this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),r};xi.prototype.getUTXO=function(e,t){var r=e+":"+t,i=this.utxos.get(r);return{exists:!!i,utxo:i,status:i?i.status:"not-found"}};xi.prototype.createMockUTXOs=function(e,t,r){t=t||5,r=r||1e5;for(var i=[],n=0;n<t;n++){for(var o="",a=0;a<64;a++)o+=Math.floor(Math.random()*16).toString(16);var s={txid:o,vout:n,address:e,satoshis:r+Math.floor(Math.random()*1e4),script:"",status:"available"};this.addUTXO(s),i.push(s)}return i};xi.prototype.getStats=function(){var e=0,t=0,r=0;return this.utxos.forEach(function(i){e+=i.satoshis||0,i.status==="available"?t++:i.status==="spent"&&r++}),{totalUTXOs:this.utxos.size,totalAvailable:t,totalSpent:r,totalValue:e,totalAddresses:this.addressIndex.size,storageType:this.options.storage,metadata:this.metadata}};xi.prototype.updateMetadata=function(){var e=this.getStats();this.metadata.totalUTXOs=e.totalUTXOs,this.metadata.totalValue=e.totalValue,this.metadata.lastModified=new Date().toISOString()};xi.prototype.exportData=function(){return JSON.stringify({utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",exportedAt:new Date().toISOString()})};xi.prototype.importData=function(e,t){t=t||!1;try{var r=JSON.parse(e);if(t||(this.utxos.clear(),this.addressIndex.clear(),this.spentUTXOs.clear()),r.utxos&&Array.isArray(r.utxos)){var i=this;r.utxos.forEach(function(n){i.addUTXO(n)})}return W6("\u2705 BrowserUTXOManager: Imported "+(r.utxos&&r.utxos.length||0)+" UTXOs"),!0}catch(n){return console.error("Failed to import UTXO data:",n),!1}};typeof x1<"u"&&x1.exports?(x1.exports=xi,x1.exports.STORAGE_TYPES=Xa):typeof window<"u"&&(window.BrowserUTXOManager=xi,window.BrowserUTXOManager.STORAGE_TYPES=Xa)});var EC=k((hve,xC)=>{"use strict";v();var e7=class{constructor(t,r={}){this.bsv=t,this.options={difficulty:r.difficulty||1,blockTime:r.blockTime||1e4,validateScripts:r.validateScripts!==!1,logLevel:r.logLevel||"info",...r},this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[]}acceptTransaction(t){try{return this.options.validateScripts&&!this.validateTransactionSignatures(t)?(this.log("warn","\u274C Transaction rejected: Invalid signatures"),!1):(this.mempool.push(t),this.log("info",`\u2705 Transaction accepted into mempool: ${t.id||"unknown"}`),!0)}catch(r){return this.log("error",`\u274C Transaction rejected: ${r.message}`),!1}}validateTransactionSignatures(t){try{let r=t.verify();return this.log("debug",`\u{1F4CA} Transaction verification result: ${r}`),r===!0}catch(r){return this.log("warn",`\u26A0\uFE0F Signature validation error: ${r.message}`),!1}}mineBlock(t=10){let r=this.mempool.splice(0,t),i={height:this.currentBlock.height+1,timestamp:Date.now(),transactions:r,transactionCount:r.length,previousBlockHash:this.currentBlock.hash||"0000000000000000000000000000000000000000000000000000000000000000"},n=JSON.stringify({height:i.height,timestamp:i.timestamp,previousBlockHash:i.previousBlockHash,transactions:r.map(o=>o.id||o.toString())});return i.hash=this.bsv.crypto.Hash.sha256(h.Buffer.from(n)).toString("hex"),this.currentBlock=i,this.log("info",`\u26CF\uFE0F Mined block ${i.height} with ${r.length} transactions`),this.log("debug",`\u{1F4E6} Block hash: ${i.hash}`),i}getMempoolStats(){return{transactionCount:this.mempool.length,transactions:this.mempool.map(t=>({id:t.id||"unknown",size:t.toBuffer?t.toBuffer().length:0,inputs:t.inputs?t.inputs.length:0,outputs:t.outputs?t.outputs.length:0}))}}getBlockchainStats(){return{currentHeight:this.currentBlock.height,currentBlockHash:this.currentBlock.hash,currentBlockTimestamp:this.currentBlock.timestamp,mempoolSize:this.mempool.length,difficulty:this.options.difficulty,blockTime:this.options.blockTime}}reset(){this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[],this.log("info","\u{1F504} Miner reset to genesis state")}log(t,r){let i={error:0,warn:1,info:2,debug:3},n=i[this.options.logLevel]||2;if(i[t]<=n){let o=new Date().toISOString();console.log(`[${o}] [${t.toUpperCase()}] ${r}`)}}};xC.exports=e7});var IC=k((pve,OC)=>{v();var Ne=Te(),Bl=class{static createSignature(t,r,i,n,o,a=null){a=a||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;let s=Ne.Transaction.sighash.sign(t,r,a,i,n,new Ne.crypto.BN(o));return h.Buffer.concat([s.toDER(),h.Buffer.from([a])])}static createMultisigScript(t,r){let i=new Ne.Script().add(Ne.Opcode[`OP_${t}`]);for(let n of r)i=i.add(n.toBuffer());return i.add(Ne.Opcode[`OP_${r.length}`]).add(Ne.Opcode.OP_CHECKMULTISIG)}static createMultisigUnlocking(t){let r=new Ne.Script().add(Ne.Opcode.OP_0);for(let i of t)r=r.add(i);return r}static createTimelockScript(t,r){let i=h.Buffer.from(t.toString(16).padStart(8,"0"),"hex").reverse();return new Ne.Script().add(i).add(Ne.Opcode.OP_CHECKLOCKTIMEVERIFY).add(Ne.Opcode.OP_DROP).add(r.toBuffer())}static createConditionalScript(t,r=null){let i=new Ne.Script().add(Ne.Opcode.OP_IF).add(t.toBuffer());return r&&(i=i.add(Ne.Opcode.OP_ELSE).add(r.toBuffer())),i.add(Ne.Opcode.OP_ENDIF)}static createP2PKHScript(t){return new Ne.Script().add(Ne.Opcode.OP_DUP).add(Ne.Opcode.OP_HASH160).add(t.toAddress().hashBuffer).add(Ne.Opcode.OP_EQUALVERIFY).add(Ne.Opcode.OP_CHECKSIG)}static createP2PKHUnlocking(t,r){return new Ne.Script().add(t).add(r.toBuffer())}static getPreimage(t,r,i,n,o=null){return o=o||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID,Ne.Transaction.sighash.sighash(t,o,r,i,new Ne.crypto.BN(n))}static createDataScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(t)}static createOpReturnScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(Ne.Opcode.OP_FALSE).add(Ne.Opcode.OP_RETURN).add(t)}static validateTransaction(t){try{return t.verify()}catch(r){return console.error("Transaction validation error:",r.message),!1}}static validateScript(t,r,i,n){try{return new Ne.Script.Interpreter().verify(t,r,i,n,Ne.Script.Interpreter.SCRIPT_VERIFY_P2SH|Ne.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|Ne.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID|Ne.Script.Interpreter.SCRIPT_ENABLE_MAGNETIC_OPCODES|Ne.Script.Interpreter.SCRIPT_ENABLE_MONOLITH_OPCODES)}catch(o){return console.error("Script validation error:",o.message),!1}}static createLowFeeTransaction(t,r,i=10){let n=new Ne.Transaction().feePerKb(i);for(let o of t)n=n.from(o);for(let o of r)n=n.to(o.address,o.satoshis);return n}};Bl.SIGHASH_ALL=Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;Bl.SIGHASH_NONE=Ne.crypto.Signature.SIGHASH_NONE|Ne.crypto.Signature.SIGHASH_FORKID;Bl.SIGHASH_SINGLE=Ne.crypto.Signature.SIGHASH_SINGLE|Ne.crypto.Signature.SIGHASH_FORKID;OC.exports=Bl});var Y6=k((vve,MC)=>{"use strict";v();var O1=Te(),PC=h.Buffer.from("ord","utf8");function t7(){return O1.Script}function TC(){return O1.Opcode}function kC(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"an array";var t=typeof e;return(t==="object"?"an ":"a ")+t}function AC(e,t){if(h.Buffer.isBuffer(e))return e;if(typeof e=="string")return h.Buffer.from(e,"utf8");throw new Error(t+" must be a string or Buffer, got "+kC(e))}var Jne=["data","body","payload","text","message"];function Qne(e){var t=t7(),r=e.lock!=null,i=e.address!=null;if(r&&i)throw new Error("buildInscription accepts `lock` or `address`, not both \u2014 they name different owners and one would be silently ignored");if(r){var n;if(e.lock instanceof t)n=e.lock;else if(h.Buffer.isBuffer(e.lock))n=t.fromBuffer(e.lock);else if(typeof e.lock=="string")n=t.fromHex(e.lock);else throw new Error("lock must be a Script, Buffer, or hex string, got "+kC(e.lock));if(!n.chunks.length&&!e.allowEmptyLock)throw new Error("lock is empty: the inscription would carry no locking script at all and the ordinal would be spendable by anyone. Pass a real lock, or { allowEmptyLock: true } if you are appending this envelope to your own script");return n}if(i){var o=e.address instanceof O1.Address?e.address:O1.Address.fromString(String(e.address));return t.buildPublicKeyHashOut(o)}throw new Error("buildInscription requires an address or a lock script")}function RC(e){e=e||{};var t=TC(),r=Qne(e);if(e.content==null){var i=Jne.filter(function(s){return e[s]!=null})[0];throw new Error("buildInscription requires `content`"+(i?" \u2014 received `"+i+"`, which is not read":"")+". Omitting it would inscribe an empty payload; pass content: '' if that is intended")}var n=AC(e.content,"content"),o;if(e.contentType==null){if(h.Buffer.isBuffer(e.content))throw new Error("contentType is required when content is a Buffer (e.g. 'image/png', 'application/octet-stream') \u2014 it cannot be inferred from bytes");o=h.Buffer.from("text/plain","utf8")}else if(o=AC(e.contentType,"contentType"),!o.length)throw new Error("contentType must not be empty");var a=t7().fromBuffer(r.toBuffer());return a.add(t.OP_FALSE),a.add(t.OP_IF),a.add(PC),a.add(t.OP_1),a.add(o),a.add(t.OP_0),a.add(n),a.add(t.OP_ENDIF),a}function E1(e,t){return e&&e.opcodenum===t&&e.buf==null}function BC(e){for(var t=t7(),r=TC(),i=e instanceof t?e:h.Buffer.isBuffer(e)?t.fromBuffer(e):t.fromHex(e),n=i.chunks,o=-1,a=0;a+2<n.length;a++)if(E1(n[a],r.OP_FALSE)&&E1(n[a+1],r.OP_IF)&&n[a+2].buf&&n[a+2].buf.equals(PC)){o=a;break}if(o===-1)return null;for(var s=h.Buffer.alloc(0),u=h.Buffer.alloc(0),c=n.length,l=o+3;l<n.length;l++){var m=n[l];if(E1(m,r.OP_ENDIF)){c=l;break}E1(m,r.OP_1)&&n[l+1]&&n[l+1].buf?(s=n[l+1].buf,l++):E1(m,r.OP_0)&&n[l+1]&&n[l+1].buf&&(u=n[l+1].buf,l++)}for(var w=new t,E=0;E<o;E++)w.chunks.push(n[E]);for(var P=c+1;P<n.length;P++)w.chunks.push(n[P]);return{contentType:s.toString("utf8"),content:u,contentText:u.toString("utf8"),lock:w}}function eoe(e){try{return BC(e)!==null}catch{return!1}}function toe(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;if(typeof t!="number"||!Number.isInteger(t)||t<1)throw new Error("satoshis must be a positive integer (1 for a standard 1Sat ordinal)");return new O1.Transaction.Output({script:RC(e),satoshis:t})}MC.exports={buildInscription:RC,parseInscription:BC,isInscription:eoe,createInscriptionOutput:toe}});var HC=k((yve,FC)=>{"use strict";v();var qr=Te(),Nl=Tl(),r7=Go(),DC=Y6(),Yo=qr.Script,Xt=qr.Opcode,LC=qr.encoding.BufferReader,J6=Nl.SIGHASH_ALL_ANYONECANPAY_FORKID;function NC(e,t){return t&&t.length?e.add(h.Buffer.from(t)):e.add(Xt.OP_0)}function $6(e){return e.toBufferWriter().toBuffer()}function Cl(e,t){if(typeof e!="number"||!isFinite(e)||e<0||Math.floor(e)!==e)throw new Error(t+" must be a non-negative integer number of satoshis (got "+e+")");return e}function e5(e){return e instanceof Yo?e:h.Buffer.isBuffer(e)?Yo.fromBuffer(e):Yo.fromHex(e)}function qC(e){return e instanceof qr.Address?e:e&&typeof e.toAddress=="function"?e.toAddress():qr.Address.fromString(String(e))}function roe(e){if(h.Buffer.isBuffer(e)){if(e.length!==20)throw new Error("seller pubkeyhash buffer must be 20 bytes (HASH160)");return e}return e instanceof qr.PublicKey?qr.crypto.Hash.sha256ripemd160(e.toBuffer()):qC(e).hashBuffer}function Dl(e,t){return Cl(t,"payment price"),new qr.Transaction.Output({script:Yo.buildPublicKeyHashOut(qC(e)),satoshis:t})}function X6(e){if(e instanceof qr.Transaction.Output)return e;if(h.Buffer.isBuffer(e))return qr.Transaction.Output.fromBufferReader(new LC(e));var t=e.payTo!=null?e.payTo:e.address,r=e.satoshis!=null?e.satoshis:e.price;if(t==null||r==null)throw new Error("payment spec needs {address|payTo, satoshis|price}");return Dl(t,r)}function ioe(e){if(e.payOutputs){if(!e.payOutputs.length)throw new Error("payOutputs must be a non-empty array");return e.payOutputs.map(X6)}if(e.payOutput!=null)return[X6(e.payOutput)];if(e.price!=null){var t=e.payTo!=null?e.payTo:e.seller,r=t instanceof qr.Transaction.Output?t:Dl(t,e.price),i=[r];return e.royalties&&e.royalties.forEach(function(n){i.push(X6(n))}),i}throw new Error("buildOrdLock requires a price, a payOutput, or payOutputs")}function noe(e){return h.Buffer.concat(e.map($6))}function t5(e){if(e=e||{},e.seller==null)throw new Error("buildOrdLock requires a seller");var t=roe(e.seller),r=noe(ioe(e)),i=new Yo;if(i.add(Xt.OP_IF),i.add(Xt.OP_DUP).add(Xt.OP_HASH160),i.add(h.Buffer.from(t)).add(Xt.OP_EQUALVERIFY).add(Xt.OP_CHECKSIG),i.add(Xt.OP_ELSE),i.add(Xt.OP_DUP),Nl.pushTxCore(i,{sighashType:J6}),i.add(Xt.OP_VERIFY),Nl.assertSighashType(i,J6),Nl.extractHashOutputs(i),i.add(Xt.OP_TOALTSTACK),i.add(h.Buffer.from(r)).add(Xt.OP_CAT),i.add(Xt.OP_SWAP).add(Xt.OP_CAT),i.add(Xt.OP_HASH256),i.add(Xt.OP_FROMALTSTACK).add(Xt.OP_EQUAL),i.add(Xt.OP_ENDIF),e.inscription){var n=DC.buildInscription({lock:new Yo,allowEmptyLock:!0,contentType:e.inscription.contentType,content:e.inscription.content});n.chunks.forEach(function(o){i.chunks.push(o)})}return i}function Ml(e,t){return e&&e.opcodenum===t&&e.buf==null}function CC(e){for(var t=new LC(e),r=[];!t.eof();)r.push(qr.Transaction.Output.fromBufferReader(t));return r}function r5(e,t){var r=t&&t.network;try{for(var i=e5(e),n=i.chunks,o=0,a=-1,s=-1,u=-1,c=0;c<n.length;c++)if(Ml(n[c],Xt.OP_IF))o===0&&(a=c),o++;else if(Ml(n[c],Xt.OP_ELSE)&&o===1)s=c;else if(Ml(n[c],Xt.OP_ENDIF)&&(o--,o===0)){u=c;break}if(a===-1||s===-1||u===-1)return null;for(var l=null,m=a+1;m<s;m++)if(n[m].buf&&n[m].buf.length===20){l=n[m].buf;break}if(!l)return null;for(var w=null,E=s+1;E<u;E++)Ml(n[E],Xt.OP_TOALTSTACK)&&n[E+1]&&n[E+1].buf&&Ml(n[E+2],Xt.OP_CAT)&&Ml(n[E+3],Xt.OP_SWAP)&&(w=n[E+1].buf);if(!w)return null;var P=CC(w).map(function(K){var N=null;try{K.script.isPublicKeyHashOut()&&(N=K.script.toAddress(r).toString())}catch{}return{satoshis:K.satoshis,script:K.script,address:N}}),M=P.reduce(function(K,N){return K+N.satoshis},0),D=null,L=DC.parseInscription(i);L&&(D={contentType:L.contentType,content:L.content,contentText:L.contentText});var U=t5({seller:l,payOutputs:CC(w),inscription:L?{contentType:L.contentType,content:L.content}:void 0});return U.toHex()!==i.toHex()?null:{seller:{pubKeyHash:l,address:qr.Address.fromPublicKeyHash(l,r).toString()},payOutputs:P,payBlob:w,totalPrice:M,inscription:D}}catch{return null}}function ooe(e,t){return r5(e,t)!==null}function aoe(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;return new qr.Transaction.Output({script:t5(e),satoshis:t})}function UC(e){e=e||{};var t=e.spend,r=e.lockingScript;if(!t||!r)throw new Error("purchase requires { spend, lockingScript }");var i=e.inputIndex||0,n=e.payoutIndex!=null?e.payoutIndex:1,o=e.satoshis!=null?e.satoshis:1,a=t.outputs||[],s=e.parsed||r5(r),u=e.payoutCount!=null?e.payoutCount:s?s.payOutputs.length:1;if(n+u>a.length)throw new Error("purchase: spend has fewer outputs than the pinned block requires (need "+(n+u)+", have "+a.length+")");if(e.validate!==!1&&s){var c=h.Buffer.concat(a.slice(n,n+u).map($6));if(!c.equals(s.payBlob))throw new Error("purchase: outputs ["+n+".."+(n+u-1)+"] do not match the listing payment \u2014 the seller (or a royalty/fee payee) would not be paid")}var l=h.Buffer.concat(a.slice(0,n).map($6)),m=h.Buffer.concat(a.slice(n+u).map($6)),w=Object.assign({sighashType:J6},e.grind||{}),E=Nl.grind(t,i,r,o,w),P=new Yo;return NC(P,m),NC(P,l),P.add(h.Buffer.from(E.preimage)),P.add(Xt.OP_FALSE),t.inputs[i].setScript(P),P}function soe(e){e=e||{};var t=e.privateKey,r=e.spend,i=e.lockingScript;if(!t||!r||!i)throw new Error("cancel requires { privateKey, spend, lockingScript }");var n=e.inputIndex||0,o=e.satoshis!=null?e.satoshis:1,a=e.sighashType!=null?e.sighashType:r7.SIGHASH,s=r7.signInput(r,t,n,i,o,a),u=new Yo;return u.add(h.Buffer.from(s)),u.add(t.toPublicKey().toBuffer()),u.add(Xt.OP_TRUE),r.inputs[n].setScript(u),u}function Q6(e,t,r,i){e.addInput(new qr.Transaction.Input({prevTxId:t.txid||t.prevTxId,outputIndex:t.outputIndex!=null?t.outputIndex:t.vout,script:Yo.empty()}),e5(r),i)}function i7(e,t,r){Cl(r.satoshis,"input "+t+" satoshis");var i=e5(r.script),n=r7.signInput(e,r.privateKey,t,i,r.satoshis,Nl.SIGHASH_ALL_FORKID),o=new Yo;o.add(h.Buffer.from(n)),o.add(r.privateKey.toPublicKey().toBuffer()),e.inputs[t].setScript(o)}function uoe(e){e=e||{};var t=e.ordinal;if(!t||!t.script||!t.privateKey)throw new Error("buildListingTx requires ordinal { script, privateKey, txid, outputIndex }");var r=Cl(t.satoshis!=null?t.satoshis:1,"ordinal satoshis"),i=t5(e),n=e.funding||[],o=e.fee!=null?e.fee:500,a=n.reduce(function(c,l){return c+Cl(l.satoshis,"funding satoshis")},0),s=a-o;if(s<0)throw new Error("buildListingTx: insufficient funding \u2014 need "+o+" sat fee, funded "+a);var u=new qr.Transaction;return Q6(u,t,t.script,r),n.forEach(function(c){Q6(u,c,c.script,c.satoshis)}),u.addOutput(new qr.Transaction.Output({script:i,satoshis:r})),s>0&&u.addOutput(Dl(e.changeAddress||t.privateKey.toAddress(),s)),i7(u,0,{script:t.script,privateKey:t.privateKey,satoshis:r}),n.forEach(function(c,l){i7(u,1+l,c)}),{tx:u,listingScript:i,listingOutpoint:{txid:u.hash,outputIndex:0}}}function foe(e){e=e||{};var t=e.listing;if(!t||!t.script)throw new Error("buildPurchaseTx requires listing.script");if(!e.ordinalDestination)throw new Error("buildPurchaseTx requires ordinalDestination");if(!e.funding||!e.funding.length)throw new Error("buildPurchaseTx requires funding coins");var r=e5(t.script),i=r5(r);if(!i)throw new Error("buildPurchaseTx: listing.script is not a parseable OrdLock");var n=Cl(t.satoshis!=null?t.satoshis:1,"listing satoshis"),o=e.payOutputs?e.payOutputs.map(X6):i.payOutputs.map(function(m){return new qr.Transaction.Output({script:m.script,satoshis:m.satoshis})}),a=o.reduce(function(m,w){return m+w.satoshis},0),s=e.fee!=null?e.fee:500,u=e.funding.reduce(function(m,w){return m+Cl(w.satoshis,"funding satoshis")},0),c=u-a-s;if(c<0)throw new Error("buildPurchaseTx: insufficient funding \u2014 need "+(a+s)+" sat (payments "+a+" + fee "+s+"), funded "+u);var l=new qr.Transaction;return Q6(l,t,r,n),e.funding.forEach(function(m){Q6(l,m,m.script,m.satoshis)}),l.addOutput(Dl(e.ordinalDestination,n)),o.forEach(function(m){l.addOutput(m)}),c>0&&l.addOutput(Dl(e.changeAddress||e.ordinalDestination,c)),UC({spend:l,lockingScript:r,parsed:i,satoshis:n,inputIndex:0,payoutIndex:1,payoutCount:o.length,grind:e.grind}),e.funding.forEach(function(m,w){i7(l,1+w,m)}),l}FC.exports={ORDLOCK_SIGHASH:J6,buildOrdLock:t5,parseOrdLock:r5,isOrdLock:ooe,listInscriptionOutput:aoe,payOutputFor:Dl,purchase:UC,cancel:soe,buildListingTx:uoe,buildPurchaseTx:foe}});var aD=k((_ve,oD)=>{"use strict";v();var jC=Y6(),zC="application/bsv-20",n7=18,i5="18446744073709551615";function KC(e){return typeof e=="string"&&/^\d+$/.test(e)}function VC(e){return e.length>i5.length||e.length===i5.length&&e>i5}function GC(e,t){var r;if(typeof e=="number"){if(!Number.isInteger(e)||e<0)throw new Error(t+" must be a non-negative integer");if(e>Number.MAX_SAFE_INTEGER)throw new Error(t+" exceeds Number.MAX_SAFE_INTEGER and would lose precision \u2014 pass it as a string");r=String(e)}else if(KC(e))r=e.replace(/^0+(?=\d)/,"");else throw new Error(t+" must be a non-negative integer (string or number)");if(VC(r))throw new Error(t+" exceeds the uint64 maximum ("+i5+")");return r}function I1(e,t){var r=GC(e,t);if(!/[1-9]/.test(r))throw new Error(t+" must be greater than zero");return r}function ZC(e){if(typeof e!="string"||!e.length)throw new Error("tick is required");if(h.Buffer.byteLength(e,"utf8")>4)throw new Error("tick must be 1\u20134 UTF-8 bytes");return e}function o7(e){var t=typeof e=="string"?Number(e):e;if(!Number.isInteger(t)||t<0||t>n7)throw new Error("dec must be an integer 0\u2026"+n7);return String(t)}var a7=/^[0-9a-fA-F]{64}_\d+$/;function s7(e){if(typeof e!="string"||!a7.test(e))throw new Error('id must be "<txid>_<vout>" (64-hex txid, underscore, output index)');return e}function u7(e,t){if(typeof e!="string"){var r=e===null?"null":Array.isArray(e)?"an array":(typeof e=="object"?"an ":"a ")+typeof e;throw new Error(t+" must be a string, got "+r)}if(!e.length)throw new Error(t+" must not be empty");return e}function WC(e){if(u7(e,"icon"),!a7.test(e))throw new Error('icon must be an outpoint reference "<txid>_<vout>" (64-hex txid, underscore, output index)');return e}function If(e,t){return t=t||{},jC.buildInscription({lock:t.lock,address:t.address,contentType:t.contentType||zC,content:JSON.stringify(e)})}function YC(e){e=e||{};var t={p:"bsv-20",op:"deploy",tick:ZC(e.tick),max:I1(e.max,"max")};return e.lim!=null&&(t.lim=GC(e.lim,"lim")),e.dec!=null&&(t.dec=o7(e.dec)),If(t,e)}function $C(e,t,r){var i=t.tick!=null,n=t.id!=null;if(i&&n)throw new Error(r+" names a token by `tick` (v1) or `id` (BSV-21), not both");if(!i&&!n)throw new Error(r+" requires `tick` (v1) or `id` (BSV-21)");return n?e.id=s7(t.id):e.tick=ZC(t.tick),e}function XC(e,t){if(e.amt!=null)throw new Error(t+" must not carry an amt \u2014 the specification forbids it, and a payload that does is discarded")}function JC(e){e=e||{};var t={p:"bsv-20",op:"mint"};return $C(t,e,"mint"),t.amt=I1(e.amt,"amt"),If(t,e)}function QC(e){e=e||{};var t={p:"bsv-20",op:"transfer",amt:I1(e.amt,"amt")};return $C(t,e,"transfer"),If(t,e)}function eD(e){if(e=e||{},e.tick!=null)throw new Error("burn is a BSV-21 operation and names its token by `id` (<txid>_<vout>), not `tick`");var t={p:"bsv-20",op:"burn",id:s7(e.id),amt:I1(e.amt,"amt")};return If(t,e)}function tD(e){e=e||{},XC(e,"deploy+auth");var t={p:"bsv-20",op:"deploy+auth"};return e.dec!=null&&(t.dec=o7(e.dec)),e.sym!=null&&(t.sym=u7(e.sym,"sym")),e.icon!=null&&(t.icon=WC(e.icon)),If(t,e)}function rD(e){e=e||{},XC(e,"auth");var t={p:"bsv-20",op:"auth",id:s7(e.id)};return If(t,e)}function iD(e){e=e||{};var t={p:"bsv-20",op:"deploy+mint",amt:I1(e.amt,"amt")};return e.dec!=null&&(t.dec=o7(e.dec)),e.sym!=null&&(t.sym=u7(e.sym,"sym")),e.icon!=null&&(t.icon=WC(e.icon)),If(t,e)}function Af(e,t){var r=Te();return new r.Transaction.Output({script:e,satoshis:t??1})}function coe(e){return Af(YC(e),e&&e.satoshis)}function loe(e){return Af(JC(e),e&&e.satoshis)}function hoe(e){return Af(QC(e),e&&e.satoshis)}function doe(e){return Af(iD(e),e&&e.satoshis)}function poe(e){return Af(eD(e),e&&e.satoshis)}function goe(e){return Af(tD(e),e&&e.satoshis)}function voe(e){return Af(rD(e),e&&e.satoshis)}function moe(e){var t=Te();if(e&&typeof e=="object"&&!h.Buffer.isBuffer(e)&&!(e instanceof t.Script)||typeof e=="string"&&e.trim()[0]==="{")return e;var r=jC.parseInscription(e);return r?r.contentText:null}var yoe={deploy:{need:["tick","max"]},mint:{need:["amt"],tickOrId:!0},transfer:{need:["amt"],tickOrId:!0},"deploy+mint":{need:["amt"]},"deploy+auth":{need:[],noAmt:!0},auth:{need:["id"],noAmt:!0},burn:{need:["id","amt"]}};function boe(e){var t=typeof e=="number"?Number.isInteger(e)&&e>=0?String(e):null:KC(e)?e:null;return t==null?!1:!VC(t.replace(/^0+(?=\d)/,""))}function _oe(e){if(!e||e.p!=="bsv-20"||typeof e.op!="string")return!1;var t=yoe[e.op];if(!t)return!1;for(var r=0;r<t.need.length;r++)if(e[t.need[r]]==null)return!1;if(t.tickOrId&&e.tick==null==(e.id==null)||t.noAmt&&e.amt!=null||e.tick!=null&&(typeof e.tick!="string"||!e.tick.length||h.Buffer.byteLength(e.tick,"utf8")>4)||e.id!=null&&(typeof e.id!="string"||!a7.test(e.id)))return!1;for(var i=["amt","max","lim"],n=0;n<i.length;n++)if(e[i[n]]!=null&&!boe(e[i[n]]))return!1;if(e.dec!=null){var o=typeof e.dec=="string"?Number(e.dec):e.dec;if(!Number.isInteger(o)||o<0||o>n7)return!1}return!0}function nD(e){try{var t=moe(e);if(t==null)return null;var r=typeof t=="object"?t:JSON.parse(t);return _oe(r)?r:null}catch{return null}}function woe(e){return nD(e)!==null}oD.exports={CONTENT_TYPE:zC,buildDeploy:YC,buildMint:JC,buildTransfer:QC,buildDeployMint:iD,buildBurn:eD,buildDeployAuth:tD,buildAuth:rD,createDeployOutput:coe,createMintOutput:loe,createTransferOutput:hoe,createDeployMintOutput:doe,createBurnOutput:poe,createDeployAuthOutput:goe,createAuthOutput:voe,parseBsv20:nD,isBsv20:woe}});var uD=k((Sve,sD)=>{"use strict";v();var A1=Y6(),$o=HC(),Soe=aD();function xoe(e){if(!Array.isArray(e)||!e.length)throw new Error("batchInscriptionOutputs requires a non-empty array of items");return e.map(function(t){return A1.createInscriptionOutput(t)})}sD.exports={buildInscription:A1.buildInscription,parseInscription:A1.parseInscription,isInscription:A1.isInscription,createInscriptionOutput:A1.createInscriptionOutput,batchInscriptionOutputs:xoe,ORDLOCK_SIGHASH:$o.ORDLOCK_SIGHASH,buildOrdLock:$o.buildOrdLock,parseOrdLock:$o.parseOrdLock,isOrdLock:$o.isOrdLock,listInscriptionOutput:$o.listInscriptionOutput,payOutputFor:$o.payOutputFor,purchaseOrdLock:$o.purchase,cancelOrdLock:$o.cancel,buildListingTx:$o.buildListingTx,buildPurchaseTx:$o.buildPurchaseTx,BSV20:Soe}});var n5=k((Ove,cD)=>{"use strict";v();var qs=Te(),f7=qs.PublicKey,P1=qs.PrivateKey,fD=qs.crypto.Hash,En=qs.util.preconditions,Eve=qs.errors;function Ct(e){return this instanceof Ct?(this.options=e||{},this.network=this.options.network||"mainnet",this.registry=this.options.registry||null,this):new Ct(e)}Ct.fromPublicKey=function(e,t){t=t||{},typeof e=="string"&&(e=f7.fromString(e)),En.checkArgument(e instanceof f7,"Invalid public key");var r=e.toString("hex"),i=t.network||"mainnet",n=t.path||"",o="did:smartledger:"+r;return i!=="mainnet"&&(o+=":"+i),n&&(o+=":"+n),o};Ct.fromPrivateKey=function(e,t){return typeof e=="string"&&(e=P1.fromWIF(e)),En.checkArgument(e instanceof P1,"Invalid private key"),Ct.fromPublicKey(e.toPublicKey(),t)};Ct.parseDID=function(e){if(En.checkArgument(typeof e=="string","DID must be a string"),!e.startsWith("did:smartledger:"))throw new Error("Invalid SmartLedger DID format");var t=e.split(":");if(t.length<3)throw new Error("Invalid DID format");var r={method:"smartledger",identifier:t[2],network:"mainnet",path:""};return t.length>3&&t[3]!==""&&(r.network=t[3]),t.length>4&&(r.path=t.slice(4).join(":")),r};Ct.isValidDID=function(e){try{var t=Ct.parseDID(e);return!(!/^[0-9a-fA-F]{66}$/.test(t.identifier)&&!/^[0-9a-fA-F]{130}$/.test(t.identifier)||!["mainnet","testnet","regtest"].includes(t.network))}catch{return!1}};Ct.getPublicKey=function(e){var t=Ct.parseDID(e);return f7.fromString(t.identifier)};Ct.createDocument=function(e,t){t=t||{},En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.getPublicKey(e),i=e+"#keys-1",n={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/secp256k1-2019/v1"],id:e,verificationMethod:[{id:i,type:"EcdsaSecp256k1VerificationKey2019",controller:e,publicKeyHex:r.toString("hex")}],authentication:[i],assertionMethod:[i],keyAgreement:[i],capabilityInvocation:[i],capabilityDelegation:[i]};return t.services&&Array.isArray(t.services)&&(n.service=t.services),t.verificationMethods&&(n.verificationMethod=n.verificationMethod.concat(t.verificationMethods)),t.created&&(n.created=t.created),t.updated&&(n.updated=t.updated),n};Ct.resolve=async function(e,t){t=t||{};try{En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.createDocument(e,t);return{"@context":"https://w3id.org/did-resolution/v1",didDocument:r,didResolutionMetadata:{contentType:"application/did+ld+json",retrieved:new Date().toISOString()},didDocumentMetadata:{method:{published:!0,recoveryCommitment:null,updateCommitment:null}}}}catch(i){return{"@context":"https://w3id.org/did-resolution/v1",didDocument:null,didResolutionMetadata:{error:"notFound",errorMessage:i.message},didDocumentMetadata:{}}}};Ct.verifyOwnership=function(e,t,r){try{var i=Ct.getPublicKey(e),n=fD.sha256(h.Buffer.isBuffer(r)?r:h.Buffer.from(r,"utf8")),o=qs.crypto.Signature.fromString(t),a=new qs.crypto.ECDSA;return a.hashbuf=n,a.pubkey=i,a.sig=o,a.verify()===!0}catch{return!1}};Ct.signMessage=function(e,t){En.checkArgument(t instanceof P1,"Invalid private key");var r=fD.sha256(h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8")),i=new qs.crypto.ECDSA;return i.hashbuf=r,i.privkey=t,i.pubkey=t.toPublicKey(),i.sign().toString()};Ct.createProofOfOwnership=function(e,t){En.checkArgument(e instanceof P1,"Invalid private key"),En.checkArgument(typeof t=="string","Challenge must be a string");var r=Ct.fromPrivateKey(e),i=new Date().toISOString(),n=t+":"+i+":"+r,o=Ct.signMessage(n,e);return{type:"EcdsaSecp256k1Signature2019",created:i,verificationMethod:r+"#keys-1",proofPurpose:"authentication",challenge:t,jws:o}};Ct.verifyProofOfOwnership=function(e,t){try{En.checkArgument(e&&typeof e=="object","Invalid proof object"),En.checkArgument(typeof t=="string","DID must be a string");var r=e.challenge+":"+e.created+":"+t;return Ct.verifyOwnership(t,e.jws,r)}catch{return!1}};Ct.createDIDURL=function(e,t){return En.checkArgument(typeof e=="string","DID must be a string"),En.checkArgument(typeof t=="string","Fragment must be a string"),e+"#"+t};Ct.generateTestDID=function(e){e=e||{};var t=new P1,r=Ct.fromPrivateKey(t,e),i=Ct.createDocument(r,e);return{did:r,privateKey:t.toWIF(),publicKey:t.toPublicKey().toString("hex"),document:i}};cD.exports=Ct});var o5=k((Tve,dD)=>{"use strict";v();var Ll=Te(),Eoe=n5(),lD=Ll.PrivateKey,Us=Ll.crypto.Hash,hD=Ll.crypto.ECDSA,Ave=Ll.crypto.Signature,Fs=Ll.util.preconditions,Pve=xt();function hr(e,t){return this instanceof hr?(typeof e=="string"&&(e=lD.fromWIF(e)),Fs.checkArgument(e instanceof lD,"Invalid private key"),this.privateKey=e,this.publicKey=e.toPublicKey(),this.options=t||{},this.did=Eoe.fromPrivateKey(e,this.options),this):new hr(e,t)}hr._sortValue=function(e){return Array.isArray(e)?e.map(function(t){return hr._sortValue(t)}):e!==null&&typeof e=="object"?Object.keys(e).sort().reduce(function(t,r){return t[r]=hr._sortValue(e[r]),t},{}):e};hr._canonicalizeJSON=function(e){return JSON.stringify(hr._sortValue(e))};hr._hashCredential=function(e){var t=hr._canonicalizeJSON(e);return Us.sha256(h.Buffer.from(t,"utf8"))};hr.prototype.createCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid credential subject");var r=new Date().toISOString(),i=t.id||"urn:uuid:"+this._generateUUID(),n={"@context":["https://www.w3.org/2018/credentials/v1"],id:i,type:["VerifiableCredential"],issuer:this.did,issuanceDate:r,credentialSubject:e};return t.type&&(Array.isArray(t.type)?n.type=n.type.concat(t.type):n.type.push(t.type)),t.context&&(Array.isArray(t.context)?n["@context"]=n["@context"].concat(t.context):n["@context"].push(t.context)),t.expirationDate&&(n.expirationDate=t.expirationDate),t.termsOfUse&&(n.termsOfUse=t.termsOfUse),t.evidence&&(n.evidence=t.evidence),t.refreshService&&(n.refreshService=t.refreshService),n};hr.prototype.signCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid credential");var r=JSON.parse(JSON.stringify(e));delete r.proof;var i=hr._hashCredential(r),n=new hD;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:t.proofPurpose||"assertionMethod",jws:a};t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain);var u=JSON.parse(JSON.stringify(r));return u.proof=s,u.rootHash=i.toString("hex"),u};hr.prototype._createJWSSignature=function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o};hr.prototype.createEmailCredential=function(e,t){t=t||{},Fs.checkArgument(typeof e=="string"&&e.includes("@"),"Invalid email address");var r={id:t.subjectId||"did:smartledger:"+Us.sha256(h.Buffer.from(e)).toString("hex"),email:e,verified:!0,verificationMethod:"email_verification",verificationTimestamp:new Date().toISOString()},i={type:"EmailVerifiedCredential",context:"https://smartledger.technology/contexts/email/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};hr.prototype.createAgeCredential=function(e,t,r){r=r||{},Fs.checkArgument(typeof e=="number"&&e>0,"Invalid age");var i={id:r.subjectId||"urn:uuid:"+this._generateUUID(),ageOver:e,verified:!0,verificationMethod:"age_verification"};t&&(i.birthDateHash=Us.sha256(h.Buffer.from(t.toISOString())).toString("hex"));var n={type:"AgeVerifiedCredential",context:"https://smartledger.technology/contexts/age/v1",...r},o=this.createCredential(i,n);return this.signCredential(o,r)};hr.prototype.createKYCCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid KYC data");var r={id:t.subjectId||"urn:uuid:"+this._generateUUID(),kycLevel:e.level||"basic",verified:!0,verificationMethod:"kyc_verification",verificationTimestamp:new Date().toISOString(),verifyingAuthority:e.authority||this.did};e.firstName&&(r.firstNameHash=Us.sha256(h.Buffer.from(e.firstName)).toString("hex")),e.lastName&&(r.lastNameHash=Us.sha256(h.Buffer.from(e.lastName)).toString("hex")),e.ssn&&(r.ssnHash=Us.sha256(h.Buffer.from(e.ssn)).toString("hex"));var i={type:"KYCVerifiedCredential",context:"https://smartledger.technology/contexts/kyc/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};hr.prototype.createOrganizationCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid organization data");var r={id:t.subjectId||"did:smartledger:org:"+Us.sha256(h.Buffer.from(e.name||"")).toString("hex"),name:e.name,type:e.type||"Organization",verified:!0,verificationMethod:"organization_verification",verificationTimestamp:new Date().toISOString()};e.taxId&&(r.taxIdHash=Us.sha256(h.Buffer.from(e.taxId)).toString("hex")),e.incorporationState&&(r.incorporationState=e.incorporationState),e.industry&&(r.industry=e.industry);var i={type:"OrganizationCredential",context:"https://smartledger.technology/contexts/organization/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};hr.prototype._generateUUID=function(){var e=Ll.crypto.Random.getRandomBuffer(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;var t=e.toString("hex");return[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20,32)].join("-")};hr.prototype.createPresentation=function(e,t){t=t||{},Fs.checkArgument(Array.isArray(e),"Credentials must be an array");var r={"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],id:t.id||"urn:uuid:"+this._generateUUID(),holder:this.did,verifiableCredential:e};t.context&&(Array.isArray(t.context)?r["@context"]=r["@context"].concat(t.context):r["@context"].push(t.context));var i=hr._hashCredential(r),n=new hD;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:"authentication",jws:a};return t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain),r.proof=s,r};hr.prototype.getIssuerInfo=function(){return{did:this.did,publicKey:this.publicKey.toString("hex"),verificationMethod:this.did+"#keys-1"}};dD.exports=hr});var mD=k((Mve,vD)=>{"use strict";v();var T1=Te(),a5=n5(),c7=o5(),Rve=T1.PublicKey,Bve=T1.crypto.Hash,pD=T1.crypto.ECDSA,Ooe=T1.crypto.Signature,gD=T1.util.preconditions;function Mt(e){return this instanceof Mt?(this.options=e||{},this.trustedIssuers=this.options.trustedIssuers||[],this):new Mt(e)}Mt.verifyCredential=async function(e,t){t=t||{};try{gD.checkArgument(e&&typeof e=="object","Invalid credential");var r={valid:!1,errors:[],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}},i=Mt._validateStructure(e);r.checks.structure=i.valid,i.valid||(r.errors=r.errors.concat(i.errors));var n=await Mt._verifySignature(e);r.checks.signature=n.valid,n.valid?(r.issuerDID=n.issuerDID,r.verificationMethod=n.verificationMethod):r.errors=r.errors.concat(n.errors);var o=await Mt._validateIssuer(e,t);r.checks.issuer=o.valid,o.valid||(r.errors=r.errors.concat(o.errors)),o.warnings&&(r.warnings=r.warnings.concat(o.warnings));var a=Mt._validateTemporal(e);if(r.checks.temporal=a.valid,a.valid||(r.errors=r.errors.concat(a.errors)),a.warnings&&(r.warnings=r.warnings.concat(a.warnings)),t.schema){var s=Mt._validateSchema(e,t.schema);r.checks.schema=s.valid,s.valid||(r.errors=r.errors.concat(s.errors))}else r.checks.schema=!0;return r.valid=Object.values(r.checks).every(u=>u===!0),r}catch(u){return{valid:!1,errors:["Verification failed: "+u.message],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}}}};Mt.verifyPresentation=async function(e,t){t=t||{};try{gD.checkArgument(e&&typeof e=="object","Invalid presentation");var r={valid:!1,errors:[],warnings:[],credentialResults:[],presentationValid:!1};if(!e.type||!e.type.includes("VerifiablePresentation"))return r.errors.push("Invalid presentation type"),r;if(!e.holder)return r.errors.push("Missing presentation holder"),r;var i=await Mt._verifyPresentationSignature(e);if(r.presentationValid=i.valid,i.valid||(r.errors=r.errors.concat(i.errors)),e.verifiableCredential&&Array.isArray(e.verifiableCredential))for(var n=0;n<e.verifiableCredential.length;n++){var o=e.verifiableCredential[n],a=await Mt.verifyCredential(o,t);r.credentialResults.push({index:n,result:a}),a.valid||r.errors.push("Credential "+n+" is invalid")}var s=r.credentialResults.every(u=>u.result.valid);return r.valid=r.presentationValid&&s,r}catch(u){return{valid:!1,errors:["Presentation verification failed: "+u.message],warnings:[],credentialResults:[],presentationValid:!1}}};Mt._validateStructure=function(e){var t=[];return e["@context"]?Array.isArray(e["@context"])?e["@context"].includes("https://www.w3.org/2018/credentials/v1")||t.push("Missing required W3C credentials context"):t.push("@context must be an array"):t.push("Missing @context"),e.type?Array.isArray(e.type)?e.type.includes("VerifiableCredential")||t.push("Must include VerifiableCredential type"):t.push("type must be an array"):t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof"),{valid:t.length===0,errors:t}};Mt._normalizeDID=function(e){var t=e&&typeof e=="object"?e.id:e;return typeof t!="string"||t.length===0?null:t.split("#")[0]};Mt._verifySignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing proof"]};if(t.type!=="EcdsaSecp256k1Signature2019")return{valid:!1,errors:["Unsupported proof type: "+t.type]};if(!t.verificationMethod)return{valid:!1,errors:["Missing verification method"]};if(!t.jws)return{valid:!1,errors:["Missing JWS signature"]};var r=t.verificationMethod,i=r.split("#")[0],n=Mt._normalizeDID(e.issuer);if(!n)return{valid:!1,errors:["Missing or invalid credential issuer"]};if(n!==i)return{valid:!1,errors:["Verification method DID ("+i+") does not match credential issuer ("+n+")"]};var o=a5.getPublicKey(i),a=JSON.parse(JSON.stringify(e));delete a.proof,delete a.rootHash;var s=c7._hashCredential(a),u=Mt._parseJWSSignature(t.jws),c=new pD;c.hashbuf=s,c.pubkey=o,c.sig=u;var l=c.verify();return l?{valid:!0,issuerDID:i,verificationMethod:r}:{valid:!1,errors:["Signature verification failed"]}}catch(m){return{valid:!1,errors:["Signature verification error: "+m.message]}}};Mt._parseJWSSignature=function(e){var t=e.split(".");if(t.length!==3)throw new Error("Invalid JWS format");var r=t[2],i=h.Buffer.from(r,"base64url");return Ooe.fromDER(i)};Mt._verifyPresentationSignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing presentation proof"]};var r=e.holder,i=a5.getPublicKey(r),n=JSON.parse(JSON.stringify(e));delete n.proof;var o=c7._hashCredential(n),a=Mt._parseJWSSignature(t.jws),s=new pD;s.hashbuf=o,s.pubkey=i,s.sig=a;var u=s.verify();return{valid:u,errors:u?[]:["Presentation signature verification failed"]}}catch(c){return{valid:!1,errors:["Presentation signature error: "+c.message]}}};Mt._validateIssuer=async function(e,t){var r=[],i=[];try{var n=e.issuer;if(!a5.isValidDID(n))return r.push("Invalid issuer DID format"),{valid:!1,errors:r};var o=await a5.resolve(n);if(!o.didDocument)return r.push("Unable to resolve issuer DID"),{valid:!1,errors:r};if(t.trustedIssuers&&Array.isArray(t.trustedIssuers)){var a=Mt._normalizeDID(n),s=t.trustedIssuers.map(function(u){return Mt._normalizeDID(u)}).filter(Boolean);if(!a||s.indexOf(a)===-1)return r.push("Issuer not in trusted list"),{valid:!1,errors:r,warnings:i}}return{valid:r.length===0,errors:r,warnings:i}}catch(u){return{valid:!1,errors:["Issuer validation error: "+u.message],warnings:i}}};Mt._validateTemporal=function(e){var t=[],r=[],i=new Date;if(e.issuanceDate){var n=new Date(e.issuanceDate);isNaN(n.getTime())?t.push("Invalid issuanceDate format"):n>i&&t.push("Credential issued in the future")}if(e.expirationDate){var o=new Date(e.expirationDate);isNaN(o.getTime())?t.push("Invalid expirationDate format"):o<=i?t.push("Credential has expired"):o<=new Date(i.getTime()+1440*60*1e3)&&r.push("Credential expires within 24 hours")}return{valid:t.length===0,errors:t,warnings:r}};Mt._validateSchema=function(e,t){var r=[];if(t.requiredFields&&t.requiredFields.forEach(function(n){Mt._getNestedProperty(e,n)||r.push("Missing required field: "+n)}),t.requiredTypes){var i=t.requiredTypes.some(function(n){return e.type&&e.type.includes(n)});i||r.push("Missing required credential type")}return{valid:r.length===0,errors:r}};Mt._getNestedProperty=function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)};Mt.verifyCredentialHash=function(e){try{if(!e.rootHash)return!1;var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.rootHash;var r=c7._hashCredential(t),i=h.Buffer.from(e.rootHash,"hex");return h.Buffer.compare(r,i)===0}catch{return!1}};Mt.extractClaims=function(e){try{var t={issuer:e.issuer,subject:e.credentialSubject.id||"unknown",types:e.type||[],issuanceDate:e.issuanceDate,expirationDate:e.expirationDate,claims:{}};return Object.keys(e.credentialSubject).forEach(function(r){r!=="id"&&(t.claims[r]=e.credentialSubject[r])}),t}catch{return null}};Mt.createReport=function(e){var t=[];return t.push("=== Credential Verification Report ==="),t.push("Overall Status: "+(e.valid?"VALID":"INVALID")),t.push(""),t.push("Verification Checks:"),Object.keys(e.checks).forEach(function(r){var i=e.checks[r]?"\u2713":"\u2717";t.push(" "+i+" "+r.charAt(0).toUpperCase()+r.slice(1))}),t.push(""),e.errors.length>0&&(t.push("Errors:"),e.errors.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.warnings.length>0&&(t.push("Warnings:"),e.warnings.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.issuerDID&&t.push("Issuer: "+e.issuerDID),e.verificationMethod&&t.push("Verification Method: "+e.verificationMethod),t.join(`
|
|
98
|
+
`)}function Xne(e){return console.log(mC(e)),e}yC.exports={trace:$ne,format:mC,print:Xne,opLabel:vC}});var wC=k((uve,_C)=>{"use strict";v();var S1=Te(),ie={Covenant:uN(),Preimage:Vo(),SIGHASH:lN(),Builder:dN(),UTXOGenerator:SN(),ScriptTester:EN(),CovenantBuilder:O8().CovenantBuilder,CovenantTemplates:O8().CovenantTemplates,OpcodeMap:S8(),ScriptUtils:RN(),StackExaminer:MN(),ScriptInterpreter:LN(),CovenantHelpers:Go(),Locks:ZN(),PushTx:Tl(),PELS:F8(),Token:G8(),Authorizers:z8(),DSL:Q8(),Policy:Q8().Policy,Debugger:bC()};ie.policy=ie.DSL.policy;ie.trace=function(e,t,r){return ie.Debugger.trace(e,t,r)};ie.enableGenesis=function(e){return ie.CovenantHelpers.enableGenesis(e)};ie.verifyScript=function(e,t,r){return ie.CovenantHelpers.verify(e,t,r)};ie.perpetualCovenant=function(e){return ie.PELS.pelsCovenant(e)};ie.ownershipToken=function(e,t){return ie.Token.ownershipToken(e,t)};ie.valueCovenant=function(e){return ie.PushTx.valueCovenant(e)};ie.ordinalLock=function(e,t){return ie.Token.ordinalLock(e,t)};ie.transferOrdinal=function(e,t,r,i,n,o){return ie.Token.transferOrdinal(e,t,r,i,n,o)};ie.createCovenant=function(e,t){return new ie.Covenant(e,t)};ie.extractPreimage=function(e,t){return new ie.Preimage(e,t)};ie.analyzeSIGHASH=function(e){return new ie.SIGHASH(e)};ie.buildCovenant=function(e,t){return new ie.Builder(e,t)};ie.createUTXOGenerator=function(e){return new ie.UTXOGenerator(e)};ie.createTestEnvironment=function(e){return ie.UTXOGenerator.createTestEnvironment(e)};ie.testScript=function(e,t,r){return ie.ScriptTester.test(e,t,r)};ie.testCovenant=function(e,t,r){return ie.ScriptTester.testCovenant(e,t,r)};ie.testFieldExtraction=function(e,t,r){return ie.ScriptTester.testFieldExtraction(e,t,r)};ie.debugScript=function(e,t){var r=new ie.ScriptTester(t);return r.debug(e)};ie.explainZeroHashes=function(){return ie.SIGHASH.explainZeroMystery()};ie.getAllSIGHASHTypes=function(){return ie.SIGHASH.getAllTypes()};ie.demonstrateAllSIGHASH=function(){return ie.SIGHASH.generateAllDemonstrations()};ie.createCovenantBuilder=function(){return new ie.CovenantBuilder};ie.createValueLockCovenant=function(e){return ie.CovenantTemplates.valueLock(e)};ie.createHashLockCovenant=function(e){return ie.CovenantTemplates.hashLock(e)};ie.createComplexValidationCovenant=function(e){return ie.CovenantTemplates.complexValidation(e)};ie.getOpcodeMap=function(){return ie.OpcodeMap.opcodeMap};ie.simulateScript=function(e,t){return ie.OpcodeMap.utils.simulate(e,t)};ie.createASMFromJS=function(e){return ie.OpcodeMap.utils.createASM(e)};ie.scriptToASM=function(e){return ie.ScriptUtils.scriptToASM(e)};ie.asmToScript=function(e){return ie.ScriptUtils.asmToScript(e)};ie.asmToHex=function(e){return ie.ScriptUtils.asmToHex(e)};ie.hexToASM=function(e){return ie.ScriptUtils.hexToASM(e)};ie.scriptToHex=function(e){return ie.ScriptUtils.scriptToHex(e)};ie.validateASM=function(e){return ie.ScriptUtils.validateASM(e)};ie.validateScript=function(e){return ie.ScriptUtils.validateScript(e)};ie.estimateScriptSize=function(e){return ie.ScriptUtils.estimateScriptSize(e)};ie.optimizeScript=function(e){return ie.ScriptUtils.optimizeScript(e)};ie.compareScripts=function(e,t){return ie.ScriptUtils.compareScripts(e,t)};ie.explainScript=function(e){return ie.ScriptUtils.explainScript(e)};ie.scriptMetrics=function(e){return ie.ScriptUtils.scriptMetrics(e)};ie.analyzeComplexity=function(e){return ie.ScriptUtils.analyzeComplexity(e)};ie.findOptimizations=function(e){return ie.ScriptUtils.findOptimizations(e)};ie.covenantToEnglish=function(e){return ie.ScriptUtils.covenantToEnglish(e)};ie.batchTestScripts=function(e,t){return ie.ScriptUtils.batchTestScripts(e,t)};ie.examineStack=function(e,t){return ie.StackExaminer.runScript(e,t)};ie.debugScriptExecution=function(e,t,r){return r=r||{},r.stepMode?ie.ScriptInterpreter.stepThroughScript(ie.ScriptInterpreter.parseScript(e+" "+t),new S1.Transaction,!0):ie.ScriptInterpreter.runFullEvaluation(ie.ScriptInterpreter.parseScript(e),ie.ScriptInterpreter.parseScript(t),new S1.Transaction)};ie.parseScript=function(e){return ie.ScriptInterpreter.parseScript(e)};ie.printStack=function(e,t){return ie.ScriptInterpreter.printStack(e,t)};ie.createQuickCovenant=function(e,t){let r=ie.createCovenantBuilder();switch(e){case"value_lock":return r.comment(`Value lock: minimum ${t.value} satoshis`).extractField("value").push(t.value).greaterThanOrEqual().verify().build();case"hash_lock":return r.comment(`Hash lock: requires preimage of ${t.hash}`).push("secret_placeholder").sha256().push(t.hash).equalVerify().build();case"time_lock":return r.comment(`Time lock: requires nLockTime > ${t.timestamp}`).extractField("nLockTime").push(t.timestamp).greaterThan().verify().build();case"multi_condition":let i=r.comment("Multi-condition covenant");return t.conditions.forEach(n=>{switch(n.type){case"value":i=i.extractField("value").push(n.value).greaterThanOrEqual().verify();break;case"hash":i=i.push("secret_placeholder").sha256().push(n.hash).equalVerify();break;case"time":i=i.extractField("nLockTime").push(n.timestamp).greaterThan().verify();break}}),i.build();default:throw new Error(`Unknown covenant type: ${e}`)}};ie.completeCovenantFlow=function(e,t,r){var i=new ie.Covenant(e);return i.completeFlow(t,r)};ie.getEducationalResources=function(){return{zeroHashMystery:ie.SIGHASH.explainZeroMystery(),sighashTypes:ie.SIGHASH.getAllTypes(),exampleDemonstrations:ie.SIGHASH.generateAllDemonstrations()}};ie.utils={};ie.utils.reconstructP2pkhScript=function(e){return S1.Script.buildPublicKeyHashOut(e).toHex()};ie.utils.createCovenantAddress=function(e){var t=S1.crypto.Hash.sha256ripemd160(e.toBuffer());return S1.Address.fromScriptHash(t)};ie.utils.decodeCompactSize=function(e,t){return ie.Preimage.decodeCompactSize(e,t)};ie.version=zm();ie.description="Smart Contract Framework for Bitcoin SV";ie.features={BIP143_PREIMAGE:!0,COMPACT_SIZE_VARINT:!0,BIDIRECTIONAL_EXTRACTION:!0,SIGHASH_DETECTION:!0,ZERO_HASH_WARNINGS:!0,MULTI_FIELD_VALIDATION:!0,REAL_UTXO_GENERATION:!0,SCRIPT_TESTING:!0,LOCAL_VERIFICATION:!0,JAVASCRIPT_TO_SCRIPT:!0,OPCODE_MAPPING:!0,COVENANT_BUILDER:!0,SCRIPT_ANALYSIS:!0,SCRIPT_OPTIMIZATION:!0,SCRIPT_CONVERSION:!0,BATCH_TESTING:!0,QUICK_COVENANTS:!0,SCRIPT_EXPLANATIONS:!0,STACK_EXAMINATION:!0,SCRIPT_DEBUGGING:!0,STEP_BY_STEP_EXECUTION:!0,INTERACTIVE_DEBUGGING:!0};ie.interpretScript=ie.debugScriptExecution;ie.getScriptMetrics=ie.scriptMetrics;_C.exports=ie});var SC=k((cve,x1)=>{"use strict";v();var W6=function(){var e=typeof A.default<"u"&&A.default.env&&A.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)},Xa={MEMORY:"memory",SESSION:"session",LOCAL:"local"};function xi(e){e=e||{},this.options={storage:e.storage||Xa.MEMORY,storageKey:e.storageKey||"smartledger-utxos",autoSave:e.autoSave!==!1,maxUTXOs:e.maxUTXOs||1e3};var t=[Xa.MEMORY,Xa.SESSION,Xa.LOCAL];if(t.indexOf(this.options.storage)===-1)throw new Error("Invalid storage type: "+this.options.storage);this.utxos=new Map,this.addressIndex=new Map,this.spentUTXOs=new Map,this.metadata={totalUTXOs:0,totalValue:0,createdAt:new Date().toISOString(),lastModified:new Date().toISOString()},this.loadFromStorage()}xi.prototype.getStorage=function(){return this.options.storage===Xa.SESSION?typeof sessionStorage<"u"?sessionStorage:null:this.options.storage===Xa.LOCAL&&typeof localStorage<"u"?localStorage:null};xi.prototype.loadFromStorage=function(){var e=this.getStorage();if(e)try{var t=e.getItem(this.options.storageKey);if(!t)return;var r=JSON.parse(t);if(!r.utxos)return;var i=this;r.utxos.forEach(function(n){var o=n.txid+":"+n.vout;i.utxos.set(o,n),i.addressIndex.has(n.address)||i.addressIndex.set(n.address,new Set),i.addressIndex.get(n.address).add(o)}),r.metadata&&(this.metadata=r.metadata),W6("\u2705 BrowserUTXOManager: Loaded "+this.utxos.size+" UTXOs from "+this.options.storage+" storage")}catch(n){console.error("Failed to load UTXOs from storage:",n)}};xi.prototype.saveToStorage=function(){if(this.options.storage!==Xa.MEMORY){var e=this.getStorage();if(e)try{var t={utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",timestamp:new Date().toISOString()};e.setItem(this.options.storageKey,JSON.stringify(t)),W6("\u{1F4BE} BrowserUTXOManager: Saved "+this.utxos.size+" UTXOs to "+this.options.storage+" storage")}catch(r){console.error("Failed to save UTXOs to storage:",r)}}};xi.prototype.addUTXO=function(e){if(!e||!e.txid||typeof e.vout!="number")throw new Error("Invalid UTXO: missing txid or vout");var t=e.txid+":"+e.vout;if(this.utxos.has(t))return W6("\u26A0\uFE0F UTXO already exists: "+t),!1;var r={txid:e.txid,vout:e.vout,address:e.address||"",satoshis:e.satoshis||0,script:e.script||"",status:"available",addedAt:new Date().toISOString()};return this.utxos.set(t,r),r.address&&(this.addressIndex.has(r.address)||this.addressIndex.set(r.address,new Set),this.addressIndex.get(r.address).add(t)),this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),!0};xi.prototype.getUTXOsForAddress=function(e){var t=this.addressIndex.get(e);if(!t)return[];var r=[],i=this;return t.forEach(function(n){var o=i.utxos.get(n);o&&o.status==="available"&&r.push(o)}),r};xi.prototype.getBalance=function(e){var t=this.getUTXOsForAddress(e);return t.reduce(function(r,i){return r+(i.satoshis||0)},0)};xi.prototype.spendUTXOs=function(e,t){t=t||"browser-spend";for(var r=[],i=0;i<e.length;i++){var n=e[i],o=n.txid+":"+n.vout,a=this.utxos.get(o);a&&a.status==="available"&&(a.status="spent",a.spentAt=new Date().toISOString(),a.spentInTx=t,this.spentUTXOs.set(o,{txid:a.txid,vout:a.vout,spentInTx:t,spentAt:a.spentAt}),r.push(a))}return this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),r};xi.prototype.getUTXO=function(e,t){var r=e+":"+t,i=this.utxos.get(r);return{exists:!!i,utxo:i,status:i?i.status:"not-found"}};xi.prototype.createMockUTXOs=function(e,t,r){t=t||5,r=r||1e5;for(var i=[],n=0;n<t;n++){for(var o="",a=0;a<64;a++)o+=Math.floor(Math.random()*16).toString(16);var s={txid:o,vout:n,address:e,satoshis:r+Math.floor(Math.random()*1e4),script:"",status:"available"};this.addUTXO(s),i.push(s)}return i};xi.prototype.getStats=function(){var e=0,t=0,r=0;return this.utxos.forEach(function(i){e+=i.satoshis||0,i.status==="available"?t++:i.status==="spent"&&r++}),{totalUTXOs:this.utxos.size,totalAvailable:t,totalSpent:r,totalValue:e,totalAddresses:this.addressIndex.size,storageType:this.options.storage,metadata:this.metadata}};xi.prototype.updateMetadata=function(){var e=this.getStats();this.metadata.totalUTXOs=e.totalUTXOs,this.metadata.totalValue=e.totalValue,this.metadata.lastModified=new Date().toISOString()};xi.prototype.exportData=function(){return JSON.stringify({utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",exportedAt:new Date().toISOString()})};xi.prototype.importData=function(e,t){t=t||!1;try{var r=JSON.parse(e);if(t||(this.utxos.clear(),this.addressIndex.clear(),this.spentUTXOs.clear()),r.utxos&&Array.isArray(r.utxos)){var i=this;r.utxos.forEach(function(n){i.addUTXO(n)})}return W6("\u2705 BrowserUTXOManager: Imported "+(r.utxos&&r.utxos.length||0)+" UTXOs"),!0}catch(n){return console.error("Failed to import UTXO data:",n),!1}};typeof x1<"u"&&x1.exports?(x1.exports=xi,x1.exports.STORAGE_TYPES=Xa):typeof window<"u"&&(window.BrowserUTXOManager=xi,window.BrowserUTXOManager.STORAGE_TYPES=Xa)});var EC=k((hve,xC)=>{"use strict";v();var e7=class{constructor(t,r={}){this.bsv=t,this.options={difficulty:r.difficulty||1,blockTime:r.blockTime||1e4,validateScripts:r.validateScripts!==!1,logLevel:r.logLevel||"info",...r},this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[]}acceptTransaction(t){try{return this.options.validateScripts&&!this.validateTransactionSignatures(t)?(this.log("warn","\u274C Transaction rejected: Invalid signatures"),!1):(this.mempool.push(t),this.log("info",`\u2705 Transaction accepted into mempool: ${t.id||"unknown"}`),!0)}catch(r){return this.log("error",`\u274C Transaction rejected: ${r.message}`),!1}}validateTransactionSignatures(t){try{let r=t.verify();return this.log("debug",`\u{1F4CA} Transaction verification result: ${r}`),r===!0}catch(r){return this.log("warn",`\u26A0\uFE0F Signature validation error: ${r.message}`),!1}}mineBlock(t=10){let r=this.mempool.splice(0,t),i={height:this.currentBlock.height+1,timestamp:Date.now(),transactions:r,transactionCount:r.length,previousBlockHash:this.currentBlock.hash||"0000000000000000000000000000000000000000000000000000000000000000"},n=JSON.stringify({height:i.height,timestamp:i.timestamp,previousBlockHash:i.previousBlockHash,transactions:r.map(o=>o.id||o.toString())});return i.hash=this.bsv.crypto.Hash.sha256(h.Buffer.from(n)).toString("hex"),this.currentBlock=i,this.log("info",`\u26CF\uFE0F Mined block ${i.height} with ${r.length} transactions`),this.log("debug",`\u{1F4E6} Block hash: ${i.hash}`),i}getMempoolStats(){return{transactionCount:this.mempool.length,transactions:this.mempool.map(t=>({id:t.id||"unknown",size:t.toBuffer?t.toBuffer().length:0,inputs:t.inputs?t.inputs.length:0,outputs:t.outputs?t.outputs.length:0}))}}getBlockchainStats(){return{currentHeight:this.currentBlock.height,currentBlockHash:this.currentBlock.hash,currentBlockTimestamp:this.currentBlock.timestamp,mempoolSize:this.mempool.length,difficulty:this.options.difficulty,blockTime:this.options.blockTime}}reset(){this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[],this.log("info","\u{1F504} Miner reset to genesis state")}log(t,r){let i={error:0,warn:1,info:2,debug:3},n=i[this.options.logLevel]||2;if(i[t]<=n){let o=new Date().toISOString();console.log(`[${o}] [${t.toUpperCase()}] ${r}`)}}};xC.exports=e7});var IC=k((pve,OC)=>{v();var Ne=Te(),Bl=class{static createSignature(t,r,i,n,o,a=null){a=a||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;let s=Ne.Transaction.sighash.sign(t,r,a,i,n,new Ne.crypto.BN(o));return h.Buffer.concat([s.toDER(),h.Buffer.from([a])])}static createMultisigScript(t,r){let i=new Ne.Script().add(Ne.Opcode[`OP_${t}`]);for(let n of r)i=i.add(n.toBuffer());return i.add(Ne.Opcode[`OP_${r.length}`]).add(Ne.Opcode.OP_CHECKMULTISIG)}static createMultisigUnlocking(t){let r=new Ne.Script().add(Ne.Opcode.OP_0);for(let i of t)r=r.add(i);return r}static createTimelockScript(t,r){let i=h.Buffer.from(t.toString(16).padStart(8,"0"),"hex").reverse();return new Ne.Script().add(i).add(Ne.Opcode.OP_CHECKLOCKTIMEVERIFY).add(Ne.Opcode.OP_DROP).add(r.toBuffer())}static createConditionalScript(t,r=null){let i=new Ne.Script().add(Ne.Opcode.OP_IF).add(t.toBuffer());return r&&(i=i.add(Ne.Opcode.OP_ELSE).add(r.toBuffer())),i.add(Ne.Opcode.OP_ENDIF)}static createP2PKHScript(t){return new Ne.Script().add(Ne.Opcode.OP_DUP).add(Ne.Opcode.OP_HASH160).add(t.toAddress().hashBuffer).add(Ne.Opcode.OP_EQUALVERIFY).add(Ne.Opcode.OP_CHECKSIG)}static createP2PKHUnlocking(t,r){return new Ne.Script().add(t).add(r.toBuffer())}static getPreimage(t,r,i,n,o=null){return o=o||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID,Ne.Transaction.sighash.sighash(t,o,r,i,new Ne.crypto.BN(n))}static createDataScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(t)}static createOpReturnScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(Ne.Opcode.OP_FALSE).add(Ne.Opcode.OP_RETURN).add(t)}static validateTransaction(t){try{return t.verify()}catch(r){return console.error("Transaction validation error:",r.message),!1}}static validateScript(t,r,i,n){try{return new Ne.Script.Interpreter().verify(t,r,i,n,Ne.Script.Interpreter.SCRIPT_VERIFY_P2SH|Ne.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|Ne.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID|Ne.Script.Interpreter.SCRIPT_ENABLE_MAGNETIC_OPCODES|Ne.Script.Interpreter.SCRIPT_ENABLE_MONOLITH_OPCODES)}catch(o){return console.error("Script validation error:",o.message),!1}}static createLowFeeTransaction(t,r,i=10){let n=new Ne.Transaction().feePerKb(i);for(let o of t)n=n.from(o);for(let o of r)n=n.to(o.address,o.satoshis);return n}};Bl.SIGHASH_ALL=Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;Bl.SIGHASH_NONE=Ne.crypto.Signature.SIGHASH_NONE|Ne.crypto.Signature.SIGHASH_FORKID;Bl.SIGHASH_SINGLE=Ne.crypto.Signature.SIGHASH_SINGLE|Ne.crypto.Signature.SIGHASH_FORKID;OC.exports=Bl});var Y6=k((vve,MC)=>{"use strict";v();var O1=Te(),PC=h.Buffer.from("ord","utf8");function t7(){return O1.Script}function TC(){return O1.Opcode}function kC(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"an array";var t=typeof e;return(t==="object"?"an ":"a ")+t}function AC(e,t){if(h.Buffer.isBuffer(e))return e;if(typeof e=="string")return h.Buffer.from(e,"utf8");throw new Error(t+" must be a string or Buffer, got "+kC(e))}var Jne=["data","body","payload","text","message"];function Qne(e){var t=t7(),r=e.lock!=null,i=e.address!=null;if(r&&i)throw new Error("buildInscription accepts `lock` or `address`, not both \u2014 they name different owners and one would be silently ignored");if(r){var n;if(e.lock instanceof t)n=e.lock;else if(h.Buffer.isBuffer(e.lock))n=t.fromBuffer(e.lock);else if(typeof e.lock=="string")n=t.fromHex(e.lock);else throw new Error("lock must be a Script, Buffer, or hex string, got "+kC(e.lock));if(!n.chunks.length&&!e.allowEmptyLock)throw new Error("lock is empty: the inscription would carry no locking script at all and the ordinal would be spendable by anyone. Pass a real lock, or { allowEmptyLock: true } if you are appending this envelope to your own script");return n}if(i){var o=e.address instanceof O1.Address?e.address:O1.Address.fromString(String(e.address));return t.buildPublicKeyHashOut(o)}throw new Error("buildInscription requires an address or a lock script")}function RC(e){e=e||{};var t=TC(),r=Qne(e);if(e.content==null){var i=Jne.filter(function(s){return e[s]!=null})[0];throw new Error("buildInscription requires `content`"+(i?" \u2014 received `"+i+"`, which is not read":"")+". Omitting it would inscribe an empty payload; pass content: '' if that is intended")}var n=AC(e.content,"content"),o;if(e.contentType==null){if(h.Buffer.isBuffer(e.content))throw new Error("contentType is required when content is a Buffer (e.g. 'image/png', 'application/octet-stream') \u2014 it cannot be inferred from bytes");o=h.Buffer.from("text/plain","utf8")}else if(o=AC(e.contentType,"contentType"),!o.length)throw new Error("contentType must not be empty");var a=t7().fromBuffer(r.toBuffer());return a.add(t.OP_FALSE),a.add(t.OP_IF),a.add(PC),a.add(t.OP_1),a.add(o),a.add(t.OP_0),a.add(n),a.add(t.OP_ENDIF),a}function E1(e,t){return e&&e.opcodenum===t&&e.buf==null}function BC(e){for(var t=t7(),r=TC(),i=e instanceof t?e:h.Buffer.isBuffer(e)?t.fromBuffer(e):t.fromHex(e),n=i.chunks,o=-1,a=0;a+2<n.length;a++)if(E1(n[a],r.OP_FALSE)&&E1(n[a+1],r.OP_IF)&&n[a+2].buf&&n[a+2].buf.equals(PC)){o=a;break}if(o===-1)return null;for(var s=h.Buffer.alloc(0),u=h.Buffer.alloc(0),c=n.length,l=o+3;l<n.length;l++){var m=n[l];if(E1(m,r.OP_ENDIF)){c=l;break}E1(m,r.OP_1)&&n[l+1]&&n[l+1].buf?(s=n[l+1].buf,l++):E1(m,r.OP_0)&&n[l+1]&&n[l+1].buf&&(u=n[l+1].buf,l++)}for(var w=new t,E=0;E<o;E++)w.chunks.push(n[E]);for(var P=c+1;P<n.length;P++)w.chunks.push(n[P]);return{contentType:s.toString("utf8"),content:u,contentText:u.toString("utf8"),lock:w}}function eoe(e){try{return BC(e)!==null}catch{return!1}}function toe(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;if(typeof t!="number"||!Number.isInteger(t)||t<1)throw new Error("satoshis must be a positive integer (1 for a standard 1Sat ordinal)");return new O1.Transaction.Output({script:RC(e),satoshis:t})}MC.exports={buildInscription:RC,parseInscription:BC,isInscription:eoe,createInscriptionOutput:toe}});var HC=k((yve,FC)=>{"use strict";v();var qr=Te(),Nl=Tl(),r7=Go(),DC=Y6(),Yo=qr.Script,Xt=qr.Opcode,LC=qr.encoding.BufferReader,J6=Nl.SIGHASH_ALL_ANYONECANPAY_FORKID;function NC(e,t){return t&&t.length?e.add(h.Buffer.from(t)):e.add(Xt.OP_0)}function $6(e){return e.toBufferWriter().toBuffer()}function Cl(e,t){if(typeof e!="number"||!isFinite(e)||e<0||Math.floor(e)!==e)throw new Error(t+" must be a non-negative integer number of satoshis (got "+e+")");return e}function e5(e){return e instanceof Yo?e:h.Buffer.isBuffer(e)?Yo.fromBuffer(e):Yo.fromHex(e)}function qC(e){return e instanceof qr.Address?e:e&&typeof e.toAddress=="function"?e.toAddress():qr.Address.fromString(String(e))}function roe(e){if(h.Buffer.isBuffer(e)){if(e.length!==20)throw new Error("seller pubkeyhash buffer must be 20 bytes (HASH160)");return e}return e instanceof qr.PublicKey?qr.crypto.Hash.sha256ripemd160(e.toBuffer()):qC(e).hashBuffer}function Dl(e,t){return Cl(t,"payment price"),new qr.Transaction.Output({script:Yo.buildPublicKeyHashOut(qC(e)),satoshis:t})}function X6(e){if(e instanceof qr.Transaction.Output)return e;if(h.Buffer.isBuffer(e))return qr.Transaction.Output.fromBufferReader(new LC(e));var t=e.payTo!=null?e.payTo:e.address,r=e.satoshis!=null?e.satoshis:e.price;if(t==null||r==null)throw new Error("payment spec needs {address|payTo, satoshis|price}");return Dl(t,r)}function ioe(e){if(e.payOutputs){if(!e.payOutputs.length)throw new Error("payOutputs must be a non-empty array");return e.payOutputs.map(X6)}if(e.payOutput!=null)return[X6(e.payOutput)];if(e.price!=null){var t=e.payTo!=null?e.payTo:e.seller,r=t instanceof qr.Transaction.Output?t:Dl(t,e.price),i=[r];return e.royalties&&e.royalties.forEach(function(n){i.push(X6(n))}),i}throw new Error("buildOrdLock requires a price, a payOutput, or payOutputs")}function noe(e){return h.Buffer.concat(e.map($6))}function t5(e){if(e=e||{},e.seller==null)throw new Error("buildOrdLock requires a seller");var t=roe(e.seller),r=noe(ioe(e)),i=new Yo;if(i.add(Xt.OP_IF),i.add(Xt.OP_DUP).add(Xt.OP_HASH160),i.add(h.Buffer.from(t)).add(Xt.OP_EQUALVERIFY).add(Xt.OP_CHECKSIG),i.add(Xt.OP_ELSE),i.add(Xt.OP_DUP),Nl.pushTxCore(i,{sighashType:J6}),i.add(Xt.OP_VERIFY),Nl.assertSighashType(i,J6),Nl.extractHashOutputs(i),i.add(Xt.OP_TOALTSTACK),i.add(h.Buffer.from(r)).add(Xt.OP_CAT),i.add(Xt.OP_SWAP).add(Xt.OP_CAT),i.add(Xt.OP_HASH256),i.add(Xt.OP_FROMALTSTACK).add(Xt.OP_EQUAL),i.add(Xt.OP_ENDIF),e.inscription){var n=DC.buildInscription({lock:new Yo,allowEmptyLock:!0,contentType:e.inscription.contentType,content:e.inscription.content});n.chunks.forEach(function(o){i.chunks.push(o)})}return i}function Ml(e,t){return e&&e.opcodenum===t&&e.buf==null}function CC(e){for(var t=new LC(e),r=[];!t.eof();)r.push(qr.Transaction.Output.fromBufferReader(t));return r}function r5(e,t){var r=t&&t.network;try{for(var i=e5(e),n=i.chunks,o=0,a=-1,s=-1,u=-1,c=0;c<n.length;c++)if(Ml(n[c],Xt.OP_IF))o===0&&(a=c),o++;else if(Ml(n[c],Xt.OP_ELSE)&&o===1)s=c;else if(Ml(n[c],Xt.OP_ENDIF)&&(o--,o===0)){u=c;break}if(a===-1||s===-1||u===-1)return null;for(var l=null,m=a+1;m<s;m++)if(n[m].buf&&n[m].buf.length===20){l=n[m].buf;break}if(!l)return null;for(var w=null,E=s+1;E<u;E++)Ml(n[E],Xt.OP_TOALTSTACK)&&n[E+1]&&n[E+1].buf&&Ml(n[E+2],Xt.OP_CAT)&&Ml(n[E+3],Xt.OP_SWAP)&&(w=n[E+1].buf);if(!w)return null;var P=CC(w).map(function(K){var N=null;try{K.script.isPublicKeyHashOut()&&(N=K.script.toAddress(r).toString())}catch{}return{satoshis:K.satoshis,script:K.script,address:N}}),M=P.reduce(function(K,N){return K+N.satoshis},0),D=null,L=DC.parseInscription(i);L&&(D={contentType:L.contentType,content:L.content,contentText:L.contentText});var U=t5({seller:l,payOutputs:CC(w),inscription:L?{contentType:L.contentType,content:L.content}:void 0});return U.toHex()!==i.toHex()?null:{seller:{pubKeyHash:l,address:qr.Address.fromPublicKeyHash(l,r).toString()},payOutputs:P,payBlob:w,totalPrice:M,inscription:D}}catch{return null}}function ooe(e,t){return r5(e,t)!==null}function aoe(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;return new qr.Transaction.Output({script:t5(e),satoshis:t})}function UC(e){e=e||{};var t=e.spend,r=e.lockingScript;if(!t||!r)throw new Error("purchase requires { spend, lockingScript }");var i=e.inputIndex||0,n=e.payoutIndex!=null?e.payoutIndex:1,o=e.satoshis!=null?e.satoshis:1,a=t.outputs||[],s=e.parsed||r5(r),u=e.payoutCount!=null?e.payoutCount:s?s.payOutputs.length:1;if(n+u>a.length)throw new Error("purchase: spend has fewer outputs than the pinned block requires (need "+(n+u)+", have "+a.length+")");if(e.validate!==!1&&s){var c=h.Buffer.concat(a.slice(n,n+u).map($6));if(!c.equals(s.payBlob))throw new Error("purchase: outputs ["+n+".."+(n+u-1)+"] do not match the listing payment \u2014 the seller (or a royalty/fee payee) would not be paid")}var l=h.Buffer.concat(a.slice(0,n).map($6)),m=h.Buffer.concat(a.slice(n+u).map($6)),w=Object.assign({sighashType:J6},e.grind||{}),E=Nl.grind(t,i,r,o,w),P=new Yo;return NC(P,m),NC(P,l),P.add(h.Buffer.from(E.preimage)),P.add(Xt.OP_FALSE),t.inputs[i].setScript(P),P}function soe(e){e=e||{};var t=e.privateKey,r=e.spend,i=e.lockingScript;if(!t||!r||!i)throw new Error("cancel requires { privateKey, spend, lockingScript }");var n=e.inputIndex||0,o=e.satoshis!=null?e.satoshis:1,a=e.sighashType!=null?e.sighashType:r7.SIGHASH,s=r7.signInput(r,t,n,i,o,a),u=new Yo;return u.add(h.Buffer.from(s)),u.add(t.toPublicKey().toBuffer()),u.add(Xt.OP_TRUE),r.inputs[n].setScript(u),u}function Q6(e,t,r,i){e.addInput(new qr.Transaction.Input({prevTxId:t.txid||t.prevTxId,outputIndex:t.outputIndex!=null?t.outputIndex:t.vout,script:Yo.empty()}),e5(r),i)}function i7(e,t,r){Cl(r.satoshis,"input "+t+" satoshis");var i=e5(r.script),n=r7.signInput(e,r.privateKey,t,i,r.satoshis,Nl.SIGHASH_ALL_FORKID),o=new Yo;o.add(h.Buffer.from(n)),o.add(r.privateKey.toPublicKey().toBuffer()),e.inputs[t].setScript(o)}function uoe(e){e=e||{};var t=e.ordinal;if(!t||!t.script||!t.privateKey)throw new Error("buildListingTx requires ordinal { script, privateKey, txid, outputIndex }");var r=Cl(t.satoshis!=null?t.satoshis:1,"ordinal satoshis"),i=t5(e),n=e.funding||[],o=e.fee!=null?e.fee:500,a=n.reduce(function(c,l){return c+Cl(l.satoshis,"funding satoshis")},0),s=a-o;if(s<0)throw new Error("buildListingTx: insufficient funding \u2014 need "+o+" sat fee, funded "+a);var u=new qr.Transaction;return Q6(u,t,t.script,r),n.forEach(function(c){Q6(u,c,c.script,c.satoshis)}),u.addOutput(new qr.Transaction.Output({script:i,satoshis:r})),s>0&&u.addOutput(Dl(e.changeAddress||t.privateKey.toAddress(),s)),i7(u,0,{script:t.script,privateKey:t.privateKey,satoshis:r}),n.forEach(function(c,l){i7(u,1+l,c)}),{tx:u,listingScript:i,listingOutpoint:{txid:u.hash,outputIndex:0}}}function foe(e){e=e||{};var t=e.listing;if(!t||!t.script)throw new Error("buildPurchaseTx requires listing.script");if(!e.ordinalDestination)throw new Error("buildPurchaseTx requires ordinalDestination");if(!e.funding||!e.funding.length)throw new Error("buildPurchaseTx requires funding coins");var r=e5(t.script),i=r5(r);if(!i)throw new Error("buildPurchaseTx: listing.script is not a parseable OrdLock");var n=Cl(t.satoshis!=null?t.satoshis:1,"listing satoshis"),o=e.payOutputs?e.payOutputs.map(X6):i.payOutputs.map(function(m){return new qr.Transaction.Output({script:m.script,satoshis:m.satoshis})}),a=o.reduce(function(m,w){return m+w.satoshis},0),s=e.fee!=null?e.fee:500,u=e.funding.reduce(function(m,w){return m+Cl(w.satoshis,"funding satoshis")},0),c=u-a-s;if(c<0)throw new Error("buildPurchaseTx: insufficient funding \u2014 need "+(a+s)+" sat (payments "+a+" + fee "+s+"), funded "+u);var l=new qr.Transaction;return Q6(l,t,r,n),e.funding.forEach(function(m){Q6(l,m,m.script,m.satoshis)}),l.addOutput(Dl(e.ordinalDestination,n)),o.forEach(function(m){l.addOutput(m)}),c>0&&l.addOutput(Dl(e.changeAddress||e.ordinalDestination,c)),UC({spend:l,lockingScript:r,parsed:i,satoshis:n,inputIndex:0,payoutIndex:1,payoutCount:o.length,grind:e.grind}),e.funding.forEach(function(m,w){i7(l,1+w,m)}),l}FC.exports={ORDLOCK_SIGHASH:J6,buildOrdLock:t5,parseOrdLock:r5,isOrdLock:ooe,listInscriptionOutput:aoe,payOutputFor:Dl,purchase:UC,cancel:soe,buildListingTx:uoe,buildPurchaseTx:foe}});var aD=k((_ve,oD)=>{"use strict";v();var jC=Y6(),zC="application/bsv-20",n7=18,i5="18446744073709551615";function KC(e){return typeof e=="string"&&/^\d+$/.test(e)}function VC(e){return e.length>i5.length||e.length===i5.length&&e>i5}function GC(e,t){var r;if(typeof e=="number"){if(!Number.isInteger(e)||e<0)throw new Error(t+" must be a non-negative integer");if(e>Number.MAX_SAFE_INTEGER)throw new Error(t+" exceeds Number.MAX_SAFE_INTEGER and would lose precision \u2014 pass it as a string");r=String(e)}else if(KC(e))r=e.replace(/^0+(?=\d)/,"");else throw new Error(t+" must be a non-negative integer (string or number)");if(VC(r))throw new Error(t+" exceeds the uint64 maximum ("+i5+")");return r}function I1(e,t){var r=GC(e,t);if(!/[1-9]/.test(r))throw new Error(t+" must be greater than zero");return r}function ZC(e){if(typeof e!="string"||!e.length)throw new Error("tick is required");if(h.Buffer.byteLength(e,"utf8")>4)throw new Error("tick must be 1\u20134 UTF-8 bytes");return e}function o7(e){var t=typeof e=="string"?Number(e):e;if(!Number.isInteger(t)||t<0||t>n7)throw new Error("dec must be an integer 0\u2026"+n7);return String(t)}var a7=/^[0-9a-fA-F]{64}_\d+$/;function s7(e){if(typeof e!="string"||!a7.test(e))throw new Error('id must be "<txid>_<vout>" (64-hex txid, underscore, output index)');return e}function u7(e,t){if(typeof e!="string"){var r=e===null?"null":Array.isArray(e)?"an array":(typeof e=="object"?"an ":"a ")+typeof e;throw new Error(t+" must be a string, got "+r)}if(!e.length)throw new Error(t+" must not be empty");return e}function WC(e){if(u7(e,"icon"),!a7.test(e))throw new Error('icon must be an outpoint reference "<txid>_<vout>" (64-hex txid, underscore, output index)');return e}function If(e,t){return t=t||{},jC.buildInscription({lock:t.lock,address:t.address,contentType:t.contentType||zC,content:JSON.stringify(e)})}function YC(e){e=e||{};var t={p:"bsv-20",op:"deploy",tick:ZC(e.tick),max:I1(e.max,"max")};return e.lim!=null&&(t.lim=GC(e.lim,"lim")),e.dec!=null&&(t.dec=o7(e.dec)),If(t,e)}function $C(e,t,r){var i=t.tick!=null,n=t.id!=null;if(i&&n)throw new Error(r+" names a token by `tick` (v1) or `id` (BSV-21), not both");if(!i&&!n)throw new Error(r+" requires `tick` (v1) or `id` (BSV-21)");return n?e.id=s7(t.id):e.tick=ZC(t.tick),e}function XC(e,t){if(e.amt!=null)throw new Error(t+" must not carry an amt \u2014 the specification forbids it, and a payload that does is discarded")}function JC(e){e=e||{};var t={p:"bsv-20",op:"mint"};return $C(t,e,"mint"),t.amt=I1(e.amt,"amt"),If(t,e)}function QC(e){e=e||{};var t={p:"bsv-20",op:"transfer",amt:I1(e.amt,"amt")};return $C(t,e,"transfer"),If(t,e)}function eD(e){if(e=e||{},e.tick!=null)throw new Error("burn is a BSV-21 operation and names its token by `id` (<txid>_<vout>), not `tick`");var t={p:"bsv-20",op:"burn",id:s7(e.id),amt:I1(e.amt,"amt")};return If(t,e)}function tD(e){e=e||{},XC(e,"deploy+auth");var t={p:"bsv-20",op:"deploy+auth"};return e.dec!=null&&(t.dec=o7(e.dec)),e.sym!=null&&(t.sym=u7(e.sym,"sym")),e.icon!=null&&(t.icon=WC(e.icon)),If(t,e)}function rD(e){e=e||{},XC(e,"auth");var t={p:"bsv-20",op:"auth",id:s7(e.id)};return If(t,e)}function iD(e){e=e||{};var t={p:"bsv-20",op:"deploy+mint",amt:I1(e.amt,"amt")};return e.dec!=null&&(t.dec=o7(e.dec)),e.sym!=null&&(t.sym=u7(e.sym,"sym")),e.icon!=null&&(t.icon=WC(e.icon)),If(t,e)}function Af(e,t){var r=Te();return new r.Transaction.Output({script:e,satoshis:t??1})}function coe(e){return Af(YC(e),e&&e.satoshis)}function loe(e){return Af(JC(e),e&&e.satoshis)}function hoe(e){return Af(QC(e),e&&e.satoshis)}function doe(e){return Af(iD(e),e&&e.satoshis)}function poe(e){return Af(eD(e),e&&e.satoshis)}function goe(e){return Af(tD(e),e&&e.satoshis)}function voe(e){return Af(rD(e),e&&e.satoshis)}function moe(e){var t=Te();if(e&&typeof e=="object"&&!h.Buffer.isBuffer(e)&&!(e instanceof t.Script)||typeof e=="string"&&e.trim()[0]==="{")return e;var r=jC.parseInscription(e);return r?r.contentText:null}var yoe={deploy:{need:["tick","max"]},mint:{need:["amt"],tickOrId:!0},transfer:{need:["amt"],tickOrId:!0},"deploy+mint":{need:["amt"]},"deploy+auth":{need:[],noAmt:!0},auth:{need:["id"],noAmt:!0},burn:{need:["id","amt"]}};function boe(e){var t=typeof e=="number"?Number.isInteger(e)&&e>=0?String(e):null:KC(e)?e:null;return t==null?!1:!VC(t.replace(/^0+(?=\d)/,""))}function _oe(e){if(!e||e.p!=="bsv-20"||typeof e.op!="string")return!1;var t=yoe[e.op];if(!t)return!1;for(var r=0;r<t.need.length;r++)if(e[t.need[r]]==null)return!1;if(t.tickOrId&&e.tick==null==(e.id==null)||t.noAmt&&e.amt!=null||e.tick!=null&&(typeof e.tick!="string"||!e.tick.length||h.Buffer.byteLength(e.tick,"utf8")>4)||e.id!=null&&(typeof e.id!="string"||!a7.test(e.id)))return!1;for(var i=["amt","max","lim"],n=0;n<i.length;n++)if(e[i[n]]!=null&&!boe(e[i[n]]))return!1;if(e.dec!=null){var o=typeof e.dec=="string"?Number(e.dec):e.dec;if(!Number.isInteger(o)||o<0||o>n7)return!1}return!0}function nD(e){try{var t=moe(e);if(t==null)return null;var r=typeof t=="object"?t:JSON.parse(t);return _oe(r)?r:null}catch{return null}}function woe(e){return nD(e)!==null}oD.exports={CONTENT_TYPE:zC,buildDeploy:YC,buildMint:JC,buildTransfer:QC,buildDeployMint:iD,buildBurn:eD,buildDeployAuth:tD,buildAuth:rD,createDeployOutput:coe,createMintOutput:loe,createTransferOutput:hoe,createDeployMintOutput:doe,createBurnOutput:poe,createDeployAuthOutput:goe,createAuthOutput:voe,parseBsv20:nD,isBsv20:woe}});var uD=k((Sve,sD)=>{"use strict";v();var A1=Y6(),$o=HC(),Soe=aD();function xoe(e){if(!Array.isArray(e)||!e.length)throw new Error("batchInscriptionOutputs requires a non-empty array of items");return e.map(function(t){return A1.createInscriptionOutput(t)})}sD.exports={buildInscription:A1.buildInscription,parseInscription:A1.parseInscription,isInscription:A1.isInscription,createInscriptionOutput:A1.createInscriptionOutput,batchInscriptionOutputs:xoe,ORDLOCK_SIGHASH:$o.ORDLOCK_SIGHASH,buildOrdLock:$o.buildOrdLock,parseOrdLock:$o.parseOrdLock,isOrdLock:$o.isOrdLock,listInscriptionOutput:$o.listInscriptionOutput,payOutputFor:$o.payOutputFor,purchaseOrdLock:$o.purchase,cancelOrdLock:$o.cancel,buildListingTx:$o.buildListingTx,buildPurchaseTx:$o.buildPurchaseTx,BSV20:Soe}});var n5=k((Ove,cD)=>{"use strict";v();var qs=Te(),f7=qs.PublicKey,P1=qs.PrivateKey,fD=qs.crypto.Hash,En=qs.util.preconditions,Eve=qs.errors;function Ct(e){return this instanceof Ct?(this.options=e||{},this.network=this.options.network||"mainnet",this.registry=this.options.registry||null,this):new Ct(e)}Ct.fromPublicKey=function(e,t){t=t||{},typeof e=="string"&&(e=f7.fromString(e)),En.checkArgument(e instanceof f7,"Invalid public key");var r=e.toString("hex"),i=t.network||"mainnet",n=t.path||"",o="did:smartledger:"+r;return i!=="mainnet"&&(o+=":"+i),n&&(o+=":"+n),o};Ct.fromPrivateKey=function(e,t){return typeof e=="string"&&(e=P1.fromWIF(e)),En.checkArgument(e instanceof P1,"Invalid private key"),Ct.fromPublicKey(e.toPublicKey(),t)};Ct.parseDID=function(e){if(En.checkArgument(typeof e=="string","DID must be a string"),!e.startsWith("did:smartledger:"))throw new Error("Invalid SmartLedger DID format");var t=e.split(":");if(t.length<3)throw new Error("Invalid DID format");var r={method:"smartledger",identifier:t[2],network:"mainnet",path:""};return t.length>3&&t[3]!==""&&(r.network=t[3]),t.length>4&&(r.path=t.slice(4).join(":")),r};Ct.isValidDID=function(e){try{var t=Ct.parseDID(e);return!(!/^[0-9a-fA-F]{66}$/.test(t.identifier)&&!/^[0-9a-fA-F]{130}$/.test(t.identifier)||!["mainnet","testnet","regtest"].includes(t.network))}catch{return!1}};Ct.getPublicKey=function(e){var t=Ct.parseDID(e);return f7.fromString(t.identifier)};Ct.createDocument=function(e,t){t=t||{},En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.getPublicKey(e),i=e+"#keys-1",n={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/secp256k1-2019/v1"],id:e,verificationMethod:[{id:i,type:"EcdsaSecp256k1VerificationKey2019",controller:e,publicKeyHex:r.toString("hex")}],authentication:[i],assertionMethod:[i],keyAgreement:[i],capabilityInvocation:[i],capabilityDelegation:[i]};return t.services&&Array.isArray(t.services)&&(n.service=t.services),t.verificationMethods&&(n.verificationMethod=n.verificationMethod.concat(t.verificationMethods)),t.created&&(n.created=t.created),t.updated&&(n.updated=t.updated),n};Ct.resolve=async function(e,t){t=t||{};try{En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.createDocument(e,t);return{"@context":"https://w3id.org/did-resolution/v1",didDocument:r,didResolutionMetadata:{contentType:"application/did+ld+json",retrieved:new Date().toISOString()},didDocumentMetadata:{method:{published:!0,recoveryCommitment:null,updateCommitment:null}}}}catch(i){return{"@context":"https://w3id.org/did-resolution/v1",didDocument:null,didResolutionMetadata:{error:"notFound",errorMessage:i.message},didDocumentMetadata:{}}}};Ct.verifyOwnership=function(e,t,r){try{var i=Ct.getPublicKey(e),n=fD.sha256(h.Buffer.isBuffer(r)?r:h.Buffer.from(r,"utf8")),o=qs.crypto.Signature.fromString(t),a=new qs.crypto.ECDSA;return a.hashbuf=n,a.pubkey=i,a.sig=o,a.verify()===!0}catch{return!1}};Ct.signMessage=function(e,t){En.checkArgument(t instanceof P1,"Invalid private key");var r=fD.sha256(h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8")),i=new qs.crypto.ECDSA;return i.hashbuf=r,i.privkey=t,i.pubkey=t.toPublicKey(),i.sign().toString()};Ct.createProofOfOwnership=function(e,t){En.checkArgument(e instanceof P1,"Invalid private key"),En.checkArgument(typeof t=="string","Challenge must be a string");var r=Ct.fromPrivateKey(e),i=new Date().toISOString(),n=t+":"+i+":"+r,o=Ct.signMessage(n,e);return{type:"EcdsaSecp256k1Signature2019",created:i,verificationMethod:r+"#keys-1",proofPurpose:"authentication",challenge:t,jws:o}};Ct.verifyProofOfOwnership=function(e,t){try{En.checkArgument(e&&typeof e=="object","Invalid proof object"),En.checkArgument(typeof t=="string","DID must be a string");var r=e.challenge+":"+e.created+":"+t;return Ct.verifyOwnership(t,e.jws,r)}catch{return!1}};Ct.createDIDURL=function(e,t){return En.checkArgument(typeof e=="string","DID must be a string"),En.checkArgument(typeof t=="string","Fragment must be a string"),e+"#"+t};Ct.generateTestDID=function(e){e=e||{};var t=new P1,r=Ct.fromPrivateKey(t,e),i=Ct.createDocument(r,e);return{did:r,privateKey:t.toWIF(),publicKey:t.toPublicKey().toString("hex"),document:i}};cD.exports=Ct});var o5=k((Tve,dD)=>{"use strict";v();var Ll=Te(),Eoe=n5(),lD=Ll.PrivateKey,Us=Ll.crypto.Hash,hD=Ll.crypto.ECDSA,Ave=Ll.crypto.Signature,Fs=Ll.util.preconditions,Pve=xt();function hr(e,t){return this instanceof hr?(typeof e=="string"&&(e=lD.fromWIF(e)),Fs.checkArgument(e instanceof lD,"Invalid private key"),this.privateKey=e,this.publicKey=e.toPublicKey(),this.options=t||{},this.did=Eoe.fromPrivateKey(e,this.options),this):new hr(e,t)}hr._sortValue=function(e){return Array.isArray(e)?e.map(function(t){return hr._sortValue(t)}):e!==null&&typeof e=="object"?Object.keys(e).sort().reduce(function(t,r){return t[r]=hr._sortValue(e[r]),t},{}):e};hr._canonicalizeJSON=function(e){return JSON.stringify(hr._sortValue(e))};hr._hashCredential=function(e){var t=hr._canonicalizeJSON(e);return Us.sha256(h.Buffer.from(t,"utf8"))};hr.prototype.createCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid credential subject");var r=new Date().toISOString(),i=t.id||"urn:uuid:"+this._generateUUID(),n={"@context":["https://www.w3.org/2018/credentials/v1"],id:i,type:["VerifiableCredential"],issuer:this.did,issuanceDate:r,credentialSubject:e};return t.type&&(Array.isArray(t.type)?n.type=n.type.concat(t.type):n.type.push(t.type)),t.context&&(Array.isArray(t.context)?n["@context"]=n["@context"].concat(t.context):n["@context"].push(t.context)),t.expirationDate&&(n.expirationDate=t.expirationDate),t.termsOfUse&&(n.termsOfUse=t.termsOfUse),t.evidence&&(n.evidence=t.evidence),t.refreshService&&(n.refreshService=t.refreshService),n};hr.prototype.signCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid credential");var r=JSON.parse(JSON.stringify(e));delete r.proof;var i=hr._hashCredential(r),n=new hD;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:t.proofPurpose||"assertionMethod",jws:a};t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain);var u=JSON.parse(JSON.stringify(r));return u.proof=s,u.rootHash=i.toString("hex"),u};hr.prototype._createJWSSignature=function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o};hr.prototype.createEmailCredential=function(e,t){t=t||{},Fs.checkArgument(typeof e=="string"&&e.includes("@"),"Invalid email address");var r={id:t.subjectId||"did:smartledger:"+Us.sha256(h.Buffer.from(e)).toString("hex"),email:e,verified:!0,verificationMethod:"email_verification",verificationTimestamp:new Date().toISOString()},i={type:"EmailVerifiedCredential",context:"https://smartledger.technology/contexts/email/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};hr.prototype.createAgeCredential=function(e,t,r){r=r||{},Fs.checkArgument(typeof e=="number"&&e>0,"Invalid age");var i={id:r.subjectId||"urn:uuid:"+this._generateUUID(),ageOver:e,verified:!0,verificationMethod:"age_verification"};t&&(i.birthDateHash=Us.sha256(h.Buffer.from(t.toISOString())).toString("hex"));var n={type:"AgeVerifiedCredential",context:"https://smartledger.technology/contexts/age/v1",...r},o=this.createCredential(i,n);return this.signCredential(o,r)};hr.prototype.createKYCCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid KYC data");var r={id:t.subjectId||"urn:uuid:"+this._generateUUID(),kycLevel:e.level||"basic",verified:!0,verificationMethod:"kyc_verification",verificationTimestamp:new Date().toISOString(),verifyingAuthority:e.authority||this.did};e.firstName&&(r.firstNameHash=Us.sha256(h.Buffer.from(e.firstName)).toString("hex")),e.lastName&&(r.lastNameHash=Us.sha256(h.Buffer.from(e.lastName)).toString("hex")),e.ssn&&(r.ssnHash=Us.sha256(h.Buffer.from(e.ssn)).toString("hex"));var i={type:"KYCVerifiedCredential",context:"https://smartledger.technology/contexts/kyc/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};hr.prototype.createOrganizationCredential=function(e,t){t=t||{},Fs.checkArgument(e&&typeof e=="object","Invalid organization data");var r={id:t.subjectId||"did:smartledger:org:"+Us.sha256(h.Buffer.from(e.name||"")).toString("hex"),name:e.name,type:e.type||"Organization",verified:!0,verificationMethod:"organization_verification",verificationTimestamp:new Date().toISOString()};e.taxId&&(r.taxIdHash=Us.sha256(h.Buffer.from(e.taxId)).toString("hex")),e.incorporationState&&(r.incorporationState=e.incorporationState),e.industry&&(r.industry=e.industry);var i={type:"OrganizationCredential",context:"https://smartledger.technology/contexts/organization/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};hr.prototype._generateUUID=function(){var e=Ll.crypto.Random.getRandomBuffer(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;var t=e.toString("hex");return[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20,32)].join("-")};hr.prototype.createPresentation=function(e,t){t=t||{},Fs.checkArgument(Array.isArray(e),"Credentials must be an array");var r={"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],id:t.id||"urn:uuid:"+this._generateUUID(),holder:this.did,verifiableCredential:e};t.context&&(Array.isArray(t.context)?r["@context"]=r["@context"].concat(t.context):r["@context"].push(t.context));var i=hr._hashCredential(r),n=new hD;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:"authentication",jws:a};return t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain),r.proof=s,r};hr.prototype.getIssuerInfo=function(){return{did:this.did,publicKey:this.publicKey.toString("hex"),verificationMethod:this.did+"#keys-1"}};dD.exports=hr});var mD=k((Mve,vD)=>{"use strict";v();var T1=Te(),a5=n5(),c7=o5(),Rve=T1.PublicKey,Bve=T1.crypto.Hash,pD=T1.crypto.ECDSA,Ooe=T1.crypto.Signature,gD=T1.util.preconditions;function Mt(e){return this instanceof Mt?(this.options=e||{},this.trustedIssuers=this.options.trustedIssuers||[],this):new Mt(e)}Mt.verifyCredential=async function(e,t){t=t||{};try{gD.checkArgument(e&&typeof e=="object","Invalid credential");var r={valid:!1,errors:[],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}},i=Mt._validateStructure(e);r.checks.structure=i.valid,i.valid||(r.errors=r.errors.concat(i.errors));var n=await Mt._verifySignature(e);r.checks.signature=n.valid,n.valid?(r.issuerDID=n.issuerDID,r.verificationMethod=n.verificationMethod):r.errors=r.errors.concat(n.errors);var o=await Mt._validateIssuer(e,t);r.checks.issuer=o.valid,o.valid||(r.errors=r.errors.concat(o.errors)),o.warnings&&(r.warnings=r.warnings.concat(o.warnings));var a=Mt._validateTemporal(e);if(r.checks.temporal=a.valid,a.valid||(r.errors=r.errors.concat(a.errors)),a.warnings&&(r.warnings=r.warnings.concat(a.warnings)),t.schema){var s=Mt._validateSchema(e,t.schema);r.checks.schema=s.valid,s.valid||(r.errors=r.errors.concat(s.errors))}else r.checks.schema=!0;return r.valid=Object.values(r.checks).every(u=>u===!0),r}catch(u){return{valid:!1,errors:["Verification failed: "+u.message],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}}}};Mt.verifyPresentation=async function(e,t){t=t||{};try{gD.checkArgument(e&&typeof e=="object","Invalid presentation");var r={valid:!1,errors:[],warnings:[],credentialResults:[],presentationValid:!1};if(!e.type||!e.type.includes("VerifiablePresentation"))return r.errors.push("Invalid presentation type"),r;if(!e.holder)return r.errors.push("Missing presentation holder"),r;var i=await Mt._verifyPresentationSignature(e);if(r.presentationValid=i.valid,i.valid||(r.errors=r.errors.concat(i.errors)),e.verifiableCredential&&Array.isArray(e.verifiableCredential))for(var n=0;n<e.verifiableCredential.length;n++){var o=e.verifiableCredential[n],a=await Mt.verifyCredential(o,t);r.credentialResults.push({index:n,result:a}),a.valid||r.errors.push("Credential "+n+" is invalid")}var s=r.credentialResults.every(u=>u.result.valid);return r.valid=r.presentationValid&&s,r}catch(u){return{valid:!1,errors:["Presentation verification failed: "+u.message],warnings:[],credentialResults:[],presentationValid:!1}}};Mt._validateStructure=function(e){var t=[];return e["@context"]?Array.isArray(e["@context"])?e["@context"].includes("https://www.w3.org/2018/credentials/v1")||t.push("Missing required W3C credentials context"):t.push("@context must be an array"):t.push("Missing @context"),e.type?Array.isArray(e.type)?e.type.includes("VerifiableCredential")||t.push("Must include VerifiableCredential type"):t.push("type must be an array"):t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof"),{valid:t.length===0,errors:t}};Mt._normalizeDID=function(e){var t=e&&typeof e=="object"?e.id:e;return typeof t!="string"||t.length===0?null:t.split("#")[0]};Mt._verifySignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing proof"]};if(t.type!=="EcdsaSecp256k1Signature2019")return{valid:!1,errors:["Unsupported proof type: "+t.type]};if(!t.verificationMethod)return{valid:!1,errors:["Missing verification method"]};if(!t.jws)return{valid:!1,errors:["Missing JWS signature"]};var r=t.verificationMethod,i=r.split("#")[0],n=Mt._normalizeDID(e.issuer);if(!n)return{valid:!1,errors:["Missing or invalid credential issuer"]};if(n!==i)return{valid:!1,errors:["Verification method DID ("+i+") does not match credential issuer ("+n+")"]};var o=a5.getPublicKey(i),a=JSON.parse(JSON.stringify(e));delete a.proof,delete a.rootHash;var s=c7._hashCredential(a),u=Mt._parseJWSSignature(t.jws),c=new pD;c.hashbuf=s,c.pubkey=o,c.sig=u;var l=c.verify();return l?{valid:!0,issuerDID:i,verificationMethod:r}:{valid:!1,errors:["Signature verification failed"]}}catch(m){return{valid:!1,errors:["Signature verification error: "+m.message]}}};Mt._parseJWSSignature=function(e){var t=e.split(".");if(t.length!==3)throw new Error("Invalid JWS format");var r=t[2],i=h.Buffer.from(r,"base64url");return Ooe.fromDER(i)};Mt._verifyPresentationSignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing presentation proof"]};var r=e.holder,i=a5.getPublicKey(r),n=JSON.parse(JSON.stringify(e));delete n.proof;var o=c7._hashCredential(n),a=Mt._parseJWSSignature(t.jws),s=new pD;s.hashbuf=o,s.pubkey=i,s.sig=a;var u=s.verify();return{valid:u,errors:u?[]:["Presentation signature verification failed"]}}catch(c){return{valid:!1,errors:["Presentation signature error: "+c.message]}}};Mt._validateIssuer=async function(e,t){var r=[],i=[];try{var n=e.issuer;if(!a5.isValidDID(n))return r.push("Invalid issuer DID format"),{valid:!1,errors:r};var o=await a5.resolve(n);if(!o.didDocument)return r.push("Unable to resolve issuer DID"),{valid:!1,errors:r};if(t.trustedIssuers&&Array.isArray(t.trustedIssuers)){var a=Mt._normalizeDID(n),s=t.trustedIssuers.map(function(u){return Mt._normalizeDID(u)}).filter(Boolean);if(!a||s.indexOf(a)===-1)return r.push("Issuer not in trusted list"),{valid:!1,errors:r,warnings:i}}return{valid:r.length===0,errors:r,warnings:i}}catch(u){return{valid:!1,errors:["Issuer validation error: "+u.message],warnings:i}}};Mt._validateTemporal=function(e){var t=[],r=[],i=new Date;if(e.issuanceDate){var n=new Date(e.issuanceDate);isNaN(n.getTime())?t.push("Invalid issuanceDate format"):n>i&&t.push("Credential issued in the future")}if(e.expirationDate){var o=new Date(e.expirationDate);isNaN(o.getTime())?t.push("Invalid expirationDate format"):o<=i?t.push("Credential has expired"):o<=new Date(i.getTime()+1440*60*1e3)&&r.push("Credential expires within 24 hours")}return{valid:t.length===0,errors:t,warnings:r}};Mt._validateSchema=function(e,t){var r=[];if(t.requiredFields&&t.requiredFields.forEach(function(n){Mt._getNestedProperty(e,n)||r.push("Missing required field: "+n)}),t.requiredTypes){var i=t.requiredTypes.some(function(n){return e.type&&e.type.includes(n)});i||r.push("Missing required credential type")}return{valid:r.length===0,errors:r}};Mt._getNestedProperty=function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)};Mt.verifyCredentialHash=function(e){try{if(!e.rootHash)return!1;var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.rootHash;var r=c7._hashCredential(t),i=h.Buffer.from(e.rootHash,"hex");return h.Buffer.compare(r,i)===0}catch{return!1}};Mt.extractClaims=function(e){try{var t={issuer:e.issuer,subject:e.credentialSubject.id||"unknown",types:e.type||[],issuanceDate:e.issuanceDate,expirationDate:e.expirationDate,claims:{}};return Object.keys(e.credentialSubject).forEach(function(r){r!=="id"&&(t.claims[r]=e.credentialSubject[r])}),t}catch{return null}};Mt.createReport=function(e){var t=[];return t.push("=== Credential Verification Report ==="),t.push("Overall Status: "+(e.valid?"VALID":"INVALID")),t.push(""),t.push("Verification Checks:"),Object.keys(e.checks).forEach(function(r){var i=e.checks[r]?"\u2713":"\u2717";t.push(" "+i+" "+r.charAt(0).toUpperCase()+r.slice(1))}),t.push(""),e.errors.length>0&&(t.push("Errors:"),e.errors.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.warnings.length>0&&(t.push("Warnings:"),e.warnings.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.issuerDID&&t.push("Issuer: "+e.issuerDID),e.verificationMethod&&t.push("Verification Method: "+e.verificationMethod),t.join(`
|
|
99
99
|
`)};vD.exports=Mt});var bD=k((Dve,yD)=>{"use strict";v();var Pf=Te(),Ioe=o5(),so=Pf.crypto.Hash,Cve=Pf.crypto.BN,oi=Pf.util.preconditions;function rr(e){return this instanceof rr?(this.options=e||{},this):new rr(e)}rr.createMerkleTree=function(e,t){t=t||Pf.crypto.Random.getRandomBuffer(32).toString("hex"),oi.checkArgument(e&&typeof e=="object","Invalid credential");var r=rr._extractFields(e),i=r.map(function(o){var a=o.path+":"+JSON.stringify(o.value)+":"+t;return{path:o.path,value:o.value,hash:so.sha256(h.Buffer.from(a,"utf8")).toString("hex"),salt:t}}),n=rr._buildMerkleTree(i.map(o=>o.hash));return{salt:t,leaves:i,tree:n,root:n[n.length-1][0]}};rr.generateSelectiveProof=function(e,t,r){oi.checkArgument(e&&typeof e=="object","Invalid credential"),typeof t=="string"&&(t=[t]),oi.checkArgument(Array.isArray(t),"Disclose paths must be array");var i=rr.createMerkleTree(e,r),n=[],o=[];return t.forEach(function(a){var s=i.leaves.find(l=>l.path===a);if(s){n.push(s);var u=i.leaves.findIndex(l=>l.path===a),c=rr._generateMerkleProof(i.tree,u);o.push({path:a,leafIndex:u,proof:c})}}),{type:"SelectiveDisclosureProof",created:new Date().toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,credentialRoot:i.root,credentialHash:e.rootHash||Ioe._hashCredential(e).toString("hex"),disclosedFields:n.map(function(a){return{path:a.path,value:a.value,hash:a.hash}}),merkleProofs:o,salt:r}};rr.verifySelectiveProof=function(e,t){try{oi.checkArgument(e&&typeof e=="object","Invalid proof"),oi.checkArgument(typeof t=="string","Expected root must be string");for(var r={valid:!1,errors:[],verifiedFields:[]},i=0;i<e.disclosedFields.length;i++){var n=e.disclosedFields[i],o=e.merkleProofs.find(c=>c.path===n.path);if(!o){r.errors.push("Missing Merkle proof for field: "+n.path);continue}var a=n.path+":"+JSON.stringify(n.value)+":"+e.salt,s=so.sha256(h.Buffer.from(a,"utf8")).toString("hex");if(s!==n.hash){r.errors.push("Field hash mismatch for: "+n.path);continue}var u=rr._verifyMerkleProof(n.hash,o.proof,t);if(!u){r.errors.push("Invalid Merkle proof for: "+n.path);continue}r.verifiedFields.push({path:n.path,value:n.value,verified:!0})}return r.valid=r.errors.length===0&&r.verifiedFields.length>0,r}catch(c){return{valid:!1,errors:["Proof verification failed: "+c.message],verifiedFields:[]}}};rr.generateAgeProof=function(e,t,r){oi.checkArgument(e instanceof Date,"Birth date must be Date object"),oi.checkArgument(typeof t=="number","Minimum age must be number"),r=r||Pf.crypto.Random.getRandomBuffer(32).toString("hex");var i=new Date,n=Math.floor((i-e)/(365.25*24*60*60*1e3));if(n<t)throw new Error("Age requirement not met");var o=e.toISOString().split("T")[0],a=so.sha256(h.Buffer.from(o+":"+r,"utf8")).toString("hex"),s={minimumAge:t,ageAttestation:n>=t,timestamp:i.toISOString(),salt:r},u=so.sha256(h.Buffer.from(JSON.stringify(s),"utf8")).toString("hex");return{type:"AgeProof",created:new Date().toISOString(),proofPurpose:"ageVerification",minimumAge:t,meetsRequirement:!0,birthDateCommitment:a,ageProofHash:u,challengeResponse:rr._generateAgeChallenge(e,t,r)}};rr.verifyAgeProof=function(e,t){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),oi.checkArgument(typeof t=="number","Required age must be number"),e.type!=="AgeProof"||e.minimumAge!==t||!e.meetsRequirement?!1:e.challengeResponse&&e.challengeResponse.length>0}catch{return!1}};rr.generateRangeProof=function(e,t,r,i){oi.checkArgument(typeof e=="number","Value must be number"),oi.checkArgument(typeof t=="number","Min must be number"),oi.checkArgument(typeof r=="number","Max must be number"),oi.checkArgument(e>=t&&e<=r,"Value not in range"),i=i||Pf.crypto.Random.getRandomBuffer(32).toString("hex");var n=so.sha256(h.Buffer.from(e.toString()+":"+i,"utf8")).toString("hex"),o={min:t,max:r,inRange:!0,timestamp:new Date().toISOString(),salt:i},a=so.sha256(h.Buffer.from(JSON.stringify(o),"utf8")).toString("hex");return{type:"RangeProof",created:new Date().toISOString(),proofPurpose:"rangeVerification",range:{min:t,max:r},valueCommitment:n,proofHash:a,inRange:!0}};rr.verifyRangeProof=function(e,t,r){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),e.type!=="RangeProof"||e.range.min!==t||e.range.max!==r?!1:e.inRange===!0}catch{return!1}};rr._extractFields=function(e,t){t=t||"";var r=[];return Object.keys(e).forEach(function(i){var n=t?t+"."+i:i,o=e[i];o&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)?r=r.concat(rr._extractFields(o,n)):r.push({path:n,value:o})}),r};rr._buildMerkleTree=function(e){if(e.length===0)throw new Error("Cannot build tree from empty leaves");for(var t=[e];t[t.length-1].length>1;){for(var r=t[t.length-1],i=[],n=0;n<r.length;n+=2){var o=r[n],a=n+1<r.length?r[n+1]:o,s=o+a,u=so.sha256(h.Buffer.from(s,"hex")).toString("hex");i.push(u)}t.push(i)}return t};rr._generateMerkleProof=function(e,t){for(var r=[],i=t,n=0;n<e.length-1;n++){var o=e[n],a=i%2===0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r};rr._verifyMerkleProof=function(e,t,r){for(var i=e,n=0;n<t.length;n++){var o=t[n],a=o.isLeft?o.hash+i:i+o.hash;i=so.sha256(h.Buffer.from(a,"hex")).toString("hex")}return i===r};rr._generateAgeChallenge=function(e,t,r){var i=so.sha256(h.Buffer.from(e.toISOString()+t+r,"utf8"));return i.toString("hex")};rr.generateMembershipProof=function(e,t,r){oi.checkArgument(Array.isArray(e),"Set must be array"),oi.checkArgument(e.includes(t),"Value not in set"),r=r||Pf.crypto.Random.getRandomBuffer(32).toString("hex");var i=e.map(function(o){return so.sha256(h.Buffer.from(JSON.stringify(o)+":"+r,"utf8")).toString("hex")}),n=so.sha256(h.Buffer.from(JSON.stringify(t)+":"+r,"utf8")).toString("hex");return{type:"MembershipProof",created:new Date().toISOString(),proofPurpose:"membershipVerification",setCommitments:i,valueCommitment:n,isMember:!0}};rr.verifyMembershipProof=function(e){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),e.type!=="MembershipProof"||!Array.isArray(e.setCommitments)?!1:e.setCommitments.includes(e.valueCommitment)&&e.isMember}catch{return!1}};yD.exports=rr});var SD=k((Uve,wD)=>{"use strict";v();var Tf=Te(),l7=Tf.Transaction,Aoe=Tf.Script,h7=Tf.PrivateKey,qve=Tf.Address,k1=Tf.crypto.Hash,_D=Tf.SPV,Hs=Tf.util.preconditions;function Tr(e,t){return this instanceof Tr?(typeof e=="string"&&(e=h7.fromWIF(e)),e!==null?(Hs.checkArgument(e instanceof h7,"Invalid private key"),this.privateKey=e,this.address=e.toAddress()):(this.privateKey=null,this.address=null),this.options=t||{},this.network=this.options.network||"mainnet",this.PROTOCOL_ID="SMARTLEDGER.ATTEST",this.VERSION=1,this):new Tr(e,t)}Tr.prototype.anchorCredential=async function(e,t,r){t=t||{},typeof e=="string"&&(e=h.Buffer.from(e,"hex")),Hs.checkArgument(h.Buffer.isBuffer(e),"Invalid credential hash"),Hs.checkArgument(e.length===32,"Hash must be 32 bytes");var i=this._createAnchorPayload("CREDENTIAL",e,t),n=await this._createAnchorTransaction(i,r);return{txid:n.hash,transaction:n,anchorHash:e.toString("hex"),metadata:t,timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"CREDENTIAL"}}};Tr.prototype.anchorBatch=async function(e,t,r){t=t||{},Hs.checkArgument(Array.isArray(e),"Credential hashes must be array"),Hs.checkArgument(e.length>0,"Must provide at least one hash");var i=this._createMerkleRoot(e),n=this._createAnchorPayload("BATCH",i,{...t,batchSize:e.length,merkleRoot:i.toString("hex")}),o=await this._createAnchorTransaction(n,r);return{txid:o.hash,transaction:o,merkleRoot:i.toString("hex"),batchSize:e.length,credentialHashes:e.map(a=>h.Buffer.isBuffer(a)?a.toString("hex"):a),metadata:t,timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"BATCH"}}};Tr.prototype.registerDID=async function(e,t,r){Hs.checkArgument(typeof e=="string","DID must be string"),Hs.checkArgument(t&&typeof t=="object","Invalid DID document");var i=k1.sha256(h.Buffer.from(JSON.stringify(t),"utf8")),n=this._createAnchorPayload("DID_REG",i,{did:e,operation:"create",documentHash:i.toString("hex")}),o=await this._createAnchorTransaction(n,r);return{txid:o.hash,transaction:o,did:e,documentHash:i.toString("hex"),timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"DID_REG"}}};Tr.prototype.revokeCredential=async function(e,t,r){Hs.checkArgument(typeof e=="string","Credential ID must be string"),t=t||"unspecified";var i={credentialId:e,reason:t,timestamp:new Date().toISOString(),issuer:this.address.toString()},n=k1.sha256(h.Buffer.from(JSON.stringify(i),"utf8")),o=this._createAnchorPayload("REVOKE",n,{credentialId:e,reason:t}),a=await this._createAnchorTransaction(o,r);return{txid:a.hash,transaction:a,credentialId:e,reason:t,revocationHash:n.toString("hex"),timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"REVOKE"}}};Tr.prototype._createAnchorPayload=function(e,t,r){var i=Math.floor(Date.now()/1e3),n=h.Buffer.concat([h.Buffer.from(this.PROTOCOL_ID,"utf8"),h.Buffer.from([this.VERSION]),h.Buffer.from(e.padEnd(10,"\0"),"utf8"),h.Buffer.from([i>>24,i>>16,i>>8,i]),t,h.Buffer.from(JSON.stringify(r),"utf8")]);return n};Tr.prototype._createAnchorTransaction=async function(e,t){if(!t||t.length===0)throw new Error("UTXOs required for anchor transaction");var r=200+e.length,i=this.options.feeRate||1,n=r*i,o=t.reduce((c,l)=>c+l.satoshis,0);if(o<n)throw new Error("Insufficient funds for anchor transaction");var a=new l7;t.forEach(c=>{a.from(c)});var s=Aoe.buildDataOut(e);a.addOutput(new l7.Output({script:s,satoshis:0}));var u=o-n;return u>546&&a.to(this.address,u),a.sign(this.privateKey),a};Tr.prototype._createMerkleRoot=function(e){if(e.length===0)throw new Error("Cannot create Merkle root from empty array");for(var t=e.map(u=>h.Buffer.isBuffer(u)?u:h.Buffer.from(u,"hex"));t.length>1;){for(var r=[],i=0;i<t.length;i+=2){var n=t[i],o=i+1<t.length?t[i+1]:n,a=h.Buffer.concat([n,o]),s=k1.sha256(a);r.push(s)}t=r}return t[0]};Tr.parseAnchorData=function(e){if(!h.Buffer.isBuffer(e))throw new Error("Data must be Buffer");if(e.length<50)throw new Error("Data too short for SmartLedger anchor");var t=0,r=18,i=e.slice(t,t+r).toString("utf8");if(t+=r,i!=="SMARTLEDGER.ATTEST")throw new Error("Invalid protocol identifier");var n=e[t];t+=1;var o=e.slice(t,t+10).toString("utf8").replace(/\0/g,"");t+=10;var a=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];t+=4;var s=e.slice(t,t+32);t+=32;var u=e.slice(t),c={};try{c=JSON.parse(u.toString("utf8"))}catch{}return{protocol:i,version:n,type:o,timestamp:new Date(a*1e3),hash:s.toString("hex"),metadata:c}};Tr.verifyAnchor=async function(e,t,r){if(r=r||{},!e||!t)throw new Error("verifyAnchor requires both txid and expectedHash");if(r.spvProof&&(r.header||r.headerChain)&&r.rawTx)return Tr._verifyAnchorSPV(e,t,r);if(typeof r.chainProvider!="function")throw new Error("verifyAnchor needs either a trustless SPV proof \u2014 { spvProof: { index, nodes }, header, rawTx } \u2014 or a trusted options.chainProvider(txid) returning { confirmations, blockHeight, opReturns }. Refusing to fabricate a result.");var i=r.minConfirmations!=null?r.minConfirmations:1,n=await r.chainProvider(e),o=n&&n.confirmations||0,a=n&&n.opReturns||[],s=String(t).toLowerCase(),u=a.some(function(l){return String(l).toLowerCase().indexOf(s)!==-1}),c=o>=i&&u;return{verified:c,txid:e,hash:t,committed:u,confirmations:o,blockHeight:n&&n.blockHeight||null,timestamp:new Date().toISOString(),proof:{type:"blockchain_anchor",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}};Tr._verifyAnchorSPV=function(e,t,r){var i=r.spvProof||{},n=null,o=r.header;r.headerChain&&(n=_D.verifyHeaderChain(r.headerChain,{requirePow:r.requirePow!==!1,trustedHash:r.trustedHash}),o=r.headerChain[0]);var a=_D.verifyTxInclusion({txid:e,index:i.index,nodes:i.nodes,header:o,requirePow:r.requirePow!==!1}),s=h.Buffer.isBuffer(r.rawTx)?r.rawTx:h.Buffer.from(r.rawTx,"hex"),u=h.Buffer.from(k1.sha256sha256(s)).reverse().toString("hex"),c=u.toLowerCase()===String(e).toLowerCase(),l=c&&Tr._rawTxCommitsTo(s,t),m=n?n.count:r.header?1:0,w=r.minConfirmations!=null?r.minConfirmations:1,E=n?n.valid:!0,P=m>=w;return{verified:a.valid&&c&&l&&E&&P,chainVerified:a.valid,committed:l,txidBound:c,powValid:a.powValid,confirmations:m,headerChainValid:n?n.valid:null,headerChainReason:n&&n.reason||null,tipHash:n?n.tipHash:null,txid:e,hash:t,blockHash:a.blockHash,merkleRoot:a.merkleRoot,timestamp:new Date().toISOString(),proof:{type:n?"spv_merkle_inclusion_with_confirmations":"spv_merkle_inclusion",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}};Tr._rawTxCommitsTo=function(e,t){var r=String(t).toLowerCase(),i;try{i=new l7(e)}catch{return!1}return i.outputs.some(function(n){var o=n.script;if(!o||!o.chunks||!o.chunks.length)return!1;var a=o.chunks[0].opcodenum===106||o.chunks[0].opcodenum===0&&o.chunks[1]&&o.chunks[1].opcodenum===106;return a?o.chunks.some(function(s){return s.buf&&s.buf.toString("hex").toLowerCase().indexOf(r)!==-1}):!1})};Tr.getCostEstimate=function(e,t){t=t||{};var r=t.feeRate||1,i=200,n=32,o=e*(i+n)*r,a=(i+e*n)*r;return{individual:{totalCost:o,costPerHash:i*r,transactions:e},batch:{totalCost:a,costPerHash:Math.ceil(a/e),transactions:1},savings:{absolute:o-a,percentage:Math.round((o-a)/o*100)}}};Tr.createUTXO=function(e,t,r,i){return{txid:e,outputIndex:t,satoshis:r,script:i}};Tr.generateTestData=function(){var e=new h7,t=new Tr(e),r=k1.sha256(h.Buffer.from("test credential data")),i={issuer:"did:smartledger:test",type:"EmailVerifiedCredential",environment:"test"};return{privateKey:e.toWIF(),address:e.toAddress().toString(),credentialHash:r.toString("hex"),metadata:i,anchor:t}};wD.exports=Tr});var ED=k((Hve,xD)=>{"use strict";v();var d7=Bt(),R1={EmailVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/email/v1"],type:["VerifiableCredential","EmailVerifiedCredential"],requiredFields:["credentialSubject.email","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["email","verified"],properties:{email:{type:"string",format:"email"},verified:{type:"boolean"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},AgeVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/age/v1"],type:["VerifiableCredential","AgeVerifiedCredential"],requiredFields:["credentialSubject.ageOver","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["ageOver","verified"],properties:{ageOver:{type:"number",minimum:0,maximum:150},verified:{type:"boolean"},birthDateHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verificationMethod:{type:"string"}}}}},KYCVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/kyc/v1"],type:["VerifiableCredential","KYCVerifiedCredential"],requiredFields:["credentialSubject.kycLevel","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["kycLevel","verified","verifyingAuthority"],properties:{kycLevel:{type:"string",enum:["basic","enhanced","premium","institutional"]},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},firstNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},lastNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"}}}}},OrganizationCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/organization/v1"],type:["VerifiableCredential","OrganizationCredential"],requiredFields:["credentialSubject.name","credentialSubject.type","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["name","type","verified"],properties:{name:{type:"string"},type:{type:"string",enum:["Corporation","LLC","Partnership","NGO","Government","Other"]},verified:{type:"boolean"},taxIdHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},incorporationState:{type:"string"},industry:{type:"string"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},SSNVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ssn/v1"],type:["VerifiableCredential","SSNVerifiedCredential"],requiredFields:["credentialSubject.ssnHash","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["ssnHash","verified","verifyingAuthority"],properties:{ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},issuingState:{type:"string"}}}}},EducationalCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/education/v1"],type:["VerifiableCredential","EducationalCredential"],requiredFields:["credentialSubject.degree","credentialSubject.institution","credentialSubject.graduationDate"],properties:{credentialSubject:{type:"object",required:["degree","institution","graduationDate"],properties:{degree:{type:"string"},institution:{type:"string"},graduationDate:{type:"string",format:"date"},gpa:{type:"number",minimum:0,maximum:4},major:{type:"string"},honors:{type:"array",items:{type:"string"}}}}}},ProfessionalLicenseCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/license/v1"],type:["VerifiableCredential","ProfessionalLicenseCredential"],requiredFields:["credentialSubject.licenseType","credentialSubject.licenseNumber","credentialSubject.issuingAuthority","credentialSubject.isValid"],properties:{credentialSubject:{type:"object",required:["licenseType","licenseNumber","issuingAuthority","isValid"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},issuingState:{type:"string"},isValid:{type:"boolean"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"}}}}}},Poe={getSchema:function(e){return R1[e]||null},getAllSchemas:function(){return R1},validate:function(e,t){try{d7.checkArgument(e&&typeof e=="object","Invalid credential");var r;if(typeof t=="string"){if(r=R1[t],!r)return{valid:!1,errors:["Unknown schema type: "+t]}}else if(typeof t=="object")r=t;else return{valid:!1,errors:["Invalid schema parameter"]};var i=[],n=[];return this._validateCredentialStructure(e,i),this._validateCredentialTypes(e,r,i),this._validateRequiredFields(e,r,i),this._validateFieldProperties(e,r,i,n),{valid:i.length===0,errors:i,warnings:n}}catch(o){return{valid:!1,errors:["Schema validation error: "+o.message]}}},_validateCredentialStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.type||t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject")},_validateCredentialTypes:function(e,t,r){if(!Array.isArray(e.type)){r.push("Credential type must be array");return}if(t.type&&Array.isArray(t.type))for(var i=0;i<t.type.length;i++)e.type.includes(t.type[i])||r.push("Missing required type: "+t.type[i])},_validateRequiredFields:function(e,t,r){if(t.requiredFields&&Array.isArray(t.requiredFields))for(var i=0;i<t.requiredFields.length;i++){var n=t.requiredFields[i],o=this._getNestedProperty(e,n);o==null&&r.push("Missing required field: "+n)}},_validateFieldProperties:function(e,t,r,i){t.properties&&t.properties.credentialSubject&&this._validateObjectProperties(e.credentialSubject,t.properties.credentialSubject,"credentialSubject",r,i)},_validateObjectProperties:function(e,t,r,i,n){!e||typeof e!="object"||t.properties&&Object.keys(t.properties).forEach(function(o){var a=e[o],s=t.properties[o],u=r+"."+o;a!=null&&this._validateProperty(a,s,u,i,n)}.bind(this))},_validateProperty:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type){i.push("Invalid type for "+r+": expected "+t.type+", got "+o);return}}if(t.type==="string"&&(t.format==="email"&&!this._isValidEmail(e)&&i.push("Invalid email format for "+r),t.format==="date"&&!this._isValidDate(e)&&i.push("Invalid date format for "+r),t.format==="date-time"&&!this._isValidDateTime(e)&&i.push("Invalid date-time format for "+r),t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e)),t.type==="number"&&(t.minimum!==void 0&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),t.maximum!==void 0&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum)),t.type==="array"&&t.items)for(var a=0;a<e.length;a++)this._validateProperty(e[a],t.items,r+"["+a+"]",i,n)},_getNestedProperty:function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)},_isValidEmail:function(e){var t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return t.test(e)},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())},addSchema:function(e,t){d7.checkArgument(typeof e=="string","Schema name must be string"),d7.checkArgument(t&&typeof t=="object","Invalid schema definition"),R1[e]=t},createTemplate:function(e){var t=R1[e];if(!t)throw new Error("Unknown credential type: "+e);var r={"@context":t["@context"]||["https://www.w3.org/2018/credentials/v1"],type:t.type||["VerifiableCredential"],issuer:"did:smartledger:ISSUER_DID_HERE",issuanceDate:new Date().toISOString(),credentialSubject:this._createSubjectTemplate(t.properties?t.properties.credentialSubject:{})};return r},_createSubjectTemplate:function(e){var t={id:"SUBJECT_ID_HERE"};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t},_getDefaultValue:function(e){switch(e.type){case"string":return e.enum?e.enum[0]:e.format==="email"?"example@example.com":e.format==="date"?"2023-01-01":e.format==="date-time"?new Date().toISOString():"PLACEHOLDER_STRING";case"number":return e.minimum||0;case"boolean":return!0;case"array":return[];case"object":return{};default:return null}}};xD.exports=Poe});var ID=k((zve,OD)=>{"use strict";v();var Toe=n5(),ql=o5(),koe=mD(),Roe=bD(),B1=SD(),Boe=ED();function pt(e){if(!(this instanceof pt))return new pt(e);e=e||{},this.didResolver=Toe,this.attestationVerifier=koe,this.zkProver=Roe,this.schemaValidator=Boe,this._attestationSignerOptions=e.attestationSigner||{},this._anchorOptions=e.anchor||{}}pt.prototype.createDID=function(e){return this.didResolver.fromPublicKey(e)};pt.prototype.resolveDID=function(e){return this.didResolver.resolve(e)};pt.prototype.verifyDIDOwnership=function(e,t){return this.didResolver.verifyOwnership(e,t)};pt.prototype.createEmailCredential=function(e,t,r,i){var n=new ql(i,this._attestationSignerOptions);return n.createEmailCredential(r,{issuerDID:e,subjectId:t})};pt.prototype.createAgeCredential=function(e,t,r,i,n){var o=new ql(n,this._attestationSignerOptions);return o.createAgeCredential(r,i,{issuerDID:e,subjectId:t})};pt.prototype.createKYCCredential=function(e,t,r,i,n){var o=new ql(n,this._attestationSignerOptions),a=Object.assign({level:r},i);return o.createKYCCredential(a,{issuerDID:e,subjectId:t})};pt.prototype.createOrganizationCredential=function(e,t,r,i){var n=new ql(i,this._attestationSignerOptions);return n.createOrganizationCredential(r,{issuerDID:e,subjectId:t})};pt.prototype.createPresentation=function(e,t,r,i){var n=new ql(r,this._attestationSignerOptions);return n.createPresentation(e,t,r,i)};pt.prototype.signCredential=function(e,t){var r=new ql(t,this._attestationSignerOptions);return r.signCredential(e,t)};pt.prototype.verifyCredential=function(e,t){return this.attestationVerifier.verifyCredential(e,t)};pt.prototype.verifyPresentation=function(e,t){return this.attestationVerifier.verifyPresentation(e,t)};pt.prototype.extractClaims=function(e){return this.attestationVerifier.extractClaims(e)};pt.prototype.generateSelectiveProof=function(e,t,r){return this.zkProver.generateSelectiveProof(e,t,r)};pt.prototype.verifySelectiveProof=function(e,t){return this.zkProver.verifySelectiveProof(e,t)};pt.prototype.generateAgeProof=function(e,t,r){var i=new Date("1995-06-15");return this.zkProver.generateAgeProof(i,t,r)};pt.prototype.verifyAgeProof=function(e,t,r){return this.zkProver.verifyAgeProof(e,t,r)};pt.prototype.generateRangeProof=function(e,t,r,i){return this.zkProver.generateRangeProof(e,t,r,i)};pt.prototype.verifyRangeProof=function(e,t,r){return this.zkProver.verifyRangeProof(e,t,r)};pt.prototype.generateMembershipProof=function(e,t,r){return this.zkProver.generateMembershipProof(e,t,r)};pt.prototype.verifyMembershipProof=function(e,t){return this.zkProver.verifyMembershipProof(e,t)};pt.prototype.anchorCredential=function(e,t,r){var i=new B1(t,this._anchorOptions);return i.anchorCredential(e,t,r)};pt.prototype.anchorBatch=function(e,t,r){var i=new B1(t,this._anchorOptions);return i.anchorBatch(e,t,r)};pt.prototype.registerDID=function(e,t,r,i){var n=new B1(r,this._anchorOptions);return n.registerDID(e,t,r,i)};pt.prototype.revokeCredential=function(e,t,r,i){var n=new B1(r,this._anchorOptions);return n.revokeCredential(e,t,r,i)};pt.prototype.queryAnchoredData=function(e){var t=new B1(null,this._anchorOptions);return t.queryAnchoredData(e)};pt.prototype.validateCredential=function(e,t){return this.schemaValidator.validate(e,t)};pt.prototype.getSchema=function(e){return this.schemaValidator.getSchema(e)};pt.prototype.getAllSchemas=function(){return this.schemaValidator.getAllSchemas()};pt.prototype.addSchema=function(e,t){return this.schemaValidator.addSchema(e,t)};pt.prototype.createTemplate=function(e){return this.schemaValidator.createTemplate(e)};pt.prototype.generateNonce=function(e){e=e||32;var t=_r();return t.randomBytes(e).toString("hex")};pt.prototype.hashData=function(e,t){var r=_r(),i=r.createHash("sha256");return i.update(e),t&&i.update(t),i.digest("hex")};pt.prototype.getVersion=function(){return"1.0.0"};pt.prototype.getInfo=function(){return{name:"SmartLedger BSV Global Digital Attestation Framework",version:this.getVersion(),description:"W3C-compliant verifiable credentials with DID resolution, zero-knowledge proofs, and blockchain anchoring",components:{didResolver:"DID Resolution and Management",attestationSigner:"Verifiable Credential Creation",attestationVerifier:"Credential and Presentation Verification",zkProver:"Zero-Knowledge Proof Generation and Verification",anchor:"Blockchain Anchoring and Timestamping",schemaValidator:"W3C VC Schema Validation"},standards:["W3C Verifiable Credentials Data Model v1.1","W3C Decentralized Identifiers (DIDs) v1.0","RFC 7515 JSON Web Signature (JWS)","BSV Blockchain Protocol"]}};OD.exports=pt});var PD=k((Vve,AD)=>{"use strict";v();var s5=_r();async function Moe(e){e=e||{};var t=e.alg||"ES256",r=e.kid||"key-"+Date.now();if(t!=="ES256"&&t!=="ES256K")throw new Error("Invalid algorithm. Must be ES256 or ES256K");var i;t==="ES256"?i=s5.generateKeyPairSync("ec",{namedCurve:"P-256",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}}):i=s5.generateKeyPairSync("ec",{namedCurve:"secp256k1",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});var n=s5.createPublicKey(i.publicKey).export({format:"jwk"}),o=s5.createPrivateKey(i.privateKey).export({format:"jwk"});return n.kid=r,n.alg=t,n.use="sig",n.kty="EC",o.kid=r,o.alg=t,o.use="sig",o.kty="EC",{privateJwk:o,publicJwk:n,kid:r,alg:t}}function Noe(e){if(!e.domain)throw new Error("domain is required");var t=e.domain,r="did:web:"+t.replace(/:/g,"%3A"),i=[],n=[];if(e.p256){var o={id:r+"#"+e.p256.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.p256.jwk};i.push(o),n.push(e.p256.jwk)}if(e.k1){var a={id:r+"#"+e.k1.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.k1.jwk};i.push(a),n.push(e.k1.jwk)}if(i.length===0)throw new Error("At least one key (p256 or k1) must be provided");var s={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:r,verificationMethod:i,authentication:i.map(function(c){return c.id}),assertionMethod:i.map(function(c){return c.id})};e.controllerName&&(s.controller=e.controllerName);var u={keys:n};return{did:r,didDocument:s,jwks:u}}function Coe(e){if(!e.domain||!e.newKey)throw new Error("domain and newKey are required");var t=e.domain,r="did:web:"+t.replace(/:/g,"%3A"),i=e.keepOldForDays||30,n={id:r+"#"+e.newKey.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.newKey.jwk},o={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:r,verificationMethod:[n],authentication:[n.id],assertionMethod:[n.id],rotationInfo:{rotatedAt:new Date().toISOString(),gracePeriodDays:i}},a={keys:[e.newKey.jwk]};return{didDocument:o,jwks:a}}AD.exports={generateIssuerKeys:Moe,buildDidWebDocuments:Noe,rotateIssuerKey:Coe}});var p7=k((Zve,TD)=>{"use strict";v();var M1=_r(),N1={ES256:"P-256",ES256K:"secp256k1"},Doe=["ES256","ES256K"];function u5(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function f5(e){for(e=e.replace(/-/g,"+").replace(/_/g,"/");e.length%4;)e+="=";return h.Buffer.from(e,"base64")}async function Loe(e){if(!e.issuerDid||!e.subjectId||!e.credentialSubject||!e.privateJwk)throw new Error("issuerDid, subjectId, credentialSubject, and privateJwk are required");var t=e.alg||"ES256";if(!N1[t])throw new Error("Unsupported algorithm: "+t);if(e.privateJwk.crv&&e.privateJwk.crv!==N1[t])throw new Error("Key curve "+e.privateJwk.crv+" does not match alg "+t);var r=e.kid||e.privateJwk.kid,i=e.types||["VerifiableCredential"],n=e.expSeconds||365*24*60*60,o=Math.floor(Date.now()/1e3),a=new Date().toISOString(),s={"@context":["https://www.w3.org/2018/credentials/v1"],type:i,issuer:e.issuerDid,issuanceDate:a,credentialSubject:Object.assign({id:e.subjectId},e.credentialSubject)},u={iss:e.issuerDid,sub:e.subjectId,iat:o,exp:o+n,vc:s},c={alg:t,typ:"JWT",kid:r},l=u5(h.Buffer.from(JSON.stringify(c))),m=u5(h.Buffer.from(JSON.stringify(u))),w=l+"."+m,E=M1.createPrivateKey({key:e.privateJwk,format:"jwk"}),P=M1.sign("sha256",h.Buffer.from(w),{key:E,dsaEncoding:"ieee-p1363"}),M=u5(P),D=w+"."+M;return{jwt:D}}async function qoe(e,t){t=t||{};try{if(typeof e!="string")return{valid:!1,error:"Invalid JWT format"};var r=e.split(".");if(r.length!==3)return{valid:!1,error:"Invalid JWT format"};var i=r[0],n=r[1],o=r[2],a=JSON.parse(f5(i).toString()),s=JSON.parse(f5(n).toString()),u=f5(o),c=t.allowedAlgs||Doe;if(!a.alg||c.indexOf(a.alg)===-1||!N1[a.alg])return{valid:!1,error:"Algorithm not allowed: "+a.alg,header:a,payload:s};var l=Math.floor(Date.now()/1e3),m=t.clockToleranceSec||60;if(t.requireExpiration&&!s.exp)return{valid:!1,error:"JWT missing required exp claim",header:a,payload:s};if(s.exp&&s.exp<l-m)return{valid:!1,error:"JWT expired",header:a,payload:s};if(s.nbf&&s.nbf>l+m)return{valid:!1,error:"JWT not yet valid",header:a,payload:s};if(t.expectedIssuerDid&&s.iss!==t.expectedIssuerDid)return{valid:!1,error:"Unexpected issuer",header:a,payload:s};var w;if(t.didResolver){var E=await t.didResolver(s.iss);if(!E||!E.jwks||!E.jwks.keys)return{valid:!1,error:"Failed to resolve issuer DID",header:a,payload:s};var P=E.jwks.keys.find(function(U){return U.kid===a.kid});if(!P)return{valid:!1,error:"Key not found in JWKS",header:a,payload:s};w=P}else return{valid:!1,error:"DID resolver required for verification",header:a,payload:s};if(w.crv&&w.crv!==N1[a.alg])return{valid:!1,error:"Key curve does not match algorithm",header:a,payload:s};var M=i+"."+n,D=M1.createPublicKey({key:w,format:"jwk"}),L=M1.verify("sha256",h.Buffer.from(M),{key:D,dsaEncoding:"ieee-p1363"},u);if(!L&&t.allowLegacyDER)try{L=M1.verify("sha256",h.Buffer.from(M),{key:D,dsaEncoding:"der"},u)}catch{L=!1}return L?{valid:!0,header:a,payload:s}:{valid:!1,error:"Invalid signature",header:a,payload:s}}catch(U){return{valid:!1,error:U.message||"Verification failed"}}}TD.exports={issueVcJwt:Loe,verifyVcJwt:qoe,base64UrlEncode:u5,base64UrlDecode:f5,ALG_TO_CRV:N1}});var RD=k((Yve,kD)=>{"use strict";v();function Uoe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}kD.exports=Uoe});var C1=k(Ei=>{"use strict";v();var Foe=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Hoe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Ei.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)Hoe(r,i)&&(e[i]=r[i])}}return e};Ei.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var joe={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+i),n);return}for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){var t,r,i,n,o,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(a=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,n),n+=o.length;return a}},zoe={arraySet:function(e,t,r,i,n){for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};Ei.setTyped=function(e){e?(Ei.Buf8=Uint8Array,Ei.Buf16=Uint16Array,Ei.Buf32=Int32Array,Ei.assign(Ei,joe)):(Ei.Buf8=Array,Ei.Buf16=Array,Ei.Buf32=Array,Ei.assign(Ei,zoe))};Ei.setTyped(Foe)});var eL=k(Hl=>{"use strict";v();var Koe=C1(),Voe=4,BD=0,MD=1,Goe=2;function Fl(e){for(var t=e.length;--t>=0;)e[t]=0}var Zoe=0,UD=1,Woe=2,Yoe=3,$oe=258,w7=29,H1=256,L1=H1+1+w7,Ul=30,S7=19,FD=2*L1+1,kf=15,g7=16,Xoe=7,x7=256,HD=16,jD=17,zD=18,b7=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],c5=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Joe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],KD=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Qoe=512,Ja=new Array((L1+2)*2);Fl(Ja);var D1=new Array(Ul*2);Fl(D1);var q1=new Array(Qoe);Fl(q1);var U1=new Array($oe-Yoe+1);Fl(U1);var E7=new Array(w7);Fl(E7);var l5=new Array(Ul);Fl(l5);function v7(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}var VD,GD,ZD;function m7(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function WD(e){return e<256?q1[e]:q1[256+(e>>>7)]}function F1(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Ci(e,t,r){e.bi_valid>g7-r?(e.bi_buf|=t<<e.bi_valid&65535,F1(e,e.bi_buf),e.bi_buf=t>>g7-e.bi_valid,e.bi_valid+=r-g7):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Xo(e,t,r){Ci(e,r[t*2],r[t*2+1])}function YD(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function eae(e){e.bi_valid===16?(F1(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function tae(e,t){var r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length,c,l,m,w,E,P,M=0;for(w=0;w<=kf;w++)e.bl_count[w]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<FD;c++)l=e.heap[c],w=r[r[l*2+1]*2+1]+1,w>u&&(w=u,M++),r[l*2+1]=w,!(l>i)&&(e.bl_count[w]++,E=0,l>=s&&(E=a[l-s]),P=r[l*2],e.opt_len+=P*(w+E),o&&(e.static_len+=P*(n[l*2+1]+E)));if(M!==0){do{for(w=u-1;e.bl_count[w]===0;)w--;e.bl_count[w]--,e.bl_count[w+1]+=2,e.bl_count[u]--,M-=2}while(M>0);for(w=u;w!==0;w--)for(l=e.bl_count[w];l!==0;)m=e.heap[--c],!(m>i)&&(r[m*2+1]!==w&&(e.opt_len+=(w-r[m*2+1])*r[m*2],r[m*2+1]=w),l--)}}function $D(e,t,r){var i=new Array(kf+1),n=0,o,a;for(o=1;o<=kf;o++)i[o]=n=n+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=YD(i[s]++,s))}}function rae(){var e,t,r,i,n,o=new Array(kf+1);for(r=0,i=0;i<w7-1;i++)for(E7[i]=r,e=0;e<1<<b7[i];e++)U1[r++]=i;for(U1[r-1]=i,n=0,i=0;i<16;i++)for(l5[i]=n,e=0;e<1<<c5[i];e++)q1[n++]=i;for(n>>=7;i<Ul;i++)for(l5[i]=n<<7,e=0;e<1<<c5[i]-7;e++)q1[256+n++]=i;for(t=0;t<=kf;t++)o[t]=0;for(e=0;e<=143;)Ja[e*2+1]=8,e++,o[8]++;for(;e<=255;)Ja[e*2+1]=9,e++,o[9]++;for(;e<=279;)Ja[e*2+1]=7,e++,o[7]++;for(;e<=287;)Ja[e*2+1]=8,e++,o[8]++;for($D(Ja,L1+1,o),e=0;e<Ul;e++)D1[e*2+1]=5,D1[e*2]=YD(e,5);VD=new v7(Ja,b7,H1+1,L1,kf),GD=new v7(D1,c5,0,Ul,kf),ZD=new v7(new Array(0),Joe,0,S7,Xoe)}function XD(e){var t;for(t=0;t<L1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Ul;t++)e.dyn_dtree[t*2]=0;for(t=0;t<S7;t++)e.bl_tree[t*2]=0;e.dyn_ltree[x7*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function JD(e){e.bi_valid>8?F1(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function iae(e,t,r,i){JD(e),i&&(F1(e,r),F1(e,~r)),Koe.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function ND(e,t,r,i){var n=t*2,o=r*2;return e[n]<e[o]||e[n]===e[o]&&i[t]<=i[r]}function y7(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&ND(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!ND(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function CD(e,t,r){var i,n,o=0,a,s;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],n=e.pending_buf[e.l_buf+o],o++,i===0?Xo(e,n,t):(a=U1[n],Xo(e,a+H1+1,t),s=b7[a],s!==0&&(n-=E7[a],Ci(e,n,s)),i--,a=WD(i),Xo(e,a,r),s=c5[a],s!==0&&(i-=l5[a],Ci(e,i,s)));while(o<e.last_lit);Xo(e,x7,t)}function _7(e,t){var r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,u=-1,c;for(e.heap_len=0,e.heap_max=FD,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=u=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=i[c*2+1]);for(t.max_code=u,a=e.heap_len>>1;a>=1;a--)y7(e,r,a);c=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],y7(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[c*2]=r[a*2]+r[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=c,e.heap[1]=c++,y7(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],tae(e,t),$D(r,u,e.bl_count)}function DD(e,t,r){var i,n=-1,o,a=t[1],s=0,u=7,c=4;for(a===0&&(u=138,c=3),t[(r+1)*2+1]=65535,i=0;i<=r;i++)o=a,a=t[(i+1)*2+1],!(++s<u&&o===a)&&(s<c?e.bl_tree[o*2]+=s:o!==0?(o!==n&&e.bl_tree[o*2]++,e.bl_tree[HD*2]++):s<=10?e.bl_tree[jD*2]++:e.bl_tree[zD*2]++,s=0,n=o,a===0?(u=138,c=3):o===a?(u=6,c=3):(u=7,c=4))}function LD(e,t,r){var i,n=-1,o,a=t[1],s=0,u=7,c=4;for(a===0&&(u=138,c=3),i=0;i<=r;i++)if(o=a,a=t[(i+1)*2+1],!(++s<u&&o===a)){if(s<c)do Xo(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==n&&(Xo(e,o,e.bl_tree),s--),Xo(e,HD,e.bl_tree),Ci(e,s-3,2)):s<=10?(Xo(e,jD,e.bl_tree),Ci(e,s-3,3)):(Xo(e,zD,e.bl_tree),Ci(e,s-11,7));s=0,n=o,a===0?(u=138,c=3):o===a?(u=6,c=3):(u=7,c=4)}}function nae(e){var t;for(DD(e,e.dyn_ltree,e.l_desc.max_code),DD(e,e.dyn_dtree,e.d_desc.max_code),_7(e,e.bl_desc),t=S7-1;t>=3&&e.bl_tree[KD[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function oae(e,t,r,i){var n;for(Ci(e,t-257,5),Ci(e,r-1,5),Ci(e,i-4,4),n=0;n<i;n++)Ci(e,e.bl_tree[KD[n]*2+1],3);LD(e,e.dyn_ltree,t-1),LD(e,e.dyn_dtree,r-1)}function aae(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return BD;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return MD;for(r=32;r<H1;r++)if(e.dyn_ltree[r*2]!==0)return MD;return BD}var qD=!1;function sae(e){qD||(rae(),qD=!0),e.l_desc=new m7(e.dyn_ltree,VD),e.d_desc=new m7(e.dyn_dtree,GD),e.bl_desc=new m7(e.bl_tree,ZD),e.bi_buf=0,e.bi_valid=0,XD(e)}function QD(e,t,r,i){Ci(e,(Zoe<<1)+(i?1:0),3),iae(e,t,r,!0)}function uae(e){Ci(e,UD<<1,3),Xo(e,x7,Ja),eae(e)}function fae(e,t,r,i){var n,o,a=0;e.level>0?(e.strm.data_type===Goe&&(e.strm.data_type=aae(e)),_7(e,e.l_desc),_7(e,e.d_desc),a=nae(e),n=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&t!==-1?QD(e,t,r,i):e.strategy===Voe||o===n?(Ci(e,(UD<<1)+(i?1:0),3),CD(e,Ja,D1)):(Ci(e,(Woe<<1)+(i?1:0),3),oae(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),CD(e,e.dyn_ltree,e.dyn_dtree)),XD(e),i&&JD(e)}function cae(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(U1[r]+H1+1)*2]++,e.dyn_dtree[WD(t)*2]++),e.last_lit===e.lit_bufsize-1}Hl._tr_init=sae;Hl._tr_stored_block=QD;Hl._tr_flush_block=fae;Hl._tr_tally=cae;Hl._tr_align=uae});var O7=k((tme,tL)=>{"use strict";v();function lae(e,t,r,i){for(var n=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do n=n+t[i++]|0,o=o+n|0;while(--a);n%=65521,o%=65521}return n|o<<16|0}tL.exports=lae});var I7=k((ime,rL)=>{"use strict";v();function hae(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var dae=hae();function pae(e,t,r,i){var n=dae,o=i+r;e^=-1;for(var a=i;a<o;a++)e=e>>>8^n[(e^t[a])&255];return e^-1}rL.exports=pae});var nL=k((ome,iL)=>{"use strict";v();iL.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var dL=k(ea=>{"use strict";v();var Oi=C1(),On=eL(),uL=O7(),js=I7(),gae=nL(),Nf=0,vae=1,mae=3,Zs=4,oL=5,Qo=0,aL=1,In=-2,yae=-3,A7=-5,bae=-1,_ae=1,h5=2,wae=3,Sae=4,xae=0,Eae=2,v5=8,Oae=9,Iae=15,Aae=8,Pae=29,Tae=256,T7=Tae+1+Pae,kae=30,Rae=19,Bae=2*T7+1,Mae=15,bt=3,Vs=258,uo=Vs+bt+1,Nae=32,m5=42,k7=69,d5=73,p5=91,g5=103,Rf=113,z1=666,Ur=1,K1=2,Bf=3,Kl=4,Cae=3;function Gs(e,t){return e.msg=gae[t],t}function sL(e){return(e<<1)-(e>4?9:0)}function Ks(e){for(var t=e.length;--t>=0;)e[t]=0}function zs(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(Oi.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function ai(e,t){On._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,zs(e.strm)}function Pt(e,t){e.pending_buf[e.pending++]=t}function j1(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Dae(e,t,r,i){var n=e.avail_in;return n>i&&(n=i),n===0?0:(e.avail_in-=n,Oi.arraySet(t,e.input,e.next_in,n,r),e.state.wrap===1?e.adler=uL(e.adler,t,n,r):e.state.wrap===2&&(e.adler=js(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function fL(e,t){var r=e.max_chain_length,i=e.strstart,n,o,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-uo?e.strstart-(e.w_size-uo):0,c=e.window,l=e.w_mask,m=e.prev,w=e.strstart+Vs,E=c[i+a-1],P=c[i+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(n=t,!(c[n+a]!==P||c[n+a-1]!==E||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<w);if(o=Vs-(w-i),i=w-Vs,o>a){if(e.match_start=t,a=o,o>=s)break;E=c[i+a-1],P=c[i+a]}}while((t=m[t&l])>u&&--r!==0);return a<=e.lookahead?a:e.lookahead}function Mf(e){var t=e.w_size,r,i,n,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-uo)){Oi.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,r=i;do n=e.head[--r],e.head[r]=n>=t?n-t:0;while(--i);i=t,r=i;do n=e.prev[--r],e.prev[r]=n>=t?n-t:0;while(--i);o+=t}if(e.strm.avail_in===0)break;if(i=Dae(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=bt)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+bt-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<bt)););}while(e.lookahead<uo&&e.strm.avail_in!==0)}function Lae(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Mf(e),e.lookahead===0&&t===Nf)return Ur;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,ai(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-uo&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Zs?(ai(e,!0),e.strm.avail_out===0?Bf:Kl):(e.strstart>e.block_start&&(ai(e,!1),e.strm.avail_out===0),Ur)}function P7(e,t){for(var r,i;;){if(e.lookahead<uo){if(Mf(e),e.lookahead<uo&&t===Nf)return Ur;if(e.lookahead===0)break}if(r=0,e.lookahead>=bt&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-uo&&(e.match_length=fL(e,r)),e.match_length>=bt)if(i=On._tr_tally(e,e.strstart-e.match_start,e.match_length-bt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=bt){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=e.strstart<bt-1?e.strstart:bt-1,t===Zs?(ai(e,!0),e.strm.avail_out===0?Bf:Kl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:K1}function jl(e,t){for(var r,i,n;;){if(e.lookahead<uo){if(Mf(e),e.lookahead<uo&&t===Nf)return Ur;if(e.lookahead===0)break}if(r=0,e.lookahead>=bt&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=bt-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-uo&&(e.match_length=fL(e,r),e.match_length<=5&&(e.strategy===_ae||e.match_length===bt&&e.strstart-e.match_start>4096)&&(e.match_length=bt-1)),e.prev_length>=bt&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-bt,i=On._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-bt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=bt-1,e.strstart++,i&&(ai(e,!1),e.strm.avail_out===0))return Ur}else if(e.match_available){if(i=On._tr_tally(e,0,e.window[e.strstart-1]),i&&ai(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Ur}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=On._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<bt-1?e.strstart:bt-1,t===Zs?(ai(e,!0),e.strm.avail_out===0?Bf:Kl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:K1}function qae(e,t){for(var r,i,n,o,a=e.window;;){if(e.lookahead<=Vs){if(Mf(e),e.lookahead<=Vs&&t===Nf)return Ur;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=bt&&e.strstart>0&&(n=e.strstart-1,i=a[n],i===a[++n]&&i===a[++n]&&i===a[++n])){o=e.strstart+Vs;do;while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<o);e.match_length=Vs-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=bt?(r=On._tr_tally(e,1,e.match_length-bt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Zs?(ai(e,!0),e.strm.avail_out===0?Bf:Kl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:K1}function Uae(e,t){for(var r;;){if(e.lookahead===0&&(Mf(e),e.lookahead===0)){if(t===Nf)return Ur;break}if(e.match_length=0,r=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Zs?(ai(e,!0),e.strm.avail_out===0?Bf:Kl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:K1}function Jo(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}var zl;zl=[new Jo(0,0,0,0,Lae),new Jo(4,4,8,4,P7),new Jo(4,5,16,8,P7),new Jo(4,6,32,32,P7),new Jo(4,4,16,16,jl),new Jo(8,16,32,32,jl),new Jo(8,16,128,128,jl),new Jo(8,32,128,256,jl),new Jo(32,128,258,1024,jl),new Jo(32,258,258,4096,jl)];function Fae(e){e.window_size=2*e.w_size,Ks(e.head),e.max_lazy_match=zl[e.level].max_lazy,e.good_match=zl[e.level].good_length,e.nice_match=zl[e.level].nice_length,e.max_chain_length=zl[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=bt-1,e.match_available=0,e.ins_h=0}function Hae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v5,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Oi.Buf16(Bae*2),this.dyn_dtree=new Oi.Buf16((2*kae+1)*2),this.bl_tree=new Oi.Buf16((2*Rae+1)*2),Ks(this.dyn_ltree),Ks(this.dyn_dtree),Ks(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Oi.Buf16(Mae+1),this.heap=new Oi.Buf16(2*T7+1),Ks(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Oi.Buf16(2*T7+1),Ks(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function cL(e){var t;return!e||!e.state?Gs(e,In):(e.total_in=e.total_out=0,e.data_type=Eae,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?m5:Rf,e.adler=t.wrap===2?0:1,t.last_flush=Nf,On._tr_init(t),Qo)}function lL(e){var t=cL(e);return t===Qo&&Fae(e.state),t}function jae(e,t){return!e||!e.state||e.state.wrap!==2?In:(e.state.gzhead=t,Qo)}function hL(e,t,r,i,n,o){if(!e)return In;var a=1;if(t===bae&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>Oae||r!==v5||i<8||i>15||t<0||t>9||o<0||o>Sae)return Gs(e,In);i===8&&(i=9);var s=new Hae;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+bt-1)/bt),s.window=new Oi.Buf8(s.w_size*2),s.head=new Oi.Buf16(s.hash_size),s.prev=new Oi.Buf16(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Oi.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,lL(e)}function zae(e,t){return hL(e,t,v5,Iae,Aae,xae)}function Kae(e,t){var r,i,n,o;if(!e||!e.state||t>oL||t<0)return e?Gs(e,In):In;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===z1&&t!==Zs)return Gs(e,e.avail_out===0?A7:In);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===m5)if(i.wrap===2)e.adler=0,Pt(i,31),Pt(i,139),Pt(i,8),i.gzhead?(Pt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Pt(i,i.gzhead.time&255),Pt(i,i.gzhead.time>>8&255),Pt(i,i.gzhead.time>>16&255),Pt(i,i.gzhead.time>>24&255),Pt(i,i.level===9?2:i.strategy>=h5||i.level<2?4:0),Pt(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Pt(i,i.gzhead.extra.length&255),Pt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=js(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=k7):(Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,i.level===9?2:i.strategy>=h5||i.level<2?4:0),Pt(i,Cae),i.status=Rf);else{var a=v5+(i.w_bits-8<<4)<<8,s=-1;i.strategy>=h5||i.level<2?s=0:i.level<6?s=1:i.level===6?s=2:s=3,a|=s<<6,i.strstart!==0&&(a|=Nae),a+=31-a%31,i.status=Rf,j1(i,a),i.strstart!==0&&(j1(i,e.adler>>>16),j1(i,e.adler&65535)),e.adler=1}if(i.status===k7)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=js(e.adler,i.pending_buf,i.pending-n,n)),zs(e),n=i.pending,i.pending===i.pending_buf_size));)Pt(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=js(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=d5)}else i.status=d5;if(i.status===d5)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=js(e.adler,i.pending_buf,i.pending-n,n)),zs(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,Pt(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=js(e.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.gzindex=0,i.status=p5)}else i.status=p5;if(i.status===p5)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=js(e.adler,i.pending_buf,i.pending-n,n)),zs(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,Pt(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=js(e.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.status=g5)}else i.status=g5;if(i.status===g5&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&zs(e),i.pending+2<=i.pending_buf_size&&(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),e.adler=0,i.status=Rf)):i.status=Rf),i.pending!==0){if(zs(e),e.avail_out===0)return i.last_flush=-1,Qo}else if(e.avail_in===0&&sL(t)<=sL(r)&&t!==Zs)return Gs(e,A7);if(i.status===z1&&e.avail_in!==0)return Gs(e,A7);if(e.avail_in!==0||i.lookahead!==0||t!==Nf&&i.status!==z1){var u=i.strategy===h5?Uae(i,t):i.strategy===wae?qae(i,t):zl[i.level].func(i,t);if((u===Bf||u===Kl)&&(i.status=z1),u===Ur||u===Bf)return e.avail_out===0&&(i.last_flush=-1),Qo;if(u===K1&&(t===vae?On._tr_align(i):t!==oL&&(On._tr_stored_block(i,0,0,!1),t===mae&&(Ks(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),zs(e),e.avail_out===0))return i.last_flush=-1,Qo}return t!==Zs?Qo:i.wrap<=0?aL:(i.wrap===2?(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),Pt(i,e.adler>>16&255),Pt(i,e.adler>>24&255),Pt(i,e.total_in&255),Pt(i,e.total_in>>8&255),Pt(i,e.total_in>>16&255),Pt(i,e.total_in>>24&255)):(j1(i,e.adler>>>16),j1(i,e.adler&65535)),zs(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Qo:aL)}function Vae(e){var t;return!e||!e.state?In:(t=e.state.status,t!==m5&&t!==k7&&t!==d5&&t!==p5&&t!==g5&&t!==Rf&&t!==z1?Gs(e,In):(e.state=null,t===Rf?Gs(e,yae):Qo))}function Gae(e,t){var r=t.length,i,n,o,a,s,u,c,l;if(!e||!e.state||(i=e.state,a=i.wrap,a===2||a===1&&i.status!==m5||i.lookahead))return In;for(a===1&&(e.adler=uL(e.adler,t,r,0)),i.wrap=0,r>=i.w_size&&(a===0&&(Ks(i.head),i.strstart=0,i.block_start=0,i.insert=0),l=new Oi.Buf8(i.w_size),Oi.arraySet(l,t,r-i.w_size,i.w_size,0),t=l,r=i.w_size),s=e.avail_in,u=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,Mf(i);i.lookahead>=bt;){n=i.strstart,o=i.lookahead-(bt-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+bt-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--o);i.strstart=n,i.lookahead=bt-1,Mf(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=bt-1,i.match_available=0,e.next_in=u,e.input=c,e.avail_in=s,i.wrap=a,Qo}ea.deflateInit=zae;ea.deflateInit2=hL;ea.deflateReset=lL;ea.deflateResetKeep=cL;ea.deflateSetHeader=jae;ea.deflate=Kae;ea.deflateEnd=Vae;ea.deflateSetDictionary=Gae;ea.deflateInfo="pako deflate (from Nodeca project)"});var gL=k((fme,pL)=>{"use strict";v();var y5=30,Zae=12;pL.exports=function(t,r){var i,n,o,a,s,u,c,l,m,w,E,P,M,D,L,U,K,N,C,F,H,z,G,B,g;i=t.state,n=t.next_in,B=t.input,o=n+(t.avail_in-5),a=t.next_out,g=t.output,s=a-(r-t.avail_out),u=a+(t.avail_out-257),c=i.dmax,l=i.wsize,m=i.whave,w=i.wnext,E=i.window,P=i.hold,M=i.bits,D=i.lencode,L=i.distcode,U=(1<<i.lenbits)-1,K=(1<<i.distbits)-1;e:do{M<15&&(P+=B[n++]<<M,M+=8,P+=B[n++]<<M,M+=8),N=D[P&U];t:for(;;){if(C=N>>>24,P>>>=C,M-=C,C=N>>>16&255,C===0)g[a++]=N&65535;else if(C&16){F=N&65535,C&=15,C&&(M<C&&(P+=B[n++]<<M,M+=8),F+=P&(1<<C)-1,P>>>=C,M-=C),M<15&&(P+=B[n++]<<M,M+=8,P+=B[n++]<<M,M+=8),N=L[P&K];r:for(;;){if(C=N>>>24,P>>>=C,M-=C,C=N>>>16&255,C&16){if(H=N&65535,C&=15,M<C&&(P+=B[n++]<<M,M+=8,M<C&&(P+=B[n++]<<M,M+=8)),H+=P&(1<<C)-1,H>c){t.msg="invalid distance too far back",i.mode=y5;break e}if(P>>>=C,M-=C,C=a-s,H>C){if(C=H-C,C>m&&i.sane){t.msg="invalid distance too far back",i.mode=y5;break e}if(z=0,G=E,w===0){if(z+=l-C,C<F){F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}}else if(w<C){if(z+=l+w-C,C-=w,C<F){F-=C;do g[a++]=E[z++];while(--C);if(z=0,w<F){C=w,F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}}}else if(z+=w-C,C<F){F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}for(;F>2;)g[a++]=G[z++],g[a++]=G[z++],g[a++]=G[z++],F-=3;F&&(g[a++]=G[z++],F>1&&(g[a++]=G[z++]))}else{z=a-H;do g[a++]=g[z++],g[a++]=g[z++],g[a++]=g[z++],F-=3;while(F>2);F&&(g[a++]=g[z++],F>1&&(g[a++]=g[z++]))}}else if((C&64)===0){N=L[(N&65535)+(P&(1<<C)-1)];continue r}else{t.msg="invalid distance code",i.mode=y5;break e}break}}else if((C&64)===0){N=D[(N&65535)+(P&(1<<C)-1)];continue t}else if(C&32){i.mode=Zae;break e}else{t.msg="invalid literal/length code",i.mode=y5;break e}break}}while(n<o&&a<u);F=M>>3,n-=F,M-=F<<3,P&=(1<<M)-1,t.next_in=n,t.next_out=a,t.avail_in=n<o?5+(o-n):5-(n-o),t.avail_out=a<u?257+(u-a):257-(a-u),i.hold=P,i.bits=M}});var SL=k((lme,wL)=>{"use strict";v();var vL=C1(),Vl=15,mL=852,yL=592,bL=0,R7=1,_L=2,Wae=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Yae=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],$ae=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Xae=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];wL.exports=function(t,r,i,n,o,a,s,u){var c=u.bits,l=0,m=0,w=0,E=0,P=0,M=0,D=0,L=0,U=0,K=0,N,C,F,H,z,G=null,B=0,g,O=new vL.Buf16(Vl+1),y=new vL.Buf16(Vl+1),f=null,d=0,_,x,b;for(l=0;l<=Vl;l++)O[l]=0;for(m=0;m<n;m++)O[r[i+m]]++;for(P=c,E=Vl;E>=1&&O[E]===0;E--);if(P>E&&(P=E),E===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,u.bits=1,0;for(w=1;w<E&&O[w]===0;w++);for(P<w&&(P=w),L=1,l=1;l<=Vl;l++)if(L<<=1,L-=O[l],L<0)return-1;if(L>0&&(t===bL||E!==1))return-1;for(y[1]=0,l=1;l<Vl;l++)y[l+1]=y[l]+O[l];for(m=0;m<n;m++)r[i+m]!==0&&(s[y[r[i+m]]++]=m);if(t===bL?(G=f=s,g=19):t===R7?(G=Wae,B-=257,f=Yae,d-=257,g=256):(G=$ae,f=Xae,g=-1),K=0,m=0,l=w,z=a,M=P,D=0,F=-1,U=1<<P,H=U-1,t===R7&&U>mL||t===_L&&U>yL)return 1;for(;;){_=l-D,s[m]<g?(x=0,b=s[m]):s[m]>g?(x=f[d+s[m]],b=G[B+s[m]]):(x=96,b=0),N=1<<l-D,C=1<<M,w=C;do C-=N,o[z+(K>>D)+C]=_<<24|x<<16|b|0;while(C!==0);for(N=1<<l-1;K&N;)N>>=1;if(N!==0?(K&=N-1,K+=N):K=0,m++,--O[l]===0){if(l===E)break;l=r[i+s[m]]}if(l>P&&(K&H)!==F){for(D===0&&(D=P),z+=w,M=l-D,L=1<<M;M+D<E&&(L-=O[M+D],!(L<=0));)M++,L<<=1;if(U+=1<<M,t===R7&&U>mL||t===_L&&U>yL)return 1;F=K&H,o[F]=P<<24|M<<16|z-a|0}}return K!==0&&(o[z+K]=l-D<<24|64<<16|0),u.bits=P,0}});var iq=k(fo=>{"use strict";v();var Wi=C1(),L7=O7(),ta=I7(),Jae=gL(),V1=SL(),Qae=0,WL=1,YL=2,xL=4,ese=5,b5=6,Cf=0,tse=1,rse=2,An=-2,$L=-3,q7=-4,ise=-5,EL=8,XL=1,OL=2,IL=3,AL=4,PL=5,TL=6,kL=7,RL=8,BL=9,ML=10,S5=11,Qa=12,B7=13,NL=14,M7=15,CL=16,DL=17,LL=18,qL=19,_5=20,w5=21,UL=22,FL=23,HL=24,jL=25,zL=26,N7=27,KL=28,VL=29,ir=30,U7=31,nse=32,ose=852,ase=592,sse=15,use=sse;function GL(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function fse(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Wi.Buf16(320),this.work=new Wi.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function JL(e){var t;return!e||!e.state?An:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=XL,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Wi.Buf32(ose),t.distcode=t.distdyn=new Wi.Buf32(ase),t.sane=1,t.back=-1,Cf)}function QL(e){var t;return!e||!e.state?An:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,JL(e))}function eq(e,t){var r,i;return!e||!e.state||(i=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?An:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,QL(e))}function tq(e,t){var r,i;return e?(i=new fse,e.state=i,i.window=null,r=eq(e,t),r!==Cf&&(e.state=null),r):An}function cse(e){return tq(e,use)}var ZL=!0,C7,D7;function lse(e){if(ZL){var t;for(C7=new Wi.Buf32(512),D7=new Wi.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(V1(WL,e.lens,0,288,C7,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;V1(YL,e.lens,0,32,D7,0,e.work,{bits:5}),ZL=!1}e.lencode=C7,e.lenbits=9,e.distcode=D7,e.distbits=5}function rq(e,t,r,i){var n,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Wi.Buf8(o.wsize)),i>=o.wsize?(Wi.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),Wi.arraySet(o.window,t,r-i,n,o.wnext),i-=n,i?(Wi.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}function hse(e,t){var r,i,n,o,a,s,u,c,l,m,w,E,P,M,D=0,L,U,K,N,C,F,H,z,G=new Wi.Buf8(4),B,g,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return An;r=e.state,r.mode===Qa&&(r.mode=B7),a=e.next_out,n=e.output,u=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,c=r.hold,l=r.bits,m=s,w=u,z=Cf;e:for(;;)switch(r.mode){case XL:if(r.wrap===0){r.mode=B7;break}for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0),c=0,l=0,r.mode=OL;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ir;break}if((c&15)!==EL){e.msg="unknown compression method",r.mode=ir;break}if(c>>>=4,l-=4,H=(c&15)+8,r.wbits===0)r.wbits=H;else if(H>r.wbits){e.msg="invalid window size",r.mode=ir;break}r.dmax=1<<H,e.adler=r.check=1,r.mode=c&512?ML:Qa,c=0,l=0;break;case OL:for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==EL){e.msg="unknown compression method",r.mode=ir;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=ir;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0,r.mode=IL;case IL:for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,G[2]=c>>>16&255,G[3]=c>>>24&255,r.check=ta(r.check,G,4,0)),c=0,l=0,r.mode=AL;case AL:for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0,r.mode=PL;case PL:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=TL;case TL:if(r.flags&1024&&(E=r.length,E>s&&(E=s),E&&(r.head&&(H=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Wi.arraySet(r.head.extra,i,o,E,H)),r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,r.length-=E),r.length))break e;r.length=0,r.mode=kL;case kL:if(r.flags&2048){if(s===0)break e;E=0;do H=i[o+E++],r.head&&H&&r.length<65536&&(r.head.name+=String.fromCharCode(H));while(H&&E<s);if(r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,H)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=RL;case RL:if(r.flags&4096){if(s===0)break e;E=0;do H=i[o+E++],r.head&&H&&r.length<65536&&(r.head.comment+=String.fromCharCode(H));while(H&&E<s);if(r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,H)break e}else r.head&&(r.head.comment=null);r.mode=BL;case BL:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=ir;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Qa;break;case ML:for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}e.adler=r.check=GL(c),c=0,l=0,r.mode=S5;case S5:if(r.havedict===0)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,rse;e.adler=r.check=1,r.mode=Qa;case Qa:if(t===ese||t===b5)break e;case B7:if(r.last){c>>>=l&7,l-=l&7,r.mode=N7;break}for(;l<3;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=NL;break;case 1:if(lse(r),r.mode=_5,t===b5){c>>>=2,l-=2;break e}break;case 2:r.mode=DL;break;case 3:e.msg="invalid block type",r.mode=ir}c>>>=2,l-=2;break;case NL:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=ir;break}if(r.length=c&65535,c=0,l=0,r.mode=M7,t===b5)break e;case M7:r.mode=CL;case CL:if(E=r.length,E){if(E>s&&(E=s),E>u&&(E=u),E===0)break e;Wi.arraySet(n,i,o,E,a),s-=E,o+=E,u-=E,a+=E,r.length-=E;break}r.mode=Qa;break;case DL:for(;l<14;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ir;break}r.have=0,r.mode=LL;case LL:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.lens[O[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,B={bits:r.lenbits},z=V1(Qae,r.lens,0,19,r.lencode,0,r.work,B),r.lenbits=B.bits,z){e.msg="invalid code lengths set",r.mode=ir;break}r.have=0,r.mode=qL;case qL:for(;r.have<r.nlen+r.ndist;){for(;D=r.lencode[c&(1<<r.lenbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(K<16)c>>>=L,l-=L,r.lens[r.have++]=K;else{if(K===16){for(g=L+2;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c>>>=L,l-=L,r.have===0){e.msg="invalid bit length repeat",r.mode=ir;break}H=r.lens[r.have-1],E=3+(c&3),c>>>=2,l-=2}else if(K===17){for(g=L+3;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=L,l-=L,H=0,E=3+(c&7),c>>>=3,l-=3}else{for(g=L+7;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=L,l-=L,H=0,E=11+(c&127),c>>>=7,l-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ir;break}for(;E--;)r.lens[r.have++]=H}}if(r.mode===ir)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=ir;break}if(r.lenbits=9,B={bits:r.lenbits},z=V1(WL,r.lens,0,r.nlen,r.lencode,0,r.work,B),r.lenbits=B.bits,z){e.msg="invalid literal/lengths set",r.mode=ir;break}if(r.distbits=6,r.distcode=r.distdyn,B={bits:r.distbits},z=V1(YL,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,B),r.distbits=B.bits,z){e.msg="invalid distances set",r.mode=ir;break}if(r.mode=_5,t===b5)break e;case _5:r.mode=w5;case w5:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,Jae(e,w),a=e.next_out,n=e.output,u=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,c=r.hold,l=r.bits,r.mode===Qa&&(r.back=-1);break}for(r.back=0;D=r.lencode[c&(1<<r.lenbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(U&&(U&240)===0){for(N=L,C=U,F=K;D=r.lencode[F+((c&(1<<N+C)-1)>>N)],L=D>>>24,U=D>>>16&255,K=D&65535,!(N+L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=N,l-=N,r.back+=N}if(c>>>=L,l-=L,r.back+=L,r.length=K,U===0){r.mode=zL;break}if(U&32){r.back=-1,r.mode=Qa;break}if(U&64){e.msg="invalid literal/length code",r.mode=ir;break}r.extra=U&15,r.mode=UL;case UL:if(r.extra){for(g=r.extra;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=FL;case FL:for(;D=r.distcode[c&(1<<r.distbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if((U&240)===0){for(N=L,C=U,F=K;D=r.distcode[F+((c&(1<<N+C)-1)>>N)],L=D>>>24,U=D>>>16&255,K=D&65535,!(N+L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=N,l-=N,r.back+=N}if(c>>>=L,l-=L,r.back+=L,U&64){e.msg="invalid distance code",r.mode=ir;break}r.offset=K,r.extra=U&15,r.mode=HL;case HL:if(r.extra){for(g=r.extra;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ir;break}r.mode=jL;case jL:if(u===0)break e;if(E=w-u,r.offset>E){if(E=r.offset-E,E>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ir;break}E>r.wnext?(E-=r.wnext,P=r.wsize-E):P=r.wnext-E,E>r.length&&(E=r.length),M=r.window}else M=n,P=a-r.offset,E=r.length;E>u&&(E=u),u-=E,r.length-=E;do n[a++]=M[P++];while(--E);r.length===0&&(r.mode=w5);break;case zL:if(u===0)break e;n[a++]=r.length,u--,r.mode=w5;break;case N7:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=i[o++]<<l,l+=8}if(w-=u,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?ta(r.check,n,w,a-w):L7(r.check,n,w,a-w)),w=u,(r.flags?c:GL(c))!==r.check){e.msg="incorrect data check",r.mode=ir;break}c=0,l=0}r.mode=KL;case KL:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=ir;break}c=0,l=0}r.mode=VL;case VL:z=tse;break e;case ir:z=$L;break e;case U7:return q7;case nse:default:return An}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,(r.wsize||w!==e.avail_out&&r.mode<ir&&(r.mode<N7||t!==xL))&&rq(e,e.output,e.next_out,w-e.avail_out)?(r.mode=U7,q7):(m-=e.avail_in,w-=e.avail_out,e.total_in+=m,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?ta(r.check,n,w,e.next_out-w):L7(r.check,n,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Qa?128:0)+(r.mode===_5||r.mode===M7?256:0),(m===0&&w===0||t===xL)&&z===Cf&&(z=ise),z)}function dse(e){if(!e||!e.state)return An;var t=e.state;return t.window&&(t.window=null),e.state=null,Cf}function pse(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)===0)?An:(r.head=t,t.done=!1,Cf)}function gse(e,t){var r=t.length,i,n,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==S5)?An:i.mode===S5&&(n=1,n=L7(n,t,r,0),n!==i.check)?$L:(o=rq(e,t,r,r),o?(i.mode=U7,q7):(i.havedict=1,Cf))}fo.inflateReset=QL;fo.inflateReset2=eq;fo.inflateResetKeep=JL;fo.inflateInit=cse;fo.inflateInit2=tq;fo.inflate=hse;fo.inflateEnd=dse;fo.inflateGetHeader=pse;fo.inflateSetDictionary=gse;fo.inflateInfo="pako inflate (from Nodeca project)"});var oq=k((gme,nq)=>{"use strict";v();nq.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var sq=k(de=>{"use strict";v();var Yi=Es(),vse=RD(),G1=dL(),Df=iq(),aq=oq();for(F7 in aq)de[F7]=aq[F7];var F7;de.NONE=0;de.DEFLATE=1;de.INFLATE=2;de.GZIP=3;de.GUNZIP=4;de.DEFLATERAW=5;de.INFLATERAW=6;de.UNZIP=7;var mse=31,yse=139;function mi(e){if(typeof e!="number"||e<de.DEFLATE||e>de.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}mi.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,Yi(this.init_done,"close before init"),Yi(this.mode<=de.UNZIP),this.mode===de.DEFLATE||this.mode===de.GZIP||this.mode===de.DEFLATERAW?G1.deflateEnd(this.strm):(this.mode===de.INFLATE||this.mode===de.GUNZIP||this.mode===de.INFLATERAW||this.mode===de.UNZIP)&&Df.inflateEnd(this.strm),this.mode=de.NONE,this.dictionary=null};mi.prototype.write=function(e,t,r,i,n,o,a){return this._write(!0,e,t,r,i,n,o,a)};mi.prototype.writeSync=function(e,t,r,i,n,o,a){return this._write(!1,e,t,r,i,n,o,a)};mi.prototype._write=function(e,t,r,i,n,o,a,s){if(Yi.equal(arguments.length,8),Yi(this.init_done,"write before init"),Yi(this.mode!==de.NONE,"already finalized"),Yi.equal(!1,this.write_in_progress,"write already in progress"),Yi.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,Yi.equal(!1,t===void 0,"must provide flush value"),this.write_in_progress=!0,t!==de.Z_NO_FLUSH&&t!==de.Z_PARTIAL_FLUSH&&t!==de.Z_SYNC_FLUSH&&t!==de.Z_FULL_FLUSH&&t!==de.Z_FINISH&&t!==de.Z_BLOCK)throw new Error("Invalid flush value");if(r==null&&(r=h.Buffer.alloc(0),n=0,i=0),this.strm.avail_in=n,this.strm.input=r,this.strm.next_in=i,this.strm.avail_out=s,this.strm.output=o,this.strm.next_out=a,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var u=this;return A.default.nextTick(function(){u._process(),u._after()}),this};mi.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]};mi.prototype._process=function(){var e=null;switch(this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=G1.deflate(this.strm,this.flush);break;case de.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(e===null)break;if(this.strm.input[e]===mse){if(this.gzip_id_bytes_read=1,e++,this.strm.avail_in===1)break}else{this.mode=de.INFLATE;break}case 1:if(e===null)break;this.strm.input[e]===yse?(this.gzip_id_bytes_read=2,this.mode=de.GUNZIP):this.mode=de.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:for(this.err=Df.inflate(this.strm,this.flush),this.err===de.Z_NEED_DICT&&this.dictionary&&(this.err=Df.inflateSetDictionary(this.strm,this.dictionary),this.err===de.Z_OK?this.err=Df.inflate(this.strm,this.flush):this.err===de.Z_DATA_ERROR&&(this.err=de.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===de.GUNZIP&&this.err===de.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=Df.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}};mi.prototype._checkError=function(){switch(this.err){case de.Z_OK:case de.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===de.Z_FINISH)return this._error("unexpected end of file"),!1;break;case de.Z_STREAM_END:break;case de.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0};mi.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}};mi.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()};mi.prototype.init=function(e,t,r,i,n){Yi(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),Yi(e>=8&&e<=15,"invalid windowBits"),Yi(t>=-1&&t<=9,"invalid compression level"),Yi(r>=1&&r<=9,"invalid memlevel"),Yi(i===de.Z_FILTERED||i===de.Z_HUFFMAN_ONLY||i===de.Z_RLE||i===de.Z_FIXED||i===de.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,r,i,n),this._setDictionary()};mi.prototype.params=function(){throw new Error("deflateParams Not supported")};mi.prototype.reset=function(){this._reset(),this._setDictionary()};mi.prototype._init=function(e,t,r,i,n){switch(this.level=e,this.windowBits=t,this.memLevel=r,this.strategy=i,this.flush=de.Z_NO_FLUSH,this.err=de.Z_OK,(this.mode===de.GZIP||this.mode===de.GUNZIP)&&(this.windowBits+=16),this.mode===de.UNZIP&&(this.windowBits+=32),(this.mode===de.DEFLATERAW||this.mode===de.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new vse,this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=G1.deflateInit2(this.strm,this.level,de.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:case de.UNZIP:this.err=Df.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==de.Z_OK&&this._error("Init error"),this.dictionary=n,this.write_in_progress=!1,this.init_done=!0};mi.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:this.err=G1.deflateSetDictionary(this.strm,this.dictionary);break;default:break}this.err!==de.Z_OK&&this._error("Failed to set dictionary")}};mi.prototype._reset=function(){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:case de.GZIP:this.err=G1.deflateReset(this.strm);break;case de.INFLATE:case de.INFLATERAW:case de.GUNZIP:this.err=Df.inflateReset(this.strm);break;default:break}this.err!==de.Z_OK&&this._error("Failed to reset stream")};de.Zlib=mi});var z7=k(we=>{"use strict";v();var ra=Kt().Buffer,lq=t2().Transform,De=sq(),Ws=rn(),Z1=Es().ok,j7=Kt().kMaxLength,hq="Cannot create final Buffer. It would be larger than 0x"+j7.toString(16)+" bytes";De.Z_MIN_WINDOWBITS=8;De.Z_MAX_WINDOWBITS=15;De.Z_DEFAULT_WINDOWBITS=15;De.Z_MIN_CHUNK=64;De.Z_MAX_CHUNK=1/0;De.Z_DEFAULT_CHUNK=16*1024;De.Z_MIN_MEMLEVEL=1;De.Z_MAX_MEMLEVEL=9;De.Z_DEFAULT_MEMLEVEL=8;De.Z_MIN_LEVEL=-1;De.Z_MAX_LEVEL=9;De.Z_DEFAULT_LEVEL=De.Z_DEFAULT_COMPRESSION;var uq=Object.keys(De);for(x5=0;x5<uq.length;x5++)E5=uq[x5],E5.match(/^Z/)&&Object.defineProperty(we,E5,{enumerable:!0,value:De[E5],writable:!1});var E5,x5,I5={Z_OK:De.Z_OK,Z_STREAM_END:De.Z_STREAM_END,Z_NEED_DICT:De.Z_NEED_DICT,Z_ERRNO:De.Z_ERRNO,Z_STREAM_ERROR:De.Z_STREAM_ERROR,Z_DATA_ERROR:De.Z_DATA_ERROR,Z_MEM_ERROR:De.Z_MEM_ERROR,Z_BUF_ERROR:De.Z_BUF_ERROR,Z_VERSION_ERROR:De.Z_VERSION_ERROR},fq=Object.keys(I5);for(O5=0;O5<fq.length;O5++)H7=fq[O5],I5[I5[H7]]=H7;var H7,O5;Object.defineProperty(we,"codes",{enumerable:!0,value:Object.freeze(I5),writable:!1});we.Deflate=Lf;we.Inflate=qf;we.Gzip=Uf;we.Gunzip=Ff;we.DeflateRaw=Hf;we.InflateRaw=jf;we.Unzip=zf;we.createDeflate=function(e){return new Lf(e)};we.createInflate=function(e){return new qf(e)};we.createDeflateRaw=function(e){return new Hf(e)};we.createInflateRaw=function(e){return new jf(e)};we.createGzip=function(e){return new Uf(e)};we.createGunzip=function(e){return new Ff(e)};we.createUnzip=function(e){return new zf(e)};we.deflate=function(e,t,r){return typeof t=="function"&&(r=t,t={}),Kf(new Lf(t),e,r)};we.deflateSync=function(e,t){return Vf(new Lf(t),e)};we.gzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),Kf(new Uf(t),e,r)};we.gzipSync=function(e,t){return Vf(new Uf(t),e)};we.deflateRaw=function(e,t,r){return typeof t=="function"&&(r=t,t={}),Kf(new Hf(t),e,r)};we.deflateRawSync=function(e,t){return Vf(new Hf(t),e)};we.unzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),Kf(new zf(t),e,r)};we.unzipSync=function(e,t){return Vf(new zf(t),e)};we.inflate=function(e,t,r){return typeof t=="function"&&(r=t,t={}),Kf(new qf(t),e,r)};we.inflateSync=function(e,t){return Vf(new qf(t),e)};we.gunzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),Kf(new Ff(t),e,r)};we.gunzipSync=function(e,t){return Vf(new Ff(t),e)};we.inflateRaw=function(e,t,r){return typeof t=="function"&&(r=t,t={}),Kf(new jf(t),e,r)};we.inflateRawSync=function(e,t){return Vf(new jf(t),e)};function Kf(e,t,r){var i=[],n=0;e.on("error",a),e.on("end",s),e.end(t),o();function o(){for(var u;(u=e.read())!==null;)i.push(u),n+=u.length;e.once("readable",o)}function a(u){e.removeListener("end",s),e.removeListener("readable",o),r(u)}function s(){var u,c=null;n>=j7?c=new RangeError(hq):u=ra.concat(i,n),i=[],e.close(),r(c,u)}}function Vf(e,t){if(typeof t=="string"&&(t=ra.from(t)),!ra.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function Lf(e){if(!(this instanceof Lf))return new Lf(e);dr.call(this,e,De.DEFLATE)}function qf(e){if(!(this instanceof qf))return new qf(e);dr.call(this,e,De.INFLATE)}function Uf(e){if(!(this instanceof Uf))return new Uf(e);dr.call(this,e,De.GZIP)}function Ff(e){if(!(this instanceof Ff))return new Ff(e);dr.call(this,e,De.GUNZIP)}function Hf(e){if(!(this instanceof Hf))return new Hf(e);dr.call(this,e,De.DEFLATERAW)}function jf(e){if(!(this instanceof jf))return new jf(e);dr.call(this,e,De.INFLATERAW)}function zf(e){if(!(this instanceof zf))return new zf(e);dr.call(this,e,De.UNZIP)}function cq(e){return e===De.Z_NO_FLUSH||e===De.Z_PARTIAL_FLUSH||e===De.Z_SYNC_FLUSH||e===De.Z_FULL_FLUSH||e===De.Z_FINISH||e===De.Z_BLOCK}function dr(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||we.Z_DEFAULT_CHUNK,lq.call(this,e),e.flush&&!cq(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!cq(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||De.Z_NO_FLUSH,this._finishFlushFlag=typeof e.finishFlush<"u"?e.finishFlush:De.Z_FINISH,e.chunkSize&&(e.chunkSize<we.Z_MIN_CHUNK||e.chunkSize>we.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<we.Z_MIN_WINDOWBITS||e.windowBits>we.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<we.Z_MIN_LEVEL||e.level>we.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<we.Z_MIN_MEMLEVEL||e.memLevel>we.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=we.Z_FILTERED&&e.strategy!=we.Z_HUFFMAN_ONLY&&e.strategy!=we.Z_RLE&&e.strategy!=we.Z_FIXED&&e.strategy!=we.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!ra.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new De.Zlib(t);var i=this;this._hadError=!1,this._handle.onerror=function(a,s){A5(i),i._hadError=!0;var u=new Error(a);u.errno=s,u.code=we.codes[s],i.emit("error",u)};var n=we.Z_DEFAULT_COMPRESSION;typeof e.level=="number"&&(n=e.level);var o=we.Z_DEFAULT_STRATEGY;typeof e.strategy=="number"&&(o=e.strategy),this._handle.init(e.windowBits||we.Z_DEFAULT_WINDOWBITS,n,e.memLevel||we.Z_DEFAULT_MEMLEVEL,o,e.dictionary),this._buffer=ra.allocUnsafe(this._chunkSize),this._offset=0,this._level=n,this._strategy=o,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}Ws.inherits(dr,lq);dr.prototype.params=function(e,t,r){if(e<we.Z_MIN_LEVEL||e>we.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=we.Z_FILTERED&&t!=we.Z_HUFFMAN_ONLY&&t!=we.Z_RLE&&t!=we.Z_FIXED&&t!=we.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(De.Z_SYNC_FLUSH,function(){Z1(i._handle,"zlib binding closed"),i._handle.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else A.default.nextTick(r)};dr.prototype.reset=function(){return Z1(this._handle,"zlib binding closed"),this._handle.reset()};dr.prototype._flush=function(e){this._transform(ra.alloc(0),"",e)};dr.prototype.flush=function(e,t){var r=this,i=this._writableState;(typeof e=="function"||e===void 0&&!t)&&(t=e,e=De.Z_FULL_FLUSH),i.ended?t&&A.default.nextTick(t):i.ending?t&&this.once("end",t):i.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(ra.alloc(0),"",t))};dr.prototype.close=function(e){A5(this,e),A.default.nextTick(bse,this)};function A5(e,t){t&&A.default.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function bse(e){e.emit("close")}dr.prototype._transform=function(e,t,r){var i,n=this._writableState,o=n.ending||n.ended,a=o&&(!e||n.length===e.length);if(e!==null&&!ra.isBuffer(e))return r(new Error("invalid input"));if(!this._handle)return r(new Error("zlib binding closed"));a?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||De.Z_NO_FLUSH)),this._processChunk(e,i,r)};dr.prototype._processChunk=function(e,t,r){var i=e&&e.length,n=this._chunkSize-this._offset,o=0,a=this,s=typeof r=="function";if(!s){var u=[],c=0,l;this.on("error",function(M){l=M}),Z1(this._handle,"zlib binding closed");do var m=this._handle.writeSync(t,e,o,i,this._buffer,this._offset,n);while(!this._hadError&&P(m[0],m[1]));if(this._hadError)throw l;if(c>=j7)throw A5(this),new RangeError(hq);var w=ra.concat(u,c);return A5(this),w}Z1(this._handle,"zlib binding closed");var E=this._handle.write(t,e,o,i,this._buffer,this._offset,n);E.buffer=e,E.callback=P;function P(M,D){if(this&&(this.buffer=null,this.callback=null),!a._hadError){var L=n-D;if(Z1(L>=0,"have should not go down"),L>0){var U=a._buffer.slice(a._offset,a._offset+L);a._offset+=L,s?a.push(U):(u.push(U),c+=U.length)}if((D===0||a._offset>=a._chunkSize)&&(n=a._chunkSize,a._offset=0,a._buffer=ra.allocUnsafe(a._chunkSize)),D===0){if(o+=i-M,i=M,!s)return!0;var K=a._handle.write(t,e,o,i,a._buffer,a._offset,a._chunkSize);K.callback=P,K.buffer=e;return}if(!s)return!1;r()}}};Ws.inherits(Lf,dr);Ws.inherits(qf,dr);Ws.inherits(Uf,dr);Ws.inherits(Ff,dr);Ws.inherits(Hf,dr);Ws.inherits(jf,dr);Ws.inherits(zf,dr)});var mq=k((Sme,vq)=>{"use strict";v();var K7=p7(),wme=_r(),dq=z7(),_se=8*1024*1024;function pq(e,t){var r=t&&t.maxDecompressedBytes||_se;return dq.gunzipSync(h.Buffer.from(e,"base64"),{maxOutputLength:r})}async function gq(e,t){if(!t.expectedIssuerDid)throw new Error("expectedIssuerDid is required to verify a status list (issuer pinning); refusing to read revocation state from an unpinned/unverified JWT");var r=t.didResolver;if(!r){var i=t.issuerJwks||(t.issuerPublicJwk?{keys:[t.issuerPublicJwk]}:null);if(!i)throw new Error("Provide params.didResolver, params.issuerJwks, or params.issuerPublicJwk to verify the status list signature");r=async function(){return{jwks:i}}}var n=await K7.verifyVcJwt(e,{didResolver:r,expectedIssuerDid:t.expectedIssuerDid,allowedAlgs:t.allowedAlgs,allowLegacyDER:t.allowLegacyDER,clockToleranceSec:t.clockToleranceSec});if(!n.valid)throw new Error("Status list signature verification failed: "+(n.error||"invalid signature"));return n.payload}async function wse(e){if(!e.issuerDid||!e.privateJwk)throw new Error("issuerDid and privateJwk are required");var t=e.listId||e.issuerDid+"/status/"+Date.now(),r=e.listSize||1e5,i=Math.ceil(r/8),n=h.Buffer.alloc(i,0),o=z7(),a=o.gzipSync(n),s=a.toString("base64"),u={"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/vc/status-list/2021/v1"],type:["VerifiableCredential","StatusList2021Credential"],issuer:e.issuerDid,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,type:"StatusList2021",statusPurpose:"revocation",encodedList:s}},c=await K7.issueVcJwt({issuerDid:e.issuerDid,subjectId:t,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:u.credentialSubject,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"});return{listVcJwt:c.jwt,listId:t}}async function Sse(e){if(!e.listVcJwt||e.index===void 0||!e.status||!e.privateJwk)throw new Error("listVcJwt, index, status, and privateJwk are required");var t=await gq(e.listVcJwt,e),r=t.vc.credentialSubject.encodedList,i=pq(r,e),n=Math.floor(e.index/8),o=e.index%8;if(n>=i.length)throw new Error("Index out of range");var a=e.status==="revoked"||e.status==="suspended"?1:0;a===1?i[n]|=1<<o:i[n]&=~(1<<o);var s=dq.gzipSync(i),u=s.toString("base64"),c={id:t.vc.credentialSubject.id,type:"StatusList2021",statusPurpose:"revocation",encodedList:u},l=await K7.issueVcJwt({issuerDid:t.iss,subjectId:t.vc.credentialSubject.id,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:c,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"});return{listVcJwt:l.jwt}}async function xse(e){if(!e.listVcJwt||e.index===void 0)throw new Error("listVcJwt and index are required");var t=await gq(e.listVcJwt,e),r=t.vc.credentialSubject.encodedList,i=pq(r,e),n=Math.floor(e.index/8),o=e.index%8;if(n>=i.length)throw new Error("Index out of range");var a=i[n]>>o&1;return a===1?"revoked":"valid"}vq.exports={createStatusList:wse,updateStatusList:Sse,getCredentialStatusEntry:xse}});var _q=k((Eme,bq)=>{"use strict";v();var Ese=_r();function yq(e){var t;if(typeof e=="string")t=h.Buffer.from(e,"utf8");else if(h.Buffer.isBuffer(e))t=e;else if(e instanceof Uint8Array)t=h.Buffer.from(e);else throw new Error("Data must be string, Buffer, or Uint8Array");return Ese.createHash("sha256").update(t).digest("hex")}function Ose(e){if(!e.kind||!e.hash||!e.issuerDid)throw new Error("kind, hash, and issuerDid are required");var t=["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"];if(t.indexOf(e.kind)===-1)throw new Error("Invalid kind. Must be one of: "+t.join(", "));if(!/^[a-fA-F0-9]{64}$/.test(e.hash))throw new Error("Invalid hash format. Must be 64 hex characters");var r={protocol:"SmartLedger",version:"1.0",type:e.kind,hash:e.hash,issuer:e.issuerDid,timestamp:e.issuedAt||new Date().toISOString()};return{json:JSON.stringify(r)}}function Ise(e,t){var r=yq(e);return r===t}function Ase(e){try{var t=JSON.parse(e);if(t.protocol!=="SmartLedger")return{valid:!1,error:"Invalid protocol"};var r=["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"];return r.indexOf(t.type)===-1?{valid:!1,error:"Invalid anchor type"}:/^[a-fA-F0-9]{64}$/.test(t.hash)?{valid:!0,protocol:t.protocol,version:t.version,type:t.type,hash:t.hash,issuer:t.issuer,timestamp:t.timestamp}:{valid:!1,error:"Invalid hash format"}}catch(i){return{valid:!1,error:"Failed to parse anchor payload: "+i.message}}}bq.exports={sha256Hex:yq,buildAnchorPayload:Ose,verifyAnchorHash:Ise,parseAnchorPayload:Ase}});var W1=k((Ime,Sq)=>{"use strict";v();var wq=ds();function Pse(){var e=wq.getRandomBuffer(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;var t=e.toString("hex");return[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20,32)].join("-")}function Tse(e){return wq.getRandomBuffer(Math.ceil(e/2)).toString("hex").substring(0,e)}Sq.exports={uuid4:Pse,randomHex:Tse}});var Aq=k((Tme,Iq)=>{"use strict";v();var ia=Te(),V7=ia.crypto.Hash,G7=ia.crypto.ECDSA,xq=ia.crypto.Signature,Z7=ia.PrivateKey,kr=ia.util.preconditions,Pme=xt(),kse=W1();function Eq(e,t){if(t=t||{},t.issuerPublicKey)return t.issuerPublicKey instanceof ia.PublicKey?t.issuerPublicKey:ia.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if(typeof r!="string")return null;try{var i=r.split("#")[0].split(":")[2];return i?ia.PublicKey.fromString(i):null}catch{return null}}var Gl={PROPERTY_TITLE:"PropertyTitle",VEHICLE_TITLE:"VehicleTitle",INTELLECTUAL_PROPERTY:"IntellectualProperty",MUSIC_LICENSE:"MusicLicense",SOFTWARE_LICENSE:"SoftwareLicense",FINANCIAL_INSTRUMENT:"FinancialInstrument",PROMISSORY_NOTE:"PromissoryNote",BOND:"Bond",EQUITY_SHARE:"EquityShare",PROFESSIONAL_LICENSE:"ProfessionalLicense",REGULATORY_PERMIT:"RegulatoryPermit",ACCESS_RIGHT:"AccessRight",VOTING_RIGHT:"VotingRight",ROYALTY_RIGHT:"RoyaltyRight",USAGE_RIGHT:"UsageRight"},Oq={create:function(e,t,r,i,n,o){o=o||{},kr.checkArgument(typeof e=="string","Right type must be string"),kr.checkArgument(typeof t=="string","Issuer DID must be string"),kr.checkArgument(typeof r=="string","Subject DID must be string"),kr.checkArgument(i&&typeof i=="object","Claim must be object");var a=Object.values(Gl);kr.checkArgument(a.includes(e),"Invalid right type: "+e);var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightToken",e],issuer:t,issuanceDate:new Date().toISOString(),credentialSubject:{id:r,rightType:e,claim:i,jurisdiction:o.jurisdiction||"US",purpose:o.purpose||"legal_right",validFrom:o.validFrom||new Date().toISOString(),validUntil:o.validUntil||null,transferable:o.transferable!==!1,revocable:o.revocable!==!1}};return o.metadata&&(s.credentialSubject.metadata=o.metadata),s},prepareRightToken:function(e,t,r,i,n,o){o=o||{},kr.checkArgument(typeof e=="string","Right type must be string"),kr.checkArgument(typeof t=="string","Issuer DID must be string"),kr.checkArgument(typeof r=="string","Subject DID must be string"),kr.checkArgument(i&&typeof i=="object","Claim must be object"),kr.checkArgument(n instanceof Z7,"Invalid issuer private key");var a=Object.values(Gl);kr.checkArgument(a.includes(e),"Invalid right type: "+e);try{var s=this.create(e,t,r,i,n,o),u=this._signToken(s,n);return{success:!0,rightToken:u,tokenHash:u.tokenHash,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction},externalOperations:{storeToken:{endpoint:"POST /rights/tokens",data:{token:u,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction}}},indexToken:{endpoint:"POST /rights/index",data:{tokenId:u.id,tokenHash:u.tokenHash,type:e,issuer:t,subject:r,issuedAt:u.issuanceDate}},notifyParties:{endpoint:"POST /notifications/right-issued",data:{tokenId:u.id,issuer:t,subject:r,rightType:e}}}}}catch(c){return{success:!1,error:c.message}}},prepareRightTokenVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateRightType(e,r),t.requireJurisdiction&&this._validateJurisdiction(e,t.allowedJurisdictions,r);var n={valid:r.length===0,errors:r,warnings:i,issuerDID:e.issuer,subjectDID:e.credentialSubject?e.credentialSubject.id:null,rightType:e.credentialSubject?e.credentialSubject.rightType:null,transferable:e.credentialSubject?e.credentialSubject.transferable:null,revocable:e.credentialSubject?e.credentialSubject.revocable:null,verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /rights/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/right-verification",data:{tokenId:e.id,rightType:n.rightType,issuer:n.issuerDID,subject:n.subjectDID,result:n.valid,verifiedAt:n.verifiedAt}},updateTokenStatus:n.valid?{endpoint:"PUT /rights/tokens/"+e.id+"/status",data:{status:"VERIFIED",verifiedAt:n.verifiedAt}}:null}}}catch(o){return{success:!1,error:"Verification preparation failed: "+o.message}}},prepareRightTokenTransfer:function(e,t,r,i){i=i||{},kr.checkArgument(e&&typeof e=="object","Invalid token"),kr.checkArgument(typeof t=="string","New owner DID must be string"),kr.checkArgument(r instanceof Z7,"Invalid current owner key");try{var n=this.prepareRightTokenVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot transfer invalid token: "+n.verification.errors.join(", ")};if(!e.credentialSubject.transferable)return{success:!1,error:"Token is not transferable"};var o=e.credentialSubject&&e.credentialSubject.id,a=Eq({issuer:o},{issuerPublicKey:i.currentOwnerPublicKey});if(!a)return{success:!1,error:"Cannot resolve current owner public key from token.credentialSubject.id; pass options.currentOwnerPublicKey"};if(r.toPublicKey().toString()!==a.toString())return{success:!1,error:"Unauthorized transfer: signing key does not match the current owner"};var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightTransfer"],issuer:e.credentialSubject.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,originalToken:e.id,transferFrom:e.credentialSubject.id,transferTo:t,transferDate:new Date().toISOString(),transferReason:i.reason||"ownership_transfer",consideration:i.consideration||null}},u=this._signToken(s,r),c=JSON.parse(JSON.stringify(e));c.id="urn:uuid:"+this._generateUUID(),c.issuanceDate=new Date().toISOString(),c.credentialSubject.id=t,c.credentialSubject.transferHistory=c.credentialSubject.transferHistory||[],c.credentialSubject.transferHistory.push({transferId:u.id,transferDate:u.issuanceDate,from:e.credentialSubject.id,to:t}),delete c.proof;var l=this._signToken(c,r);return{success:!0,newToken:l,transferProof:u,transferId:u.id,externalOperations:{recordTransfer:{endpoint:"POST /rights/transfers",data:{originalTokenId:e.id,newTokenId:l.id,transferProof:u,fromOwner:e.credentialSubject.id,toOwner:t,transferDate:u.issuanceDate}},updateOwnership:{endpoint:"PUT /rights/tokens/"+e.id+"/ownership",data:{newOwner:t,transferId:u.id,transferDate:u.issuanceDate,previousOwner:e.credentialSubject.id}},notifyParties:{endpoint:"POST /notifications/right-transferred",data:{originalTokenId:e.id,newTokenId:l.id,fromOwner:e.credentialSubject.id,toOwner:t,rightType:e.credentialSubject.rightType}},auditTransfer:{endpoint:"POST /audit/right-transfer",data:{originalTokenId:e.id,newTokenId:l.id,transferId:u.id,fromOwner:e.credentialSubject.id,toOwner:t,transferredAt:u.issuanceDate}}}}}catch(m){return{success:!1,error:m.message}}},prepareObligationToken:function(e,t,r,i){kr.checkArgument(e&&typeof e=="object","Invalid right token"),kr.checkArgument(typeof t=="string","Obligor DID must be string"),kr.checkArgument(r&&typeof r=="object","Obligation must be object"),kr.checkArgument(i instanceof Z7,"Invalid issuer key");try{var n={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken"],issuer:e.issuer,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,obligationType:"correlative_obligation",correlativeRight:e.id,rightHolder:e.credentialSubject.id,obligation:r,jurisdiction:e.credentialSubject.jurisdiction,purpose:e.credentialSubject.purpose}},o=this._signToken(n,i);return{success:!0,obligationToken:o,correlativeRight:e.id,externalOperations:{storeObligation:{endpoint:"POST /obligations/tokens",data:{obligationToken:o,correlativeRightId:e.id,obligor:t,rightHolder:e.credentialSubject.id}},linkToRight:{endpoint:"POST /rights/tokens/"+e.id+"/obligations",data:{obligationId:o.id,obligor:t,obligationType:"correlative_obligation"}},notifyObligor:{endpoint:"POST /notifications/obligation-created",data:{obligationId:o.id,obligor:t,rightHolder:e.credentialSubject.id,correlativeRight:e.id}}}}}catch(a){return{success:!1,error:a.message}}},prepareRightTypeValidation:function(e){kr.checkArgument(typeof e=="string","Right type must be string");var t=Object.values(Gl),r=t.includes(e);return{success:!0,validation:{type:e,valid:r,availableTypes:t,category:this._categorizeRightType(e),description:this._getRightTypeDescription(e)},externalOperations:{validateType:{endpoint:"POST /rights/validate-type",data:{type:e,valid:r}}}}},_categorizeRightType:function(e){var t={PropertyTitle:"PROPERTY_RIGHT",VehicleTitle:"PROPERTY_RIGHT",IntellectualProperty:"IP_RIGHT",MusicLicense:"IP_RIGHT",SoftwareLicense:"IP_RIGHT",FinancialInstrument:"FINANCIAL_RIGHT",PromissoryNote:"FINANCIAL_RIGHT",Bond:"FINANCIAL_RIGHT",EquityShare:"FINANCIAL_RIGHT",ProfessionalLicense:"LICENSE_RIGHT",RegulatoryPermit:"LICENSE_RIGHT",AccessRight:"ACCESS_RIGHT",VotingRight:"GOVERNANCE_RIGHT",RoyaltyRight:"IP_RIGHT",UsageRight:"ACCESS_RIGHT"};return t[e]||"UNKNOWN"},_getRightTypeDescription:function(e){var t={PropertyTitle:"Legal ownership of real estate property",VehicleTitle:"Legal ownership of motor vehicle",IntellectualProperty:"Rights to intellectual property assets",MusicLicense:"License for music performance and usage",SoftwareLicense:"License for software usage and distribution",FinancialInstrument:"Rights related to financial instruments",PromissoryNote:"Promise to pay a specified amount",Bond:"Debt security representing loan",EquityShare:"Ownership stake in company",ProfessionalLicense:"License for professional practice",RegulatoryPermit:"Permit for regulated activities",AccessRight:"Right to access resources or locations",VotingRight:"Right to participate in governance",RoyaltyRight:"Right to receive royalty payments",UsageRight:"Right to use specific assets or services"};return t[e]||"Unknown right type"},getRightTypes:function(){return Gl},verifyToken:function(e,t){var r=[];try{if(kr.checkArgument(e&&typeof e=="object","Invalid token"),!e.proof||!e.proof.jws)return r.push("Missing signature proof"),{valid:!1,errors:r};var i=t instanceof ia.PublicKey?t:ia.PublicKey.fromString(t),n=this._canonicalizeToken(e),o=V7.sha256(h.Buffer.from(n));if(e.tokenHash&&e.tokenHash!==o.toString("hex"))return r.push("Token hash mismatch"),{valid:!1,errors:r};var a=e.proof.jws.split(".");if(a.length!==3||!a[2])return r.push("Malformed JWS"),{valid:!1,errors:r};var s=xq.fromDER(h.Buffer.from(a[2],"base64url")),u=new G7;return u.hashbuf=o,u.sig=s,u.pubkey=i,u.verify()||r.push("Signature verification failed"),{valid:r.length===0,errors:r,tokenHash:o.toString("hex"),verifiedAt:new Date().toISOString()}}catch(c){return r.push(c.message),{valid:!1,errors:r}}},_signToken:function(e,t){var r=this._canonicalizeToken(e),i=V7.sha256(h.Buffer.from(r)),n=new G7;n.hashbuf=i,n.privkey=t,n.pubkey=t.toPublicKey(),n.sign();var o=n.sig,a={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(i,o)},s=JSON.parse(JSON.stringify(e));return s.proof=a,s.tokenHash=i.toString("hex"),s},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=t.toDER().toString("base64url");return i+".."+n},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),(!e.type||!Array.isArray(e.type))&&t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws){t.push("Missing signature proof");return}var i=this._canonicalizeToken(e),n=V7.sha256(h.Buffer.from(i));if(e.tokenHash&&e.tokenHash!==n.toString("hex")){t.push("Token hash mismatch");return}var o=Eq(e,r);if(!o){t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");return}var a=e.proof.jws.split(".");if(a.length!==3||!a[2]){t.push("Malformed JWS");return}var s=xq.fromDER(h.Buffer.from(a[2],"base64url")),u=new G7;u.hashbuf=n,u.sig=s,u.pubkey=o,u.verify()!==!0&&t.push("Signature verification failed")}catch(c){t.push("Signature verification failed: "+c.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date,n=new Date(e.issuanceDate);if(n>i&&t.push("Token issued in the future"),e.credentialSubject.validFrom){var o=new Date(e.credentialSubject.validFrom);i<o&&r.push("Token not yet valid")}if(e.credentialSubject.validUntil){var a=new Date(e.credentialSubject.validUntil);i>a&&t.push("Token expired")}},_validateRightType:function(e,t){if(!e.credentialSubject.rightType){t.push("Missing rightType");return}var r=Object.values(Gl);r.includes(e.credentialSubject.rightType)||t.push("Invalid right type: "+e.credentialSubject.rightType)},_validateJurisdiction:function(e,t,r){if(!e.credentialSubject.jurisdiction){r.push("Missing jurisdiction");return}t&&Array.isArray(t)&&(t.includes(e.credentialSubject.jurisdiction)||r.push("Jurisdiction not allowed: "+e.credentialSubject.jurisdiction))},_generateUUID:function(){return kse.uuid4()}};Oq.RightTypes=Gl;Iq.exports=Oq});var kq=k((Rme,Tq)=>{"use strict";v();var Pq=Te(),Y1=Pq.crypto.Hash,$i=Pq.util.preconditions,Rse=W1(),Gf={PropertyTitle:{title:"Property Title",description:"Real estate property ownership title",type:"object",required:["propertyId","address","ownershipType"],properties:{propertyId:{type:"string",description:"Unique property identifier"},address:{type:"object",required:["street","city","state","country"],properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"string"},postalCode:{type:"string"}}},ownershipType:{type:"string",enum:["fee_simple","leasehold","joint_tenancy","tenancy_in_common"]},titleNumber:{type:"string"},registeredDate:{type:"string",format:"date-time"},legalDescription:{type:"string"},encumbrances:{type:"array",items:{type:"object",properties:{type:{type:"string"},amount:{type:"number"},description:{type:"string"}}}}}},VehicleTitle:{title:"Vehicle Title",description:"Motor vehicle ownership title",type:"object",required:["vin","make","model","year"],properties:{vin:{type:"string",pattern:"^[A-HJ-NPR-Z0-9]{17}$",description:"Vehicle Identification Number"},make:{type:"string"},model:{type:"string"},year:{type:"integer",minimum:1900,maximum:2030},titleNumber:{type:"string"},registeredState:{type:"string"},mileage:{type:"integer",minimum:0},color:{type:"string"},fuelType:{type:"string",enum:["gasoline","diesel","electric","hybrid","other"]},liens:{type:"array",items:{type:"object",properties:{lienholderName:{type:"string"},lienAmount:{type:"number"},lienDate:{type:"string",format:"date"}}}}}},PromissoryNote:{title:"Promissory Note",description:"Legal promise to pay a specified amount",type:"object",required:["principal","interestRate","maturityDate","borrower","lender"],properties:{principalAmount:{type:"number",minimum:0,description:"Principal amount in base currency units"},currency:{type:"string",default:"USD"},interestRate:{type:"number",minimum:0,maximum:100,description:"Annual interest rate percentage"},maturityDate:{type:"string",format:"date",description:"Date when principal and interest are due"},payee:{type:"string",description:"DID of the payee (creditor)"},payor:{type:"string",description:"DID of the payor (debtor)"},paymentSchedule:{type:"string",enum:["lump_sum","monthly","quarterly","annually"]},collateral:{type:"array",items:{type:"object",properties:{description:{type:"string"},value:{type:"number"},type:{type:"string"}}}},defaultProvisions:{type:"string"},governingLaw:{type:"string"}}},IntellectualProperty:{title:"Intellectual Property",description:"Intellectual property rights and licensing",type:"object",required:["ipType","title","registrationNumber"],properties:{ipType:{type:"string",enum:["patent","trademark","copyright","trade_secret"]},title:{type:"string"},creator:{type:"string",description:"Creator DID"},registrationNumber:{type:"string"},registrationDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},jurisdiction:{type:"string"},description:{type:"string"},claims:{type:"array",items:{type:"string"}},priorArt:{type:"array",items:{type:"object",properties:{reference:{type:"string"},date:{type:"string",format:"date"},relevance:{type:"string"}}}}}},ProfessionalLicense:{title:"Professional License",description:"Professional practice license or certification",type:"object",required:["licenseType","licenseNumber","issuingAuthority","expirationDate"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},licensee:{type:"string",description:"Licensee DID"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},renewalDate:{type:"string",format:"date"},jurisdiction:{type:"string"},scope:{type:"string"},restrictions:{type:"array",items:{type:"string"}},continuing_education:{type:"object",properties:{hours_required:{type:"integer"},deadline:{type:"string",format:"date"},completed_hours:{type:"integer"}}}}},MusicLicense:{title:"Music License",description:"Music performance and usage licensing",type:"object",required:["songTitle","artist","licenseType","royaltyRate"],properties:{workTitle:{type:"string"},composer:{type:"string",description:"Composer DID"},performer:{type:"string",description:"Performer DID"},licenseType:{type:"string",enum:["mechanical","performance","synchronization","master_use"]},territory:{type:"string"},duration:{type:"string"},royaltyRate:{type:"number",minimum:0,maximum:100},advancePayment:{type:"number",minimum:0},exclusivity:{type:"boolean"},mediaTypes:{type:"array",items:{type:"string",enum:["cd","vinyl","digital","streaming","broadcast","film","tv"]}},usage_restrictions:{type:"string"},copyrightNotice:{type:"string"}}}},Bse={prepareClaimValidation:function(e,t){try{$i.checkArgument(e&&typeof e=="object","Invalid claim"),$i.checkArgument(typeof t=="string","Schema name must be string");var r=Gf[t];if(!r)return{success:!1,error:"Unknown schema: "+t};var i=[],n=[];this._validateObject(e,r,"",i,n);var o={valid:i.length===0,errors:i,warnings:n,schema:t,claimHash:this.hash(e),canonical:this.canonicalize(e)};return{success:!0,validation:o,claim:e,schema:r,externalOperations:{store:{endpoint:"POST /claims/validate",data:{claim:e,validation:o,schema:t}},index:{endpoint:"POST /claims/index",data:{claimHash:o.claimHash,schemaName:t,valid:o.valid}}}}}catch(a){return{success:!1,error:"Validation preparation failed: "+a.message}}},prepareClaimAttestation:function(e,t,r){try{$i.checkArgument(e&&typeof e=="object","Invalid claim"),$i.checkArgument(typeof t=="string","Schema name must be string"),$i.checkArgument(r&&typeof r=="object","Invalid attestor");var i=this.prepareClaimValidation(e,t);if(!i.success||!i.validation.valid)return{success:!1,error:"Cannot attest invalid claim",validation:i};var n={type:"LTP_CLAIM_ATTESTATION",claimHash:i.validation.claimHash,schemaName:t,attestor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},attestedAt:new Date().toISOString(),confidence:r.confidence||100,evidence:r.evidence||null,notes:r.notes||null},o=Y1.sha256(h.Buffer.from(this.canonicalize(n))).toString("hex");return n.attestationHash=o,{success:!0,attestation:n,claim:e,validation:i.validation,externalOperations:{storeAttestation:{endpoint:"POST /claims/"+i.validation.claimHash+"/attestations",data:n},notifyStakeholders:{endpoint:"POST /notifications/claim-attested",data:{claimHash:i.validation.claimHash,attestorDid:n.attestor.did,attestationHash:o}}}}}catch(a){return{success:!1,error:"Attestation preparation failed: "+a.message}}},prepareClaimDispute:function(e,t,r){try{$i.checkArgument(typeof e=="string","Claim hash must be string"),$i.checkArgument(t&&typeof t=="object","Invalid disputant"),$i.checkArgument(r&&typeof r=="object","Invalid dispute");var i={type:"LTP_CLAIM_DISPUTE",claimHash:e,disputant:{did:t.did||t.id,name:t.name||"Unknown",jurisdiction:t.jurisdiction||null},dispute:{reason:r.reason||"UNSPECIFIED",category:r.category||"ACCURACY",description:r.description||"",evidence:r.evidence||null,requestedAction:r.requestedAction||"REVIEW"},disputedAt:new Date().toISOString(),status:"FILED",priority:r.priority||"NORMAL"},n=Y1.sha256(h.Buffer.from(this.canonicalize(i))).toString("hex");return i.disputeHash=n,{success:!0,dispute:i,disputeId:this._generateDisputeId(e),externalOperations:{fileDispute:{endpoint:"POST /claims/"+e+"/disputes",data:i},notifyStakeholders:{endpoint:"POST /notifications/claim-disputed",data:{claimHash:e,disputantDid:i.disputant.did,disputeHash:n}},escalate:{endpoint:"POST /disputes/escalate",data:{disputeHash:n,priority:i.priority}}}}}catch(o){return{success:!1,error:"Dispute preparation failed: "+o.message}}},prepareBulkClaimValidation:function(e,t){try{$i.checkArgument(Array.isArray(e),"Claims must be array"),$i.checkArgument(typeof t=="string","Schema name must be string");var r=[],i=[],n=0;e.forEach(function(s,u){try{var c=this.prepareClaimValidation(s,t);c.success&&c.validation.valid&&n++,r.push({index:u,result:c})}catch(l){i.push({index:u,error:l.message})}}.bind(this));var o=this._generateBatchId(),a=Y1.sha256(h.Buffer.from(JSON.stringify(r.map(s=>s.result.validation.claimHash)))).toString("hex");return{success:!0,batchId:o,batchHash:a,totalClaims:e.length,validClaims:n,invalidClaims:e.length-n,validations:r,errors:i,externalOperations:{storeBatch:{endpoint:"POST /claims/batch-validate",data:{batchId:o,batchHash:a,schemaName:t,validations:r}},generateReport:{endpoint:"POST /reports/bulk-validation",data:{batchId:o,summary:{total:e.length,valid:n,invalid:e.length-n}}}}}}catch(s){return{success:!1,error:"Bulk validation preparation failed: "+s.message}}},canonicalize:function(e){$i.checkArgument(e&&typeof e=="object","Invalid claim");var t=this._sortObjectKeys(e);return JSON.stringify(t)},hash:function(e){var t=this.canonicalize(e);return Y1.sha256(h.Buffer.from(t)).toString("hex")},prepareClaimTemplate:function(e,t){t=t||{};try{var r=Gf[e];if(!r)return{success:!1,error:"Unknown schema: "+e};var i=this._createTemplateFromSchema(r),n=this._generateFormStructure(r);return{success:!0,schemaName:e,template:i,schema:r,formStructure:n,validation:{required:r.required||[],patterns:this._extractPatterns(r),enums:this._extractEnums(r)},externalOperations:{generateForm:{endpoint:"POST /forms/generate",data:{schemaName:e,formStructure:n,template:i}},saveTemplate:{endpoint:"POST /templates/claim",data:{schemaName:e,template:i,customizations:t.customizations||{}}}}}}catch(o){return{success:!1,error:"Template preparation failed: "+o.message}}},getSchemas:function(){return Gf},getSchemaNames:function(){return Object.keys(Gf)},getSchema:function(e){return Gf[e]||null},addSchema:function(e,t){$i.checkArgument(typeof e=="string","Schema name must be string"),$i.checkArgument(t&&typeof t=="object","Invalid schema"),Gf[e]=t},createTemplate:function(e){var t=Gf[e];if(!t)throw new Error("Unknown schema: "+e);return this._createTemplateFromSchema(t)},_generateDisputeId:function(e){var t="dispute_"+e+"_"+Date.now();return Y1.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_generateBatchId:function(){return Rse.randomHex(16)},_generateFormStructure:function(e){var t={type:"form",title:e.title||"Legal Claim Form",description:e.description||"",fields:[]};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r],n={name:r,label:this._humanizeFieldName(r),type:this._mapSchemaTypeToFormType(i),required:e.required&&e.required.includes(r),validation:this._extractFieldValidation(i)};i.enum&&(n.options=i.enum.map(function(o){return{value:o,label:this._humanizeValue(o)}}.bind(this))),t.fields.push(n)}.bind(this)),t},_extractPatterns:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.pattern&&(t[r]=i.pattern)}),t},_extractEnums:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.enum&&(t[r]=i.enum)}),t},_mapSchemaTypeToFormType:function(e){switch(e.type){case"string":return e.enum?"select":e.format==="date"?"date":e.format==="date-time"?"datetime":"text";case"number":case"integer":return"number";case"boolean":return"checkbox";case"array":return"list";case"object":return"fieldset";default:return"text"}},_extractFieldValidation:function(e){var t={};return e.pattern&&(t.pattern=e.pattern),e.minimum!==void 0&&(t.min=e.minimum),e.maximum!==void 0&&(t.max=e.maximum),e.format&&(t.format=e.format),t},_humanizeFieldName:function(e){return e.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).replace(/_/g," ")},_humanizeValue:function(e){return e.replace(/_/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()})},_validateObject:function(e,t,r,i,n){t.type==="object"?(t.required&&Array.isArray(t.required)&&t.required.forEach(function(o){e.hasOwnProperty(o)||i.push("Missing required field: "+this._getFieldPath(r,o))}.bind(this)),t.properties&&Object.keys(e).forEach(function(o){var a=this._getFieldPath(r,o),s=t.properties[o];s?this._validateValue(e[o],s,a,i,n):n.push("Unknown field: "+a)}.bind(this))):this._validateValue(e,t,r,i,n)},_validateValue:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type){i.push("Invalid type for "+r+": expected "+t.type+", got "+o);return}}if(t.type==="string"&&(t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e),t.format==="date"&&!this._isValidDate(e)&&i.push("Invalid date format for "+r),t.format==="date-time"&&!this._isValidDateTime(e)&&i.push("Invalid date-time format for "+r)),(t.type==="number"||t.type==="integer")&&(t.minimum!==void 0&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),t.maximum!==void 0&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum),t.type==="integer"&&!Number.isInteger(e)&&i.push("Value must be integer for "+r)),t.type==="array"&&t.items)for(var a=0;a<e.length;a++)this._validateValue(e[a],t.items,r+"["+a+"]",i,n);t.type==="object"&&this._validateObject(e,t,r,i,n)},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_createTemplateFromSchema:function(e){if(e.type==="object"){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t}return this._getDefaultValue(e)},_getDefaultValue:function(e){if(e.default!==void 0)return e.default;switch(e.type){case"string":return e.enum?e.enum[0]:e.format==="date"?"2023-01-01":e.format==="date-time"?new Date().toISOString():"PLACEHOLDER_STRING";case"number":case"integer":return e.minimum||0;case"boolean":return!1;case"array":return[];case"object":return this._createTemplateFromSchema(e);default:return null}},_getFieldPath:function(e,t){return e?e+"."+t:t},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())}};Tq.exports=Bse});var Mq=k((Mme,Bq)=>{"use strict";v();var Rq=Te(),$1=Rq.crypto.Hash,Zl=Rq.util.preconditions,Mse={prepareTokenCommitment:function(e,t){t=t||{},Zl.checkArgument(e&&typeof e=="object","Invalid token");try{var r=this._createCommitment(e,t),i=this._formatOpReturn(r,t),n=this._createTxTemplate(i,t);return{success:!0,commitment:r,opReturnData:i,txTemplate:n,preparedAt:new Date().toISOString(),metadata:{tokenId:e.id,purpose:t.purpose||"legal_token_anchor",version:"LTP.v1"}}}catch(o){return{success:!1,error:o.message}}},prepareBatchCommitment:function(e,t){t=t||{},Zl.checkArgument(Array.isArray(e),"Tokens must be array");try{var r=this._createBatchCommitment(e,t),i=this._formatOpReturn(r,t),n=this._createTxTemplate(i,t);return{success:!0,batchCommitment:r,opReturnData:i,txTemplate:n,tokenCount:e.length,preparedAt:new Date().toISOString(),metadata:{purpose:t.purpose||"legal_token_batch_anchor",version:"LTP.v1"}}}catch(o){return{success:!1,error:o.message}}},verifyTokenAnchor:function(e,t,r){Zl.checkArgument(e&&typeof e=="object","Invalid token"),Zl.checkArgument(typeof t=="string","Transaction ID must be string");try{var i=this._createCommitment(e,{}),n=this._extractOpReturn(r);if(!n)return{valid:!1,error:"No OP_RETURN data found in transaction"};var o=this._verifyCommitment(i,n);return{valid:o,chainVerified:!1,txid:t,commitment:i,anchorData:n,verifiedAt:new Date().toISOString()}}catch(a){return{valid:!1,error:a.message}}},formatRevocation:function(e,t){Zl.checkArgument(typeof e=="string","Token ID must be string"),Zl.checkArgument(t&&typeof t=="object","Invalid revocation data");try{var r={type:"LTP_REVOCATION",tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:new Date().toISOString(),effectiveDate:t.effectiveDate||new Date().toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null},i=$1.sha256(h.Buffer.from(JSON.stringify(r))).toString("hex");return{success:!0,revocation:r,revocationHash:i,opReturnData:this._formatOpReturn({hash:i,type:"REVOCATION"},{})}}catch(n){return{success:!1,error:n.message}}},_createCommitment:function(e,t){var r=this._canonicalizeToken(e),i={type:"LTP_TOKEN",tokenHash:$1.sha256(h.Buffer.from(r)).toString("hex"),tokenId:e.id,timestamp:new Date().toISOString(),purpose:t.purpose||"legal_token"},n=$1.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex");return{hash:n,data:i,canonical:r}},_createBatchCommitment:function(e,t){var r=[],i=[];e.forEach(function(s){var u=this._createCommitment(s,t);r.push(u.hash),i.push(s.id)}.bind(this));var n=this._createMerkleRoot(r),o={type:"LTP_BATCH",merkleRoot:n,tokenCount:e.length,tokenIds:i,timestamp:new Date().toISOString(),purpose:t.purpose||"batch_anchor"},a=$1.sha256(h.Buffer.from(JSON.stringify(o))).toString("hex");return{hash:a,data:o,merkleRoot:n,tokenHashes:r}},_formatOpReturn:function(e,t){var r=t.prefix||"LTP.v1",i=e.hash;return{prefix:r,data:i,full:r+"."+i,bytes:h.Buffer.from(r+"."+i,"utf8"),size:h.Buffer.from(r+"."+i,"utf8").length}},_createTxTemplate:function(e,t){try{var r={version:1,inputs:[],outputs:[{satoshis:0,script:"OP_RETURN "+e.data}],locktime:0};return t.feeOutput&&r.outputs.push(t.feeOutput),{template:r,opReturn:e,estimatedSize:this._estimateSize(r),instructions:{step1:"Add input UTXOs to cover fees",step2:"Add change output if needed",step3:"Sign transaction with appropriate keys",step4:"Broadcast to BSV network"}}}catch(i){throw new Error("Failed to create transaction template: "+i.message)}},_extractOpReturn:function(e){try{if(!e||!e.outputs)return null;for(var t=0;t<e.outputs.length;t++){var r=e.outputs[t];if(r.script&&r.script.startsWith("OP_RETURN")){var i=r.script.replace("OP_RETURN ","");return{raw:i,decoded:h.Buffer.from(i,"hex").toString("utf8")}}}return null}catch{return null}},_verifyCommitment:function(e,t){try{return!t||!t.decoded?!1:t.decoded.includes(e.hash)}catch{return!1}},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,delete t.anchorTx,delete t.anchorBlock,JSON.stringify(this._sortObjectKeys(t))},_createMerkleRoot:function(e){if(e.length===0)return null;if(e.length===1)return e[0];for(var t=e.slice();t.length>1;){for(var r=[],i=0;i<t.length;i+=2){var n=t[i],o=t[i+1]||n,a=h.Buffer.concat([h.Buffer.from(n,"hex"),h.Buffer.from(o,"hex")]),s=$1.sha256(a).toString("hex");r.push(s)}t=r}return t[0]},_estimateSize:function(e){var t=10,r=e.outputs.length*34,i=148;return{base:t+r,withOneInput:t+r+i,bytesPerInput:i}},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};Bq.exports=Mse});var Dq=k((Cme,Cq)=>{"use strict";v();var Wl=Te(),co=Wl.crypto.Hash,Nq=Wl.crypto.ECDSA,Nse=Wl.crypto.Signature,Cse=Wl.PrivateKey,Ii=Wl.util.preconditions,Dse={prepareSignatureProof:function(e,t,r){r=r||{},Ii.checkArgument(e&&typeof e=="object","Invalid token"),Ii.checkArgument(t instanceof Cse,"Invalid private key");try{var i=this._canonicalizeForSigning(e),n=co.sha256(h.Buffer.from(i)),o=new Nq;o.hashbuf=n,o.privkey=t,o.pubkey=t.toPublicKey(),o.sign();var a=o.sig,s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:r.purpose||"assertionMethod",jws:this._createJWS(n,a),proofValue:a.toDER().toString("hex")};return{success:!0,proof:s,tokenHash:n.toString("hex"),canonical:i,signingKey:{publicKey:t.toPublicKey().toString(),keyId:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1"},externalOperations:{storeProof:{endpoint:"POST /proofs/signature",data:{tokenHash:n.toString("hex"),proof:s,signingKey:t.toPublicKey().toString()}},verifyProof:{endpoint:"POST /proofs/verify-signature",data:{tokenHash:n.toString("hex"),signature:a.toDER().toString("hex"),publicKey:t.toPublicKey().toString()}}}}}catch(u){return{success:!1,error:u.message}}},prepareSignatureVerification:function(e,t){try{if(Ii.checkArgument(e&&typeof e=="object","Invalid token"),Ii.checkArgument(typeof t=="string","Public key must be string"),!e.proof)return{success:!1,error:"No proof found in token"};var r=this._canonicalizeForSigning(e),i=co.sha256(h.Buffer.from(r)),n=Nse.fromDER(h.Buffer.from(e.proof.proofValue,"hex")),o={tokenHash:i.toString("hex"),signature:n.toDER().toString("hex"),publicKey:t,proof:e.proof,canonical:r},a=new Nq;a.hashbuf=i,a.sig=n,a.pubkey=Wl.PublicKey.fromString(t);var s=a.verify()===!0;return{success:!0,verification:{valid:s,tokenHash:i.toString("hex"),signatureValid:s,publicKey:t,verifiedAt:new Date().toISOString()},verificationData:o,externalOperations:{recordVerification:{endpoint:"POST /proofs/verification-record",data:{tokenHash:i.toString("hex"),result:s,publicKey:t,verifiedAt:new Date().toISOString()}},auditVerification:{endpoint:"POST /audit/proof-verification",data:{tokenId:e.id,proofType:e.proof.type,result:s,verifier:t}}}}}catch(u){return{success:!1,error:u.message}}},prepareSelectiveDisclosure:function(e,t,r){Ii.checkArgument(e&&typeof e=="object","Invalid token"),Ii.checkArgument(Array.isArray(t),"Revealed fields must be array"),Ii.checkArgument(typeof r=="string","Nonce must be string");try{var i=this._createFieldCommitments(e,r),n=this._createMerkleTree(i),o=[],a=[];t.forEach(function(u){var c=this._getNestedValue(e,u),l=this._findFieldCommitment(i,u);if(l){o.push({path:u,value:c,commitment:l.hash,salt:l.salt});var m=this._generateMerkleProof(n,l.index);a.push({path:u,leafIndex:l.index,proof:m})}}.bind(this));var s={type:"LegalTokenSelectiveDisclosure",created:new Date().toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,nonce:r,merkleRoot:n.root,disclosures:o,merkleProofs:a,totalFields:i.length};return{success:!0,proof:s,hiddenFieldCount:i.length-o.length,revealedFieldCount:o.length,externalOperations:{storeDisclosure:{endpoint:"POST /proofs/selective-disclosure",data:{tokenId:e.id,proof:s,merkleRoot:n.root}},verifyDisclosure:{endpoint:"POST /proofs/verify-disclosure",data:{proof:s,expectedNonce:r}},auditDisclosure:{endpoint:"POST /audit/selective-disclosure",data:{tokenId:e.id,revealedFields:t,totalFields:i.length,disclosedAt:new Date().toISOString()}}}}}catch(u){return{success:!1,error:u.message}}},prepareSelectiveDisclosureVerification:function(e,t){try{if(Ii.checkArgument(e&&typeof e=="object","Invalid proof"),Ii.checkArgument(typeof t=="string","Expected nonce must be string"),e.nonce!==t)return{success:!1,error:"Nonce mismatch"};var r=[],i=[];e.disclosures.forEach(function(o,a){var s=e.merkleProofs[a],u=this._hashField(o.path,o.value,o.salt);if(u!==o.commitment){i.push("Invalid commitment for field: "+o.path);return}var c=this._verifyMerkleProof(o.commitment,s.leafIndex,s.proof,e.merkleRoot);c?r.push({path:o.path,value:o.value,verified:!0}):i.push("Invalid Merkle proof for field: "+o.path)}.bind(this));var n={valid:i.length===0,errors:i,disclosures:r,merkleRoot:e.merkleRoot,totalFields:e.totalFields,verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /proofs/disclosure-verification",data:{proofId:e.id||"unknown",result:n.valid,verifiedFields:r.length,totalFields:e.totalFields,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/disclosure-verification",data:{merkleRoot:e.merkleRoot,disclosuresVerified:r.length,errors:i.length,result:n.valid}}}}}catch(o){return{success:!1,error:o.message}}},prepareLegalValidityProof:function(e,t,r){Ii.checkArgument(e&&typeof e=="object","Invalid token"),Ii.checkArgument(t&&typeof t=="object","Invalid jurisdiction"),Ii.checkArgument(typeof r=="string","Nonce must be string");try{var i=t.requirements||[],n=[],o=!0;i.forEach(function(s){var u=this._checkLegalRequirement(e,s);n.push(u),u.satisfied||(o=!1)}.bind(this));var a={type:"LegalValidityProof",created:new Date().toISOString(),proofPurpose:"legalValidity",jurisdiction:t.code,nonce:r,valid:o,checks:n,complianceHash:this._hashCompliance(e,t,r)};return{success:!0,proof:a,valid:o,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(s=>s.satisfied).length,failedRequirements:n.filter(s=>!s.satisfied).length,overallCompliance:o},externalOperations:{submitCompliance:{endpoint:"POST /compliance/legal-validity",data:{tokenId:e.id,jurisdiction:t.code,proof:a,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(s=>s.satisfied).length,failedRequirements:n.filter(s=>!s.satisfied).length,overallCompliance:o}}},auditCompliance:{endpoint:"POST /audit/compliance-check",data:{tokenId:e.id,jurisdiction:t.code,result:o,checkedAt:new Date().toISOString(),requirements:n}},notifyRegulator:o?null:{endpoint:"POST /notifications/compliance-failure",data:{tokenId:e.id,jurisdiction:t.code,failedRequirements:n.filter(s=>!s.satisfied)}}}}}catch(s){return{success:!1,error:s.message}}},prepareZeroKnowledgeProof:function(e,t,r){Ii.checkArgument(e&&typeof e=="object","Invalid token"),Ii.checkArgument(t&&typeof t=="object","Invalid statement"),Ii.checkArgument(typeof r=="string","Nonce must be string");try{var i=co.sha256(h.Buffer.from(this._canonicalizeForSigning(e)+r)).toString("hex"),n={type:"LegalTokenZKProof",created:new Date().toISOString(),proofPurpose:"zeroKnowledge",statement:{claim:t.claim||"UNSPECIFIED",predicate:t.predicate||"SATISFIES",threshold:t.threshold||null},commitment:i,nonce:r,proofData:this._generateZKProofData(e,t,r)};return{success:!0,proof:n,commitment:i,externalOperations:{storeZKProof:{endpoint:"POST /proofs/zero-knowledge",data:{tokenId:e.id,proof:n,statement:t}},verifyZKProof:{endpoint:"POST /proofs/verify-zk",data:{proof:n,expectedNonce:r}},auditZKProof:{endpoint:"POST /audit/zk-proof",data:{tokenId:e.id,statement:t.claim,proofGenerated:new Date().toISOString()}}}}}catch(o){return{success:!1,error:o.message}}},_generateZKProofData:function(e,t,r){var i={challenge:co.sha256(h.Buffer.from(t.claim+r)).toString("hex"),response:co.sha256(h.Buffer.from(this._canonicalizeForSigning(e)+t.claim)).toString("hex"),witness:co.sha256(h.Buffer.from(r+e.id+t.predicate)).toString("hex")};return i},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o},_canonicalizeForSigning:function(e){var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.tokenHash;var r=this._sortObjectKeys(t);return JSON.stringify(r)},_createFieldCommitments:function(e,t){var r=[],i=0;return this._traverseObject(e,"",function(n,o){if(n!=="proof"&&n!=="tokenHash"){var a=co.sha256(h.Buffer.from(t+n+i)).toString("hex"),s=this._hashField(n,o,a);r.push({path:n,value:o,salt:a,hash:s,index:i}),i++}}.bind(this)),r},_hashField:function(e,t,r){var i=e+":"+JSON.stringify(t)+":"+r;return co.sha256(h.Buffer.from(i)).toString("hex")},_createMerkleTree:function(e){var t=e.map(function(l){return l.hash});if(t.length===0)return{root:null,levels:[]};for(var r=[t],i=t;i.length>1;){for(var n=[],o=0;o<i.length;o+=2){var a=i[o],s=i[o+1]||a,u=h.Buffer.concat([h.Buffer.from(a,"hex"),h.Buffer.from(s,"hex")]),c=co.sha256(u).toString("hex");n.push(c)}r.push(n),i=n}return{root:i[0],levels:r}},_generateMerkleProof:function(e,t){for(var r=[],i=t,n=0;n<e.levels.length-1;n++){var o=e.levels[n],a=i%2===0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r},_verifyMerkleProof:function(e,t,r,i){for(var n=e,o=t,a=0;a<r.length;a++){var s=r[a],u=o%2===0,c;s.isLeft?c=h.Buffer.concat([h.Buffer.from(s.hash,"hex"),h.Buffer.from(n,"hex")]):c=h.Buffer.concat([h.Buffer.from(n,"hex"),h.Buffer.from(s.hash,"hex")]),n=co.sha256(c).toString("hex"),o=Math.floor(o/2)}return n===i},_traverseObject:function(e,t,r){Array.isArray(e)?e.forEach(function(i,n){var o=t+"["+n+"]";this._traverseObject(i,o,r)}.bind(this)):e!==null&&typeof e=="object"?Object.keys(e).forEach(function(i){var n=t?t+"."+i:i;this._traverseObject(e[i],n,r)}.bind(this)):r(t,e)},_getNestedValue:function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)},_findFieldCommitment:function(e,t){return e.find(function(r){return r.path===t})},_checkLegalRequirement:function(e,t){switch(t.type){case"field_present":var r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:r!=null};case"field_value":var r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:r===t.expectedValue};case"temporal_validity":var i=new Date,n=new Date(e.issuanceDate);return{requirement:t.type,satisfied:n<=i};default:return{requirement:t.type,satisfied:!1,error:"Unknown requirement type"}}},_hashCompliance:function(e,t,r){var i={tokenId:e.id,jurisdiction:t.code,nonce:r,timestamp:new Date().toISOString()};return co.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex")},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};Cq.exports=Dse});var Uq=k((Ume,qq)=>{"use strict";v();var P5=Te(),X1=P5.crypto.Hash,Lme=P5.Address,qme=P5.Transaction,Di=P5.util.preconditions,Lq=W1(),Lse={prepareRegistry:function(e){e=e||{},Di.checkArgument(typeof e=="object","Config must be object");var t={id:e.id||this._generateRegistryId(),name:e.name||"Legal Token Registry",jurisdiction:e.jurisdiction||"GLOBAL",authority:e.authority||null,created:new Date().toISOString(),version:"1.0.0",config:{allowPublicRegistration:e.allowPublicRegistration||!1,requireApproval:e.requireApproval||!0,enableRevocation:e.enableRevocation!==!1,enableAuditTrail:e.enableAuditTrail!==!1,retentionPeriod:e.retentionPeriod||"7Y",complianceLevel:e.complianceLevel||"STANDARD"},dataStructure:{tokens:"Map<tokenId, registrationRecord>",revocations:"Map<tokenId, revocationRecord>",auditLog:"Array<auditEntry>",statistics:{totalTokens:0,activeTokens:0,revokedTokens:0,registrations:0}},externalStorage:{required:!0,type:"database_or_blockchain",endpoints:{store:"POST /registry/{id}/tokens",retrieve:"GET /registry/{id}/tokens/{tokenId}",search:"GET /registry/{id}/search",revoke:"POST /registry/{id}/revocations"}}},r=this._prepareAuditEntry({action:"REGISTRY_CREATED",actor:e.authority,timestamp:t.created,metadata:{jurisdiction:t.jurisdiction,config:t.config}});return{success:!0,registry:t,initialAudit:r,instructions:{step1:"Store registry configuration in external system",step2:"Initialize token storage with provided data structure",step3:"Set up audit logging with provided templates",step4:"Configure external endpoints for registry operations"}}},prepareTokenRegistration:function(e,t,r){r=r||{},Di.checkArgument(e&&typeof e=="object","Invalid token"),Di.checkArgument(t&&typeof t=="object","Invalid registry config");try{var i=this._validateTokenForRegistration(e,t);if(!i.valid)return{success:!1,error:"Token validation failed: "+i.error};var n={tokenId:e.id,tokenHash:this._hashToken(e),token:e,status:t.requireApproval?"PENDING":"ACTIVE",registeredBy:r.registeredBy||"UNKNOWN",registeredAt:new Date().toISOString(),approvedBy:null,approvedAt:null,metadata:r.metadata||{},compliance:{jurisdiction:e.jurisdiction||t.jurisdiction,level:this._calculateComplianceLevel(e),checks:i.checks||[]}},o=this._prepareAuditEntry({action:"TOKEN_REGISTERED",actor:r.registeredBy,tokenId:e.id,timestamp:n.registeredAt,metadata:{status:n.status,tokenType:e.type,compliance:n.compliance}});return{success:!0,registrationRecord:n,auditEntry:o,registrationId:this._generateRegistrationId(e.id),validation:i,externalOperations:{store:{endpoint:"POST /registry/"+t.id+"/tokens",data:n},audit:{endpoint:"POST /registry/"+t.id+"/audit",data:o}}}}catch(a){return{success:!1,error:a.message}}},prepareTokenApproval:function(e,t,r){try{Di.checkArgument(typeof e=="string","Token ID must be string"),Di.checkArgument(typeof t=="string","Approver must be string"),Di.checkArgument(r&&typeof r=="object","Invalid registry config");var i={tokenId:e,status:"ACTIVE",approvedBy:t,approvedAt:new Date().toISOString()},n=this._prepareAuditEntry({action:"TOKEN_APPROVED",actor:t,tokenId:e,timestamp:i.approvedAt});return{success:!0,approvalData:i,auditEntry:n,externalOperations:{update:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:i},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:n}}}}catch(o){return{success:!1,error:o.message}}},prepareTokenRevocation:function(e,t,r){try{if(Di.checkArgument(typeof e=="string","Token ID must be string"),Di.checkArgument(t&&typeof t=="object","Invalid revocation"),Di.checkArgument(r&&typeof r=="object","Invalid registry config"),!r.enableRevocation)return{success:!1,error:"Revocation is disabled for this registry"};var i={tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:new Date().toISOString(),effectiveDate:t.effectiveDate||new Date().toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null,revocationHash:this._generateRevocationHash(e,t)},n={tokenId:e,status:"REVOKED",revokedAt:i.revokedAt,revocationReason:i.reason},o=this._prepareAuditEntry({action:"TOKEN_REVOKED",actor:t.revokedBy,tokenId:e,timestamp:i.revokedAt,metadata:{reason:i.reason,legalBasis:i.legalBasis}});return{success:!0,revocationRecord:i,statusUpdate:n,auditEntry:o,revocationId:this._generateRevocationId(e),externalOperations:{storeRevocation:{endpoint:"POST /registry/"+r.id+"/revocations",data:i},updateStatus:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:n},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:o}}}}catch(a){return{success:!1,error:a.message}}},prepareTokenStatusQuery:function(e,t){try{return Di.checkArgument(typeof e=="string","Token ID must be string"),Di.checkArgument(t&&typeof t=="object","Invalid registry config"),{success:!0,query:{tokenId:e,registryId:t.id},externalOperations:{retrieve:{endpoint:"GET /registry/"+t.id+"/tokens/"+e,method:"GET"},checkRevocation:{endpoint:"GET /registry/"+t.id+"/revocations/"+e,method:"GET"}},expectedResponse:{found:"boolean",status:"string (PENDING|ACTIVE|REVOKED)",registeredAt:"ISO datetime",registeredBy:"string",approvedAt:"ISO datetime or null",approvedBy:"string or null",revokedAt:"ISO datetime or null",revocationReason:"string or null",compliance:"object",revocation:"object or null"}}}catch(r){return{success:!1,error:r.message}}},prepareTokenSearch:function(e,t){e=e||{};try{Di.checkArgument(t&&typeof t=="object","Invalid registry config");var r=[];e.status&&r.push("status="+encodeURIComponent(e.status)),e.type&&r.push("type="+encodeURIComponent(e.type)),e.registeredBy&&r.push("registeredBy="+encodeURIComponent(e.registeredBy)),e.jurisdiction&&r.push("jurisdiction="+encodeURIComponent(e.jurisdiction)),e.dateFrom&&r.push("dateFrom="+encodeURIComponent(e.dateFrom)),e.dateTo&&r.push("dateTo="+encodeURIComponent(e.dateTo)),e.includeTokens&&r.push("includeTokens=true"),e.sortBy&&r.push("sortBy="+encodeURIComponent(e.sortBy)),e.sortOrder&&r.push("sortOrder="+encodeURIComponent(e.sortOrder));var i=e.offset||0,n=e.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,searchCriteria:e,externalOperations:{search:{endpoint:"GET /registry/"+t.id+"/search"+o,method:"GET"}},expectedResponse:{success:"boolean",results:"Array<tokenRecord>",totalCount:"number",totalRegistrations:"number",offset:"number",limit:"number",hasMore:"boolean"}}}catch(a){return{success:!1,error:a.message}}},prepareStatisticsQuery:function(e){return Di.checkArgument(e&&typeof e=="object","Invalid registry config"),{success:!0,query:{registryId:e.id},externalOperations:{getStatistics:{endpoint:"GET /registry/"+e.id+"/statistics",method:"GET"}},expectedResponse:{id:"string",name:"string",jurisdiction:"string",created:"ISO datetime",statistics:{totalTokens:"number",activeTokens:"number",revokedTokens:"number",registrations:"number"},auditEntries:"number",lastActivity:"ISO datetime"}}},prepareAuditLogQuery:function(e,t){if(t=t||{},Di.checkArgument(e&&typeof e=="object","Invalid registry config"),!e.enableAuditTrail)return{success:!1,error:"Audit trail is disabled"};var r=[];t.action&&r.push("action="+encodeURIComponent(t.action)),t.actor&&r.push("actor="+encodeURIComponent(t.actor)),t.tokenId&&r.push("tokenId="+encodeURIComponent(t.tokenId)),t.dateFrom&&r.push("dateFrom="+encodeURIComponent(t.dateFrom)),t.dateTo&&r.push("dateTo="+encodeURIComponent(t.dateTo));var i=t.offset||0,n=t.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,auditOptions:t,externalOperations:{getAuditLog:{endpoint:"GET /registry/"+e.id+"/audit"+o,method:"GET"}},expectedResponse:{success:"boolean",entries:"Array<auditEntry>",totalEntries:"number",offset:"number",limit:"number",hasMore:"boolean"}}},_generateRegistryId:function(){return"reg_"+Lq.randomHex(16)},_generateRegistrationId:function(e){var t="reg_"+e+"_"+Date.now();return X1.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_generateRevocationId:function(e){var t="rev_"+e+"_"+Date.now();return X1.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_hashToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,X1.sha256(h.Buffer.from(JSON.stringify(t))).toString("hex")},_generateRevocationHash:function(e,t){var r=e+(t.reason||"")+(t.revokedBy||"")+Date.now();return X1.sha256(h.Buffer.from(r)).toString("hex")},_validateTokenForRegistration:function(e,t){var r=[],i=!0;return e.id?r.push({field:"id",valid:!0}):(r.push({field:"id",valid:!1,error:"Missing token ID"}),i=!1),e.type?r.push({field:"type",valid:!0}):(r.push({field:"type",valid:!1,error:"Missing token type"}),i=!1),e.issuanceDate?r.push({field:"issuanceDate",valid:!0}):(r.push({field:"issuanceDate",valid:!1,error:"Missing issuance date"}),i=!1),e.proof?r.push({field:"proof",valid:!0}):(r.push({field:"proof",valid:!1,error:"Missing cryptographic proof"}),i=!1),{valid:i,checks:r}},_calculateComplianceLevel:function(e){var t="BASIC";return e.proof&&e.proof.type&&(t="STANDARD"),e.jurisdiction&&e.legalBasis&&(t="ENHANCED"),e.attestations&&e.attestations.length>0&&(t="PREMIUM"),t},_prepareAuditEntry:function(e){var t={id:this._generateAuditId(),action:e.action,actor:e.actor||"SYSTEM",tokenId:e.tokenId||null,timestamp:e.timestamp||new Date().toISOString(),metadata:e.metadata||{},hash:this._generateAuditHash(e)};return t},_generateAuditId:function(){return"audit_"+Lq.randomHex(32)},_generateAuditHash:function(e){var t=(e.action||"")+(e.actor||"")+(e.tokenId||"")+(e.timestamp||"");return X1.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)}};qq.exports=Lse});var zq=k((Hme,jq)=>{"use strict";v();var Ys=Te(),W7=Ys.crypto.Hash,Fq=Ys.crypto.ECDSA,qse=Ys.crypto.Signature,Hq=Ys.PrivateKey,Xi=Ys.util.preconditions,Use=W1();function Fse(e,t){if(t=t||{},t.issuerPublicKey)return t.issuerPublicKey instanceof Ys.PublicKey?t.issuerPublicKey:Ys.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if(typeof r!="string")return null;try{var i=r.split("#")[0].split(":")[2];return i?Ys.PublicKey.fromString(i):null}catch{return null}}var T5={CORRELATIVE_OBLIGATION:"CorrelativeObligation",CONTRACTUAL_OBLIGATION:"ContractualObligation",PAYMENT_OBLIGATION:"PaymentObligation",DELIVERY_OBLIGATION:"DeliveryObligation",PERFORMANCE_OBLIGATION:"PerformanceObligation",MAINTENANCE_OBLIGATION:"MaintenanceObligation",COMPLIANCE_OBLIGATION:"ComplianceObligation",REPORTING_OBLIGATION:"ReportingObligation",CONFIDENTIALITY_OBLIGATION:"ConfidentialityObligation",NON_COMPETE_OBLIGATION:"NonCompeteObligation",INDEMNIFICATION_OBLIGATION:"IndemnificationObligation",WARRANTY_OBLIGATION:"WarrantyObligation",SUPPORT_OBLIGATION:"SupportObligation",REGULATORY_OBLIGATION:"RegulatoryObligation",FIDUCIARY_OBLIGATION:"FiduciaryObligation"},Yl={CRITICAL:"CRITICAL",HIGH:"HIGH",MEDIUM:"MEDIUM",LOW:"LOW",DEFERRED:"DEFERRED"},Li={PENDING:"PENDING",ACTIVE:"ACTIVE",IN_PROGRESS:"IN_PROGRESS",COMPLETED:"COMPLETED",OVERDUE:"OVERDUE",BREACHED:"BREACHED",WAIVED:"WAIVED",TERMINATED:"TERMINATED"},k5={prepareObligationToken:function(e,t,r,i,n,o){o=o||{},Xi.checkArgument(typeof e=="string","Obligation type must be string"),Xi.checkArgument(typeof t=="string","Issuer DID must be string"),Xi.checkArgument(typeof r=="string","Obligor DID must be string"),Xi.checkArgument(i&&typeof i=="object","Obligation must be object"),Xi.checkArgument(n instanceof Hq,"Invalid issuer private key");var a=Object.values(T5);Xi.checkArgument(a.includes(e),"Invalid obligation type: "+e);try{var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken",e],issuer:t,issuanceDate:new Date().toISOString(),credentialSubject:{id:r,obligationType:e,obligation:i,jurisdiction:o.jurisdiction||"US",priority:o.priority||Yl.MEDIUM,status:Li.PENDING,dueDate:o.dueDate||null,effectiveDate:o.effectiveDate||new Date().toISOString(),expirationDate:o.expirationDate||null,correlativeRight:o.correlativeRight||null,rightHolder:o.rightHolder||null,enforceable:o.enforceable!==!1,penalties:o.penalties||null,remedies:o.remedies||null}};o.metadata&&(s.credentialSubject.metadata=o.metadata);var u=this._signToken(s,n);return{success:!0,obligationToken:u,tokenHash:u.tokenHash,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight},externalOperations:{storeToken:{endpoint:"POST /obligations/tokens",data:{token:u,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight}}},indexToken:{endpoint:"POST /obligations/index",data:{tokenId:u.id,tokenHash:u.tokenHash,type:e,issuer:t,obligor:r,issuedAt:u.issuanceDate,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},notifyObligor:{endpoint:"POST /notifications/obligation-issued",data:{tokenId:u.id,issuer:t,obligor:r,obligationType:e,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},scheduleReminders:s.credentialSubject.dueDate?{endpoint:"POST /obligations/schedule-reminders",data:{tokenId:u.id,obligor:r,dueDate:s.credentialSubject.dueDate,reminderSchedule:o.reminderSchedule||["7d","3d","1d"]}}:null}}}catch(c){return{success:!1,error:c.message}}},prepareObligationVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateObligationType(e,r),this._validateObligationStatus(e,r,i),this._validateObligationPriority(e,i);var n={valid:r.length===0,errors:r,warnings:i,issuerDID:e.issuer,obligorDID:e.credentialSubject?e.credentialSubject.id:null,obligationType:e.credentialSubject?e.credentialSubject.obligationType:null,status:e.credentialSubject?e.credentialSubject.status:null,priority:e.credentialSubject?e.credentialSubject.priority:null,isOverdue:this._checkIfOverdue(e),verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /obligations/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt,isOverdue:n.isOverdue}},auditVerification:{endpoint:"POST /audit/obligation-verification",data:{tokenId:e.id,obligationType:n.obligationType,issuer:n.issuerDID,obligor:n.obligorDID,result:n.valid,verifiedAt:n.verifiedAt}},updateStatus:n.isOverdue&&e.credentialSubject.status===Li.ACTIVE?{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:Li.OVERDUE,updatedAt:n.verifiedAt,reason:"Due date passed"}}:null}}}catch(o){return{success:!1,error:"Verification preparation failed: "+o.message}}},prepareObligationFulfillment:function(e,t,r,i){i=i||{},Xi.checkArgument(e&&typeof e=="object","Invalid token"),Xi.checkArgument(t&&typeof t=="object","Invalid fulfillment"),Xi.checkArgument(r instanceof Hq,"Invalid obligor key");try{var n=this.prepareObligationVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot fulfill invalid obligation: "+n.verification.errors.join(", ")};if(e.credentialSubject.status===Li.COMPLETED)return{success:!1,error:"Obligation already fulfilled"};if(e.credentialSubject.status===Li.TERMINATED)return{success:!1,error:"Obligation has been terminated"};var o={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationFulfillment"],issuer:e.credentialSubject.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:e.id,fulfillmentType:t.type||"FULL_FULFILLMENT",fulfillmentDate:new Date().toISOString(),evidence:t.evidence||null,description:t.description||"",completionPercentage:t.completionPercentage||100,attestations:t.attestations||[],notes:t.notes||null}},a=this._signToken(o,r),s=o.credentialSubject.completionPercentage>=100?Li.COMPLETED:Li.IN_PROGRESS;return{success:!0,fulfillmentRecord:a,newStatus:s,fulfillmentId:a.id,externalOperations:{recordFulfillment:{endpoint:"POST /obligations/fulfillments",data:{obligationId:e.id,fulfillmentRecord:a,obligor:e.credentialSubject.id,fulfillmentDate:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:s,fulfillmentId:a.id,updatedAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},notifyRightHolder:e.credentialSubject.rightHolder?{endpoint:"POST /notifications/obligation-fulfilled",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,completionPercentage:o.credentialSubject.completionPercentage,newStatus:s}}:null,auditFulfillment:{endpoint:"POST /audit/obligation-fulfillment",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,fulfilledAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}}}}}catch(u){return{success:!1,error:u.message}}},prepareObligationBreachAssessment:function(e,t,r){Xi.checkArgument(e&&typeof e=="object","Invalid token"),Xi.checkArgument(t&&typeof t=="object","Invalid breach details"),Xi.checkArgument(r&&typeof r=="object","Invalid assessor");try{var i={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationBreachAssessment"],issuer:r.did||r.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:e.id,breachType:t.type||"MATERIAL_BREACH",breachDate:t.date||new Date().toISOString(),description:t.description||"",severity:t.severity||"MODERATE",evidence:t.evidence||[],assessor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},damages:t.damages||null,recommendedRemedies:t.recommendedRemedies||[],assessmentDate:new Date().toISOString()}},n=W7.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex");return i.credentialSubject.assessmentHash=n,{success:!0,breachAssessment:i,breachId:i.id,severity:t.severity||"MODERATE",externalOperations:{recordBreach:{endpoint:"POST /obligations/breaches",data:{obligationId:e.id,breachAssessment:i,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachDate:t.date||new Date().toISOString(),severity:t.severity||"MODERATE"}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:Li.BREACHED,breachId:i.id,breachDate:t.date||new Date().toISOString(),updatedAt:new Date().toISOString()}},notifyParties:{endpoint:"POST /notifications/obligation-breached",data:{obligationId:e.id,breachId:i.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachType:t.type||"MATERIAL_BREACH",severity:t.severity||"MODERATE"}},escalateBreach:t.severity==="CRITICAL"?{endpoint:"POST /legal/escalate-breach",data:{obligationId:e.id,breachId:i.id,severity:t.severity,jurisdiction:e.credentialSubject.jurisdiction}}:null,auditBreach:{endpoint:"POST /audit/obligation-breach",data:{obligationId:e.id,breachId:i.id,obligor:e.credentialSubject.id,assessedAt:i.credentialSubject.assessmentDate,severity:t.severity||"MODERATE"}}}}}catch(o){return{success:!1,error:o.message}}},prepareObligationMonitoringReport:function(e,t){t=t||{},Xi.checkArgument(Array.isArray(e),"Obligations must be array");try{var r={reportId:"rpt_"+this._generateUUID(),generatedAt:new Date().toISOString(),criteria:t,summary:{totalObligations:e.length,byStatus:{},byPriority:{},byType:{},overdue:0,dueSoon:0,completed:0},obligations:[],alerts:[],recommendations:[]},i=new Date,n=new Date(i.getTime()+10080*60*1e3);return e.forEach(function(o){var a={id:o.id,type:o.credentialSubject.obligationType,status:o.credentialSubject.status,priority:o.credentialSubject.priority,obligor:o.credentialSubject.id,dueDate:o.credentialSubject.dueDate,isOverdue:this._checkIfOverdue(o),isDueSoon:!1};if(o.credentialSubject.dueDate){var s=new Date(o.credentialSubject.dueDate);a.isDueSoon=s<=n&&s>i}r.summary.byStatus[a.status]=(r.summary.byStatus[a.status]||0)+1,r.summary.byPriority[a.priority]=(r.summary.byPriority[a.priority]||0)+1,r.summary.byType[a.type]=(r.summary.byType[a.type]||0)+1,a.isOverdue&&r.summary.overdue++,a.isDueSoon&&r.summary.dueSoon++,a.status===Li.COMPLETED&&r.summary.completed++,a.isOverdue&&a.priority===Yl.CRITICAL&&r.alerts.push({type:"CRITICAL_OVERDUE",obligationId:o.id,message:"Critical obligation is overdue",priority:"HIGH"}),a.isDueSoon&&a.priority===Yl.HIGH&&r.alerts.push({type:"HIGH_PRIORITY_DUE_SOON",obligationId:o.id,message:"High priority obligation due soon",priority:"MEDIUM"}),r.obligations.push(a)}.bind(this)),r.summary.overdue>0&&r.recommendations.push({type:"OVERDUE_MANAGEMENT",message:"Consider prioritizing overdue obligations",count:r.summary.overdue}),r.summary.dueSoon>5&&r.recommendations.push({type:"WORKLOAD_MANAGEMENT",message:"High number of obligations due soon - consider workload distribution",count:r.summary.dueSoon}),{success:!0,report:r,externalOperations:{storeReport:{endpoint:"POST /obligations/monitoring-reports",data:{report:r,generatedAt:r.generatedAt}},sendAlerts:r.alerts.length>0?{endpoint:"POST /notifications/obligation-alerts",data:{reportId:r.reportId,alerts:r.alerts,summary:r.summary}}:null,updateDashboard:{endpoint:"PUT /dashboard/obligation-metrics",data:{summary:r.summary,lastUpdated:r.generatedAt}}}}}catch(o){return{success:!1,error:o.message}}},getObligationTypes:function(){return T5},getObligationPriority:function(){return Yl},getObligationStatus:function(){return Li},_signToken:function(e,t){var r=this._canonicalizeToken(e),i=W7.sha256(h.Buffer.from(r)),n=new Fq;n.hashbuf=i,n.privkey=t,n.pubkey=t.toPublicKey(),n.sign();var o=n.sig,a={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(i,o)},s=JSON.parse(JSON.stringify(e));return s.proof=a,s.tokenHash=i.toString("hex"),s},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),(!e.type||!Array.isArray(e.type))&&t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws){t.push("Missing signature proof");return}var i=this._canonicalizeToken(e),n=W7.sha256(h.Buffer.from(i));if(e.tokenHash&&e.tokenHash!==n.toString("hex")){t.push("Token hash mismatch");return}var o=Fse(e,r);if(!o){t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");return}var a=e.proof.jws.split(".");if(a.length!==3||!a[2]){t.push("Malformed JWS");return}var s=qse.fromDER(h.Buffer.from(a[2],"base64url")),u=new Fq;u.hashbuf=n,u.sig=s,u.pubkey=o,u.verify()!==!0&&t.push("Signature verification failed")}catch(c){t.push("Signature verification failed: "+c.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date,n=new Date(e.issuanceDate);if(n>i&&t.push("Token issued in the future"),e.credentialSubject.effectiveDate){var o=new Date(e.credentialSubject.effectiveDate);i<o&&r.push("Obligation not yet effective")}if(e.credentialSubject.expirationDate){var a=new Date(e.credentialSubject.expirationDate);i>a&&t.push("Obligation expired")}},_validateObligationType:function(e,t){if(!e.credentialSubject.obligationType){t.push("Missing obligationType");return}var r=Object.values(T5);r.includes(e.credentialSubject.obligationType)||t.push("Invalid obligation type: "+e.credentialSubject.obligationType)},_validateObligationStatus:function(e,t,r){if(!e.credentialSubject.status){t.push("Missing status");return}var i=Object.values(Li);i.includes(e.credentialSubject.status)||t.push("Invalid obligation status: "+e.credentialSubject.status),this._checkIfOverdue(e)&&e.credentialSubject.status===Li.ACTIVE&&r.push("Obligation is overdue but status is still ACTIVE")},_validateObligationPriority:function(e,t){if(e.credentialSubject.priority){var r=Object.values(Yl);r.includes(e.credentialSubject.priority)||t.push("Invalid obligation priority: "+e.credentialSubject.priority)}},_checkIfOverdue:function(e){if(!e.credentialSubject.dueDate)return!1;var t=new Date,r=new Date(e.credentialSubject.dueDate);return t>r&&e.credentialSubject.status!==Li.COMPLETED},_generateUUID:function(){return Use.uuid4()}};k5.ObligationTypes=T5;k5.ObligationPriority=Yl;k5.ObligationStatus=Li;jq.exports=k5});var Gq=k((zme,Vq)=>{"use strict";v();var Zf=Aq(),R5=kq(),J1=Mq(),Y7=Dq(),na=Uq(),Hse=zq(),Kq=Te(),$7=Kq.PrivateKey,Ji=Kq.util.preconditions,wt=function(e){return this instanceof wt?(this.config=e||{},this.registry=null,this.config.registry&&(this.registry=na.createRegistry(this.config.registry)),this):new wt(e)};wt.prototype.createRightToken=function(e,t,r){Ji.checkArgument(e&&typeof e=="object","Invalid right data"),Ji.checkArgument(t instanceof $7,"Invalid private key"),r=r||{};try{var i=Zf.create(e.type,e.owner,e.owner,e,t,r);if(!i)return{success:!1,error:"Failed to create token"};if(r.addProof!==!1&&(i=Zf._signToken(i,t)),r.anchor){var n=J1.anchorToken(i,r.anchor);n.success&&(i.anchorTx=n.txid,i.anchorBlock=n.blockHeight)}if(this.registry&&r.register!==!1){var o=na.registerToken(this.registry,i,{registeredBy:r.registeredBy||"SYSTEM"});o.success&&(i.registrationId=o.registrationId,i.registrationStatus=o.status)}return{success:!0,token:i,type:"LegalRightToken"}}catch(a){return{success:!1,error:a.message}}};wt.prototype.validateClaim=function(e,t){return R5.validate(e,t)};wt.prototype.createSelectiveDisclosure=function(e,t,r){return Y7.prepareSelectiveDisclosure(e,t,r)};wt.prototype.verifyToken=function(e,t){return!e||!e.proof?{valid:!1,error:"No proof found in token"}:Zf.verifyToken(e,t)};wt.prototype.transferRight=function(e,t,r,i){Ji.checkArgument(e&&typeof e=="object","Invalid token"),Ji.checkArgument(typeof t=="string","New owner must be string"),Ji.checkArgument(r instanceof $7,"Invalid owner key"),i=i||{};try{var n=this.verifyToken(e,r.toPublicKey().toString());if(!n.valid)return{success:!1,error:"Invalid token or ownership proof"};var o=Zf.prepareRightTokenTransfer(e,t,r,i);if(!o.success)return{success:!1,error:o.error};var a=o.newToken,s=o.transferProof;if(i.anchor){var u=J1.anchorToken(a,i.anchor);u.success&&(a.transferAnchorTx=u.txid)}if(this.registry){var c=na.registerToken(this.registry,a,{registeredBy:i.registeredBy||t,metadata:{transferFrom:e.owner,transferTo:t,originalTokenId:e.id}});c.success&&(a.registrationId=c.registrationId)}return{success:!0,token:a,transferId:s.id,transferredAt:s.issuanceDate,transferProof:s}}catch(l){return{success:!1,error:l.message}}};wt.prototype.createObligation=function(e,t,r){Ji.checkArgument(e&&typeof e=="object","Invalid right token"),Ji.checkArgument(t&&typeof t=="object","Invalid obligation data"),Ji.checkArgument(r instanceof $7,"Invalid private key");try{var i=Zf.prepareObligationToken(e,t.obligor,t,r);return i.success?{success:!0,obligation:i.obligationToken,rightTokenId:e.id}:{success:!1,error:i.error}}catch(n){return{success:!1,error:n.message}}};wt.prototype.revokeToken=function(e,t,r){return Ji.checkArgument(typeof e=="string","Token ID must be string"),Ji.checkArgument(t&&typeof t=="object","Invalid revocation data"),Ji.checkArgument(typeof r=="string","Authority must be string"),this.registry?na.revokeToken(this.registry,e,{reason:t.reason,revokedBy:r,legalBasis:t.legalBasis,evidence:t.evidence}):{success:!1,error:"No registry available for revocation"}};wt.prototype.checkTokenStatus=function(e){return Ji.checkArgument(typeof e=="string","Token ID must be string"),this.registry?na.checkTokenStatus(this.registry,e):{found:!1,error:"No registry available"}};wt.prototype.searchTokens=function(e){return this.registry?na.searchTokens(this.registry,e):{success:!1,error:"No registry available"}};wt.prototype.getRegistryStats=function(){return this.registry?na.getStatistics(this.registry):{error:"No registry available"}};wt.prototype.createLegalValidityProof=function(e,t,r){return Y7.prepareLegalValidityProof(e,t,r)};wt.prototype.anchorTokenBatch=function(e,t){return J1.anchorBatch(e,t)};wt.prototype.verifyAnchor=function(e,t){return J1.verifyAnchor(e,t)};wt.prototype.getRightTypes=function(){return Zf.getRightTypes()};wt.prototype.getClaimSchemas=function(){return R5.getSchemas()};wt.prototype.createRegistry=function(e){return this.registry=na.createRegistry(e),this.registry};wt.prototype.setRegistry=function(e){Ji.checkArgument(e&&typeof e=="object","Invalid registry"),this.registry=e};wt.create=function(e){return new wt(e)};wt.createRightToken=function(e,t,r){var i=new wt;return i.createRightToken(e,t,r)};wt.validateClaim=function(e,t){return R5.validate(e,t)};wt.verifyToken=function(e,t){var r=new wt;return r.verifyToken(e,t)};wt.createRegistry=function(e){return na.createRegistry(e)};wt.Right=Zf;wt.Claim=R5;wt.Anchor=J1;wt.Proof=Y7;wt.Registry=na;wt.Obligation=Hse;Vq.exports=wt});var Te=k((Vme,Zq)=>{v();var j=Zq.exports;j.deps=j.deps||{};j.deps._=xt();j.deps.Buffer=typeof h.Buffer<"u"?h.Buffer:null;if(typeof window>"u")j.deps.bnjs=Nn(),j.deps.bs58=Y2();else{try{j.deps.bnjs=Nn()}catch{}try{j.deps.bs58=Y2()}catch{}}j.version="v"+zm();j.versionGuard=function(e){if(e!==void 0){var t=`
|
|
100
100
|
More than one instance of bsv found.
|
|
101
101
|
Please make sure to require bsv and check that submodules do
|