PageSourceSearch

https://www.melega.finance/_next/static/chunks/3555-f1bbdd092e821329.js

js melega.finance collected 2026-09-26 20:15:59 UTC 11,744 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3555],{49222:function(r,t,e){e.d(t,{Ox:function(){return g},S5:function(){return E},xs:function(){return d}});var o=e(15549),n=e(41132),i=e(43495),s=e(10528);let l=new n.Yd(i.i),a={},u=s.O$.from(0),m=s.O$.from(-1);function h(r,t,e,o){let i={fault:t,operation:e};return void 0!==o&&(i.value=o),l.throwError(r,n.Yd.errors.NUMERIC_FAULT,i)}let f="0";for(;f.length<256;)f+=f;function c(r){if("number"!=typeof r)try{r=s.O$.from(r).toNumber()}catch(t){}return"number"==typeof r&&r>=0&&r<=256&&!(r%1)?"1"+f.substring(0,r):l.throwArgumentError("invalid decimal size","decimals",r)}function E(r,t){null==t&&(t=0);let e=c(t);r=s.O$.from(r);let o=r.lt(u);o&&(r=r.mul(m));let n=r.mod(e).toString();for(;n.length<e.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];let i=r.div(e).toString();return r=1===e.length?i:i+"."+n,o&&(r="-"+r),r}function g(r,t){null==t&&(t=0);let e=c(t);"string"==typeof r&&r.match(/^-?[0-9.]+$/)||l.throwArgumentError("invalid decimal value","value",r);let o="-"===r.substring(0,1);o&&(r=r.substring(1)),"."===r&&l.throwArgumentError("missing value","value",r);let n=r.split(".");n.length>2&&l.throwArgumentError("too many decimal points","value",r);let i=n[0],a=n[1];for(i||(i="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>e.length-1&&h("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<e.length-1;)a+="0";let u=s.O$.from(i),f=s.O$.from(a),E=u.mul(e).add(f);return o&&(E=E.mul(m)),E}class N{constructor(r,t,e,o){r!==a&&l.throwError("cannot use FixedFormat constructor; use FixedFormat.from",n.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=e,this.decimals=o,this.name=(t?"":"u")+"fixed"+String(e)+"x"+String(o),this._multiplier=c(o),Object.freeze(this)}static from(r){if(r instanceof N)return r;"number"==typeof r&&(r=`fixed128x${r}`);let t=!0,e=128,o=18;if("string"==typeof r){if("fixed"===r);else if("ufixed"===r)t=!1;else{let n=r.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);n||l.throwArgumentError("invalid fixed format","format",r),t="u"!==n[1],e=parseInt(n[2]),o=parseInt(n[3])}}else if(r){let i=(t,e,o)=>null==r[t]?o:(typeof r[t]!==e&&l.throwArgumentError("invalid fixed format ("+t+" not "+e+")","format."+t,r[t]),r[t]);t=i("signed","boolean",t),e=i("width","number",e),o=i("decimals","number",o)}return e%8&&l.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",e),o>80&&l.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",o),new N(a,t,e,o)}}class d{constructor(r,t,e,o){r!==a&&l.throwError("cannot use FixedNumber constructor; use FixedNumber.from",n.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=o,this._hex=t,this._value=e,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(r){this.format.name!==r.format.name&&l.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",r)}addUnsafe(r){this._checkFormat(r);let t=g(this._value,this.format.decimals),e=g(r._value,r.format.decimals);return d.fromValue(t.add(e),this.format.decimals,this.format)}subUnsafe(r){this._checkFormat(r);let t=g(this._value,this.format.decimals),e=g(r._value,r.format.decimals);return d.fromValue(t.sub(e),this.format.decimals,this.format)}mulUnsafe(r){this._checkFormat(r);let t=g(this._value,this.format.decimals),e=g(r._value,r.format.decimals);return d.fromValue(t.mul(e).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(r){this._checkFormat(r);let t=g(this._value,this.format.decimals),e=g(r._value,r.format.decimals);return d.fromValue(t.mul(this.format._multiplier).div(e),this.format.decimals,this.format)}floor(){let r=this.toString().split(".");1===r.length&&r.push("0");let t=d.from(r[0],this.format),e=!r[1].match(/^(0*)$/);return this.isNegative()&&e&&(t=t.subUnsafe(_.toFormat(t.format))),t}ceiling(){let r=this.toString().split(".");1===r.length&&r.push("0");let t=d.from(r[0],this.format),e=!r[1].match(/^(0*)$/);return!this.isNegative()&&e&&(t=t.addUnsafe(_.toFormat(t.format))),t}round(r){null==r&&(r=0);let t=this.toString().split(".");if(1===t.length&&t.push("0"),(r<0||r>80||r%1)&&l.throwArgumentError("invalid decimal count","decimals",r),t[1].length<=r)return this;let e=d.from("1"+f.substring(0,r),this.format),o=R.toFormat(this.format);return this.mulUnsafe(e).addUnsafe(o).floor().divUnsafe(e)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(r){if(null==r)return this._hex;r%8&&l.throwArgumentError("invalid byte width","width",r);let t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(r).toHexString();return(0,o.$m)(t,r/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(r){return d.fromString(this._value,r)}static fromValue(r,t,e){return null!=e||null==t||(0,s.Zm)(t)||(e=t,t=null),null==t&&(t=0),null==e&&(e="fixed"),d.fromString(E(r,t),N.from(e))}static fromString(r,t){null==t&&(t="fixed");let e=N.from(t),n=g(r,e.decimals);!e.signed&&n.lt(u)&&h("unsigned value cannot be negative","overflow","value",r);let i=null;e.signed?i=n.toTwos(e.width).toHexString():(i=n.toHexString(),i=(0,o.$m)(i,e.width/8));let s=E(n,e.decimals);return new d(a,i,s,e)}static fromBytes(r,t){null==t&&(t="fixed");let e=N.from(t);if((0,o.lE)(r).length>e.width/8)throw Error("overflow");let n=s.O$.from(r);e.signed&&(n=n.fromTwos(e.width));let i=n.toTwos((e.signed?0:1)+e.width).toHexString(),l=E(n,e.decimals);return new d(a,i,l,e)}static from(r,t){if("string"==typeof r)return d.fromString(r,t);if((0,o._t)(r))return d.fromBytes(r,t);try{return d.fromValue(r,0,t)}catch(e){if(e.code!==n.Yd.errors.INVALID_ARGUMENT)throw e}return l.throwArgumentError("invalid FixedNumber value","value",r)}static isFixedNumber(r){return!!(r&&r._isFixedNumber)}}let _=d.from(1),R=d.from("0.5")},33555:function(r,t,e){e.r(t),e.d(t,{commify:function(){return _},formatEther:function(){return I},formatUnits:function(){return R},parseEther:function(){return U},parseUnits:function(){return w}});var o,n,i,s,l=e(49222);let a=!1,u=!1,m={debug:1,default:2,info:2,warning:3,error:4,off:5},h=m.default,f=null,c=function(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw Error("bad normalize")}catch(e){r.push(t)}}),r.length)throw Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(o=i||(i={})).DEBUG="DEBUG",o.INFO="INFO",o.WARNING="WARNING",o.ERROR="ERROR",o.OFF="OFF",(n=s||(s={}
1)).UNKNOWN_ERROR="UNKNOWN_ERROR",n.NOT_IMPLEMENTED="NOT_IMPLEMENTED",n.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",n.NETWORK_ERROR="NETWORK_ERROR",n.SERVER_ERROR="SERVER_ERROR",n.TIMEOUT="TIMEOUT",n.BUFFER_OVERRUN="BUFFER_OVERRUN",n.NUMERIC_FAULT="NUMERIC_FAULT",n.MISSING_NEW="MISSING_NEW",n.INVALID_ARGUMENT="INVALID_ARGUMENT",n.MISSING_ARGUMENT="MISSING_ARGUMENT",n.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",n.CALL_EXCEPTION="CALL_EXCEPTION",n.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",n.NONCE_EXPIRED="NONCE_EXPIRED",n.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",n.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",n.TRANSACTION_REPLACED="TRANSACTION_REPLACED";let E="0123456789abcdef";class g{constructor(r){Object.defineProperty(this,"version",{enumerable:!0,value:r,writable:!1})}_log(r,t){let e=r.toLowerCase();null==m[e]&&this.throwArgumentError("invalid log level name","logLevel",r),h>m[e]||console.log.apply(console,t)}debug(...r){this._log(g.levels.DEBUG,r)}info(...r){this._log(g.levels.INFO,r)}warn(...r){this._log(g.levels.WARNING,r)}makeError(r,t,e){if(u)return this.makeError("censored error",t,{});t||(t=g.errors.UNKNOWN_ERROR),e||(e={});let o=[];Object.keys(e).forEach(r=>{let t=e[r];try{if(t instanceof Uint8Array){let n="";for(let i=0;i<t.length;i++)n+=E[t[i]>>4]+E[15&t[i]];o.push(r+"=Uint8Array(0x"+n+")")}else o.push(r+"="+JSON.stringify(t))}catch(s){o.push(r+"="+JSON.stringify(e[r].toString()))}}),o.push(`code=${t}`),o.push(`version=${this.version}`);let n=r,i="";switch(t){case s.NUMERIC_FAULT:{i="NUMERIC_FAULT";let l=r;switch(l){case"overflow":case"underflow":case"division-by-zero":i+="-"+l;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-unbound-result"}break}case s.CALL_EXCEPTION:case s.INSUFFICIENT_FUNDS:case s.MISSING_NEW:case s.NONCE_EXPIRED:case s.REPLACEMENT_UNDERPRICED:case s.TRANSACTION_REPLACED:case s.UNPREDICTABLE_GAS_LIMIT:i=t}i&&(r+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),o.length&&(r+=" ("+o.join(", ")+")");let a=Error(r);return a.reason=n,a.code=t,Object.keys(e).forEach(function(r){a[r]=e[r]}),a}throwError(r,t,e){throw this.makeError(r,t,e)}throwArgumentError(r,t,e){return this.throwError(r,g.errors.INVALID_ARGUMENT,{argument:t,value:e})}assert(r,t,e,o){r||this.throwError(t,e,o)}assertArgument(r,t,e,o){r||this.throwArgumentError(t,e,o)}checkNormalize(r){null==r&&(r="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",g.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}checkSafeUint53(r,t){"number"==typeof r&&(null==t&&(t="value not safe"),(r<0||r>=9007199254740991)&&this.throwError(t,g.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:r}),r%1&&this.throwError(t,g.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:r}))}checkArgumentCount(r,t,e){e=e?": "+e:"",r<t&&this.throwError("missing argument"+e,g.errors.MISSING_ARGUMENT,{count:r,expectedCount:t}),r>t&&this.throwError("too many arguments"+e,g.errors.UNEXPECTED_ARGUMENT,{count:r,expectedCount:t})}checkNew(r,t){(r===Object||null==r)&&this.throwError("missing new",g.errors.MISSING_NEW,{name:t.name})}checkAbstract(r,t){r===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",g.errors.UNSUPPORTED_OPERATION,{name:r.name,operation:"new"}):(r===Object||null==r)&&this.throwError("missing new",g.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return f||(f=new g("logger/5.6.0")),f}static setCensorship(r,t){if(!r&&t&&this.globalLogger().throwError("cannot permanently disable censorship",g.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!r)return;this.globalLogger().throwError("error censorship permanent",g.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!r,a=!!t}static setLogLevel(r){let t=m[r.toLowerCase()];if(null==t){g.globalLogger().warn("invalid log level - "+r);return}h=t}static from(r){return new g(r)}}g.errors=s,g.levels=i;let N=new g("units/5.6.1"),d=["wei","kwei","mwei","gwei","szabo","finney","ether"];function _(r){let t=String(r).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===r||"-."===r)&&N.throwArgumentError("invalid value","value",r);let e=t[0],o="";for("-"===e.substring(0,1)&&(o="-",e=e.substring(1));"0"===e.substring(0,1);)e=e.substring(1);""===e&&(e="0");let n="";for(2===t.length&&(n="."+(t[1]||"0"));n.length>2&&"0"===n[n.length-1];)n=n.substring(0,n.length-1);let i=[];for(;e.length;){if(e.length<=3){i.unshift(e);break}{let s=e.length-3;i.unshift(e.substring(s)),e=e.substring(0,s)}}return o+i.join(",")+n}function R(r,t){if("string"==typeof t){let e=d.indexOf(t);-1!==e&&(t=3*e)}return(0,l.S5)(r,null!=t?t:18)}function w(r,t){if("string"!=typeof r&&N.throwArgumentError("value must be a string","value",r),"string"==typeof t){let e=d.indexOf(t);-1!==e&&(t=3*e)}return(0,l.Ox)(r,null!=t?t:18)}function I(r){return R(r,18)}function U(r){return w(r,18)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.