UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

1 lines 112 kB
var uo=Object.create;var tt=Object.defineProperty,co=Object.defineProperties,lo=Object.getOwnPropertyDescriptor,fo=Object.getOwnPropertyDescriptors,po=Object.getOwnPropertyNames,ht=Object.getOwnPropertySymbols,mo=Object.getPrototypeOf,Zt=Object.prototype.hasOwnProperty,jr=Object.prototype.propertyIsEnumerable;var Hr=(e,t,r)=>t in e?tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X=(e,t)=>{for(var r in t||(t={}))Zt.call(t,r)&&Hr(e,r,t[r]);if(ht)for(var r of ht(t))jr.call(t,r)&&Hr(e,r,t[r]);return e},re=(e,t)=>co(e,fo(t));var bt=(e,t)=>{var r={};for(var n in e)Zt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ht)for(var n of ht(e))t.indexOf(n)<0&&jr.call(e,n)&&(r[n]=e[n]);return r};var go=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},Yr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of po(t))!Zt.call(e,o)&&o!==r&&tt(e,o,{get:()=>t[o],enumerable:!(n=lo(t,o))||n.enumerable});return e};var oe=(e,t,r)=>(r=e!=null?uo(mo(e)):{},Yr(t||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),yo=e=>Yr(tt({},"__esModule",{value:!0}),e);var Xi={};go(Xi,{default:()=>Yt});module.exports=yo(Xi);var H=require("@solana/web3.js"),qr=require("@solana/spl-token");var zr=require("@solana/web3.js");var rt=require("lodash");var zt=class{constructor(t){this.logLevel=t.logLevel!==void 0?t.logLevel:0,this.name=t.name}set level(t){this.logLevel=t}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(t){return t<=this.logLevel}error(...t){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...t),this):this}logWithError(...t){let r=t.map(n=>typeof n=="object"?JSON.stringify(n):n).join(", ");throw new Error(r)}warning(...t){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...t),this):this}info(...t){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...t),this):this}debug(...t){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...t),this):this}},Zr={},ho={};function ee(e){let t=(0,rt.get)(Zr,e);if(!t){let r=(0,rt.get)(ho,e);t=new zt({name:e,logLevel:r}),(0,rt.set)(Zr,e,t)}return t}var wt=require("@solana/spl-token"),Jt=ee("Raydium_accountInfo_util");async function Jr(e,t,r){let{batchRequest:n,commitment:o="confirmed",chunkCount:i=100}=X({batchRequest:!1},r),s=Xt(t,i),a=new Array(s.length).fill([]);if(n){let c=s.map(d=>{let f=e._buildArgs([d.map(p=>p.toBase58())],o,"base64");return{methodName:"getMultipleAccounts",args:f}}),u=Xt(c,10);a=(await(await Promise.all(u.map(async d=>await e._rpcBatchRequest(d)))).flat()).map(d=>(d.error&&Jt.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${d.error.message}`),d.result.value.map(f=>{if(f){let{data:p,executable:g,lamports:m,owner:b,rentEpoch:w}=f;return p.length!==2&&p[1]!=="base64"&&Jt.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(p[0],"base64"),executable:g,lamports:m,owner:new zr.PublicKey(b),rentEpoch:w}}return null})))}else try{a=await Promise.all(s.map(c=>e.getMultipleAccountsInfo(c,o)))}catch(c){c instanceof Error&&Jt.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${c.message}`)}return a.flat()}var Te=oe(require("bn.js"));var He=9e15,Ne=1e9,Qt="0123456789abcdef",kt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",It="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",$t={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-He,maxE:He,crypto:!1},en,Ie,W=!0,St="[DecimalError] ",Fe=St+"Invalid argument: ",tn=St+"Precision limit exceeded",rn=St+"crypto unavailable",nn="[object Decimal]",ae=Math.floor,ne=Math.pow,bo=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,wo=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,To=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,on=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,me=1e7,v=7,xo=9007199254740991,Po=kt.length-1,er=It.length-1,h={toStringTag:nn};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),K(e)};h.ceil=function(){return K(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,t){var r,n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(Fe+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new o(n)};h.comparedTo=h.cmp=function(e){var t,r,n,o,i=this,s=i.d,a=(e=new i.constructor(e)).d,c=i.s,u=e.s;if(!s||!a)return!c||!u?NaN:c!==u?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-u:0;if(c!==u)return c;if(i.e!==e.e)return i.e>e.e^c<0?1:-1;for(n=s.length,o=a.length,t=0,r=n<o?n:o;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return n===o?0:n>o^c<0?1:-1};h.cosine=h.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+v,n.rounding=1,r=ko(n,ln(n,r)),n.precision=e,n.rounding=t,K(Ie==2||Ie==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};h.cubeRoot=h.cbrt=function(){var e,t,r,n,o,i,s,a,c,u,l=this,d=l.constructor;if(!l.isFinite()||l.isZero())return new d(l);for(W=!1,i=l.s*ne(l.s*l,1/3),!i||Math.abs(i)==1/0?(r=se(l.d),e=l.e,(i=(e-r.length+1)%3)&&(r+=i==1||i==-2?"0":"00"),i=ne(r,1/3),e=ae((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?r="5e"+e:(r=i.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new d(r),n.s=l.s):n=new d(i.toString()),s=(e=d.precision)+3;;)if(a=n,c=a.times(a).times(a),u=c.plus(l),n=J(u.plus(l).times(a),u.plus(c),s+2,1),se(a.d).slice(0,s)===(r=se(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!o&&r=="4999"){if(!o&&(K(a,e+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,o=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(K(n,e+1,1),t=!n.times(n).times(n).eq(l));break}return W=!0,K(n,e,d.rounding,t)};h.decimalPlaces=h.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ae(this.e/v))*v,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};h.dividedBy=h.div=function(e){return J(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var t=this,r=t.constructor;return K(J(t,new r(e),0,1,1),r.precision,r.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return K(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var t=this.cmp(e);return t==1||t===0};h.hyperbolicCosine=h.cosh=function(){var e,t,r,n,o,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(i.e,i.sd())+4,s.rounding=1,o=i.d.length,o<32?(e=Math.ceil(o/3),t=(1/Rt(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=je(s,1,i.times(t),new s(1),!0);for(var c,u=e,l=new s(8);u--;)c=i.times(i),i=a.minus(c.times(l.minus(c.times(l))));return K(i,s.precision=r,s.rounding=n,!0)};h.hyperbolicSine=h.sinh=function(){var e,t,r,n,o=this,i=o.constructor;if(!o.isFinite()||o.isZero())return new i(o);if(t=i.precision,r=i.rounding,i.precision=t+Math.max(o.e,o.sd())+4,i.rounding=1,n=o.d.length,n<3)o=je(i,2,o,o,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,o=o.times(1/Rt(5,e)),o=je(i,2,o,o,!0);for(var s,a=new i(5),c=new i(16),u=new i(20);e--;)s=o.times(o),o=o.times(a.plus(s.times(c.times(s).plus(u))))}return i.precision=t,i.rounding=r,K(o,t,r,!0)};h.hyperbolicTangent=h.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,J(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};h.inverseCosine=h.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,o=t.rounding;return r!==-1?r===0?e.isNeg()?be(t,n,o):new t(0):new t(NaN):e.isZero()?be(t,n+4,o).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=o,e.times(2))};h.inverseHyperbolicCosine=h.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,W=!1,r=r.times(r).minus(1).sqrt().plus(r),W=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};h.inverseHyperbolicSine=h.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,W=!1,r=r.times(r).plus(1).sqrt().plus(r),W=!0,n.precision=e,n.rounding=t,r.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,t,r,n,o=this,i=o.constructor;return o.isFinite()?o.e>=0?new i(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=i.precision,t=i.rounding,n=o.sd(),Math.max(n,e)<2*-o.e-1?K(new i(o),e,t,!0):(i.precision=r=n-o.e,o=J(o.plus(1),new i(1).minus(o),r+e,1),i.precision=e+4,i.rounding=1,o=o.ln(),i.precision=e,i.rounding=t,o.times(.5))):new i(NaN)};h.inverseSine=h.asin=function(){var e,t,r,n,o=this,i=o.constructor;return o.isZero()?new i(o):(t=o.abs().cmp(1),r=i.precision,n=i.rounding,t!==-1?t===0?(e=be(i,r+4,n).times(.5),e.s=o.s,e):new i(NaN):(i.precision=r+6,i.rounding=1,o=o.div(new i(1).minus(o.times(o)).sqrt().plus(1)).atan(),i.precision=r,i.rounding=n,o.times(2)))};h.inverseTangent=h.atan=function(){var e,t,r,n,o,i,s,a,c,u=this,l=u.constructor,d=l.precision,f=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&d+4<=er)return s=be(l,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(d+4<=er)return s=be(l,d+4,f).times(.5),s.s=u.s,s}for(l.precision=a=d+10,l.rounding=1,r=Math.min(28,a/v+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(W=!1,t=Math.ceil(a/v),n=1,c=u.times(u),s=new l(u),o=u;e!==-1;)if(o=o.times(c),i=s.minus(o.div(n+=2)),o=o.times(c),s=i.plus(o.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===i.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),W=!0,K(s,l.precision=d,l.rounding=f,!0)};h.isFinite=function(){return!!this.d};h.isInteger=h.isInt=function(){return!!this.d&&ae(this.e/v)>this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var t,r,n,o,i,s,a,c,u=this,l=u.constructor,d=l.precision,f=l.rounding,p=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new l(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(o=r[0];o%10===0;)o/=10;i=o!==1}if(W=!1,a=d+p,s=_e(u,a),n=t?At(l,a+10):_e(e,a),c=J(s,n,a,1),nt(c.d,o=d,f))do if(a+=10,s=_e(u,a),n=t?At(l,a+10):_e(e,a),c=J(s,n,a,1),!i){+se(c.d).slice(o+1,o+15)+1==1e14&&(c=K(c,d+1,0));break}while(nt(c.d,o+=10,f));return W=!0,K(c,d,f)};h.minus=h.sub=function(e){var t,r,n,o,i,s,a,c,u,l,d,f,p=this,g=p.constructor;if(e=new g(e),!p.d||!e.d)return!p.s||!e.s?e=new g(NaN):p.d?e.s=-e.s:e=new g(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(u=p.d,f=e.d,a=g.precision,c=g.rounding,!u[0]||!f[0]){if(f[0])e.s=-e.s;else if(u[0])e=new g(p);else return new g(c===3?-0:0);return W?K(e,a,c):e}if(r=ae(e.e/v),l=ae(p.e/v),u=u.slice(),i=l-r,i){for(d=i<0,d?(t=u,i=-i,s=f.length):(t=f,r=l,s=u.length),n=Math.max(Math.ceil(a/v),s)+2,i>n&&(i=n,t.length=1),t.reverse(),n=i;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=f.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}i=0}for(d&&(t=u,u=f,f=t,e.s=-e.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>i;){if(u[--n]<f[n]){for(o=n;o&&u[--o]===0;)u[o]=me-1;--u[o],u[n]+=me}u[n]-=f[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=Lt(u,r),W?K(e,a,c):e):new g(c===3?-0:0)};h.modulo=h.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?K(new n(r),n.precision,n.rounding):(W=!1,n.modulo==9?(t=J(r,e.abs(),0,3,1),t.s*=e.s):t=J(r,e,0,n.modulo,1),t=t.times(e),W=!0,r.minus(t))};h.naturalExponential=h.exp=function(){return tr(this)};h.naturalLogarithm=h.ln=function(){return _e(this)};h.negated=h.neg=function(){var e=new this.constructor(this);return e.s=-e.s,K(e)};h.plus=h.add=function(e){var t,r,n,o,i,s,a,c,u,l,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(u=d.d,l=e.d,a=f.precision,c=f.rounding,!u[0]||!l[0])return l[0]||(e=new f(d)),W?K(e,a,c):e;if(i=ae(d.e/v),n=ae(e.e/v),u=u.slice(),o=i-n,o){for(o<0?(r=u,o=-o,s=l.length):(r=l,n=i,s=u.length),i=Math.ceil(a/v),s=i>s?i+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=u.length,o=l.length,s-o<0&&(o=s,r=l,l=u,u=r),t=0;o;)t=(u[--o]=u[o]+l[o]+t)/me|0,u[o]%=me;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Lt(u,n),W?K(e,a,c):e};h.precision=h.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Fe+e);return r.d?(t=sn(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};h.round=function(){var e=this,t=e.constructor;return K(new t(e),e.e+1,t.rounding)};h.sine=h.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+v,n.rounding=1,r=Ao(n,ln(n,r)),n.precision=e,n.rounding=t,K(Ie>2?r.neg():r,e,t,!0)):new n(NaN)};h.squareRoot=h.sqrt=function(){var e,t,r,n,o,i,s=this,a=s.d,c=s.e,u=s.s,l=s.constructor;if(u!==1||!a||!a[0])return new l(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(W=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=se(a),(t.length+c)%2==0&&(t+="0"),u=Math.sqrt(t),c=ae((c+1)/2)-(c<0||c%2),u==1/0?t="5e"+c:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new l(t)):n=new l(u.toString()),r=(c=l.precision)+3;;)if(i=n,n=i.plus(J(s,i,r+2,1)).times(.5),se(i.d).slice(0,r)===(t=se(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!o&&t=="4999"){if(!o&&(K(i,c+1,0),i.times(i).eq(s))){n=i;break}r+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(K(n,c+1,1),e=!n.times(n).eq(s));break}return W=!0,K(n,c,l.rounding,e)};h.tangent=h.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=J(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,K(Ie==2||Ie==4?r.neg():r,e,t,!0)):new n(NaN)};h.times=h.mul=function(e){var t,r,n,o,i,s,a,c,u,l=this,d=l.constructor,f=l.d,p=(e=new d(e)).d;if(e.s*=l.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(r=ae(l.e/v)+ae(e.e/v),c=f.length,u=p.length,c<u&&(i=f,f=p,p=i,s=c,c=u,u=s),i=[],s=c+u,n=s;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,o=c+n;o>n;)a=i[o]+p[n]*f[o-n-1]+t,i[o--]=a%me|0,t=a/me|0;i[o]=(i[o]+t)%me|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=Lt(i,r),W?K(e,d.precision,d.rounding):e};h.toBinary=function(e,t){return rr(this,2,e,t)};h.toDecimalPlaces=h.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(le(e,0,Ne),t===void 0?t=n.rounding:le(t,0,8),K(r,e+r.e+1,t))};h.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=we(n,!0):(le(e,0,Ne),t===void 0?t=o.rounding:le(t,0,8),n=K(new o(n),e+1,t),r=we(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};h.toFixed=function(e,t){var r,n,o=this,i=o.constructor;return e===void 0?r=we(o):(le(e,0,Ne),t===void 0?t=i.rounding:le(t,0,8),n=K(new i(o),e+o.e+1,t),r=we(n,!1,e+n.e+1)),o.isNeg()&&!o.isZero()?"-"+r:r};h.toFraction=function(e){var t,r,n,o,i,s,a,c,u,l,d,f,p=this,g=p.d,m=p.constructor;if(!g)return new m(p);if(u=r=new m(1),n=c=new m(0),t=new m(n),i=t.e=sn(g)-p.e-1,s=i%v,t.d[0]=ne(10,s<0?v+s:s),e==null)e=i>0?t:u;else{if(a=new m(e),!a.isInt()||a.lt(u))throw Error(Fe+a);e=a.gt(t)?i>0?t:u:a}for(W=!1,a=new m(se(g)),l=m.precision,m.precision=i=g.length*v*2;d=J(a,t,0,1,1),o=r.plus(d.times(n)),o.cmp(e)!=1;)r=n,n=o,o=u,u=c.plus(d.times(o)),c=o,o=t,t=a.minus(d.times(o)),a=o;return o=J(e.minus(r),n,0,1,1),c=c.plus(o.times(u)),r=r.plus(o.times(n)),c.s=u.s=p.s,f=J(u,n,i,1).minus(p).abs().cmp(J(c,r,i,1).minus(p).abs())<1?[u,n]:[c,r],m.precision=l,W=!0,f};h.toHexadecimal=h.toHex=function(e,t){return rr(this,16,e,t)};h.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:le(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(W=!1,r=J(r,e,0,t,1).times(e),W=!0,K(r)):(e.s=r.s,r=e),r};h.toNumber=function(){return+this};h.toOctal=function(e,t){return rr(this,8,e,t)};h.toPower=h.pow=function(e){var t,r,n,o,i,s,a=this,c=a.constructor,u=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(ne(+a,u));if(a=new c(a),a.eq(1))return a;if(n=c.precision,i=c.rounding,e.eq(1))return K(a,n,i);if(t=ae(e.e/v),t>=e.d.length-1&&(r=u<0?-u:u)<=xo)return o=an(c,a,r,n),e.s<0?new c(1).div(o):K(o,n,i);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=ne(+a,u),t=r==0||!isFinite(r)?ae(u*(Math.log("0."+se(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(W=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),o=tr(e.times(_e(a,n+r)),n),o.d&&(o=K(o,n+5,1),nt(o.d,n,i)&&(t=n+10,o=K(tr(e.times(_e(a,t+r)),t),t+5,1),+se(o.d).slice(n+1,n+15)+1==1e14&&(o=K(o,n+1,0)))),o.s=s,W=!0,c.rounding=i,K(o,n,i))};h.toPrecision=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=we(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(le(e,1,Ne),t===void 0?t=o.rounding:le(t,0,8),n=K(new o(n),e,t),r=we(n,e<=n.e||n.e<=o.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};h.toSignificantDigits=h.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(le(e,1,Ne),t===void 0?t=n.rounding:le(t,0,8)),K(new n(r),e,t)};h.toString=function(){var e=this,t=e.constructor,r=we(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};h.truncated=h.trunc=function(){return K(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,t=e.constructor,r=we(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function se(e){var t,r,n,o=e.length-1,i="",s=e[0];if(o>0){for(i+=s,t=1;t<o;t++)n=e[t]+"",r=v-n.length,r&&(i+=Ce(r)),i+=n;s=e[t],n=s+"",r=v-n.length,r&&(i+=Ce(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}function le(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Fe+e)}function nt(e,t,r,n){var o,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=v,o=0):(o=Math.ceil((t+1)/v),t%=v),i=ne(10,v-t),a=e[o]%i|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==i||r>3&&a+1==i/2)&&(e[o+1]/i/100|0)==ne(10,t-2)-1||(a==i/2||a==0)&&(e[o+1]/i/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==i||!n&&r>3&&a+1==i/2)&&(e[o+1]/i/1e3|0)==ne(10,t-3)-1,s}function xt(e,t,r){for(var n,o=[0],i,s=0,a=e.length;s<a;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=Qt.indexOf(e.charAt(s++)),n=0;n<o.length;n++)o[n]>r-1&&(o[n+1]===void 0&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function ko(e,t){var r,n,o;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),o=(1/Rt(4,r)).toString()):(r=16,o="2.3283064365386962890625e-10"),e.precision+=r,t=je(e,1,t.times(o),new e(1));for(var i=r;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var J=function(){function e(n,o,i){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*o+a,n[c]=s%i|0,a=s/i|0;return a&&n.unshift(a),n}function t(n,o,i,s){var a,c;if(i!=s)c=i>s?1:-1;else for(a=c=0;a<i;a++)if(n[a]!=o[a]){c=n[a]>o[a]?1:-1;break}return c}function r(n,o,i,s){for(var a=0;i--;)n[i]-=a,a=n[i]<o[i]?1:0,n[i]=a*s+n[i]-o[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,o,i,s,a,c){var u,l,d,f,p,g,m,b,w,k,x,A,P,I,S,V,L,R,O,_,E=n.constructor,M=n.s==o.s?1:-1,F=n.d,D=o.d;if(!F||!F[0]||!D||!D[0])return new E(!n.s||!o.s||(F?D&&F[0]==D[0]:!D)?NaN:F&&F[0]==0||!D?M*0:M/0);for(c?(p=1,l=n.e-o.e):(c=me,p=v,l=ae(n.e/p)-ae(o.e/p)),O=D.length,L=F.length,w=new E(M),k=w.d=[],d=0;D[d]==(F[d]||0);d++);if(D[d]>(F[d]||0)&&l--,i==null?(I=i=E.precision,s=E.rounding):a?I=i+(n.e-o.e)+1:I=i,I<0)k.push(1),g=!0;else{if(I=I/p+2|0,d=0,O==1){for(f=0,D=D[0],I++;(d<L||f)&&I--;d++)S=f*c+(F[d]||0),k[d]=S/D|0,f=S%D|0;g=f||d<L}else{for(f=c/(D[0]+1)|0,f>1&&(D=e(D,f,c),F=e(F,f,c),O=D.length,L=F.length),V=O,x=F.slice(0,O),A=x.length;A<O;)x[A++]=0;_=D.slice(),_.unshift(0),R=D[0],D[1]>=c/2&&++R;do f=0,u=t(D,x,O,A),u<0?(P=x[0],O!=A&&(P=P*c+(x[1]||0)),f=P/R|0,f>1?(f>=c&&(f=c-1),m=e(D,f,c),b=m.length,A=x.length,u=t(m,x,b,A),u==1&&(f--,r(m,O<b?_:D,b,c))):(f==0&&(u=f=1),m=D.slice()),b=m.length,b<A&&m.unshift(0),r(x,m,A,c),u==-1&&(A=x.length,u=t(D,x,O,A),u<1&&(f++,r(x,O<A?_:D,A,c))),A=x.length):u===0&&(f++,x=[0]),k[d++]=f,u&&x[0]?x[A++]=F[V]||0:(x=[F[V]],A=1);while((V++<L||x[0]!==void 0)&&I--);g=x[0]!==void 0}k[0]||k.shift()}if(p==1)w.e=l,en=g;else{for(d=1,f=k[0];f>=10;f/=10)d++;w.e=d+l*p-1,K(w,a?i+w.e+1:i,s,g)}return w}}();function K(e,t,r,n){var o,i,s,a,c,u,l,d,f,p=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(o=1,a=d[0];a>=10;a/=10)o++;if(i=t-o,i<0)i+=v,s=t,l=d[f=0],c=l/ne(10,o-s-1)%10|0;else if(f=Math.ceil((i+1)/v),a=d.length,f>=a)if(n){for(;a++<=f;)d.push(0);l=c=0,o=1,i%=v,s=i-v+1}else break e;else{for(l=a=d[f],o=1;a>=10;a/=10)o++;i%=v,s=i-v+o,c=s<0?0:l/ne(10,o-s-1)%10|0}if(n=n||t<0||d[f+1]!==void 0||(s<0?l:l%ne(10,o-s-1)),u=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(i>0?s>0?l/ne(10,o-s):0:d[f-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,u?(t-=e.e+1,d[0]=ne(10,(v-t%v)%v),e.e=-t||0):d[0]=e.e=0,e;if(i==0?(d.length=f,a=1,f--):(d.length=f+1,a=ne(10,v-i),d[f]=s>0?(l/ne(10,o-s)%ne(10,s)|0)*a:0),u)for(;;)if(f==0){for(i=1,s=d[0];s>=10;s/=10)i++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,d[0]==me&&(d[0]=1));break}else{if(d[f]+=a,d[f]!=me)break;d[f--]=0,a=1}for(i=d.length;d[--i]===0;)d.pop()}return W&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function we(e,t,r){if(!e.isFinite())return cn(e);var n,o=e.e,i=se(e.d),s=i.length;return t?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+Ce(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):o<0?(i="0."+Ce(-o-1)+i,r&&(n=r-s)>0&&(i+=Ce(n))):o>=s?(i+=Ce(o+1-s),r&&(n=r-o-1)>0&&(i=i+"."+Ce(n))):((n=o+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(o+1===s&&(i+="."),i+=Ce(n))),i}function Lt(e,t){var r=e[0];for(t*=v;r>=10;r/=10)t++;return t}function At(e,t,r){if(t>Po)throw W=!0,r&&(e.precision=r),Error(tn);return K(new e(kt),t,1,!0)}function be(e,t,r){if(t>er)throw Error(tn);return K(new e(It),t,r,!0)}function sn(e){var t=e.length-1,r=t*v+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Ce(e){for(var t="";e--;)t+="0";return t}function an(e,t,r,n){var o,i=new e(1),s=Math.ceil(n/v+4);for(W=!1;;){if(r%2&&(i=i.times(t),Qr(i.d,s)&&(o=!0)),r=ae(r/2),r===0){r=i.d.length-1,o&&i.d[r]===0&&++i.d[r];break}t=t.times(t),Qr(t.d,s)}return W=!0,i}function Xr(e){return e.d[e.d.length-1]&1}function un(e,t,r){for(var n,o,i=new e(t[0]),s=0;++s<t.length;){if(o=new e(t[s]),!o.s){i=o;break}n=i.cmp(o),(n===r||n===0&&i.s===r)&&(i=o)}return i}function tr(e,t){var r,n,o,i,s,a,c,u=0,l=0,d=0,f=e.constructor,p=f.rounding,g=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(W=!1,c=g):c=t,a=new f(.03125);e.e>-2;)e=e.times(a),d+=5;for(n=Math.log(ne(2,d))/Math.LN10*2+5|0,c+=n,r=i=s=new f(1),f.precision=c;;){if(i=K(i.times(e),c,1),r=r.times(++l),a=s.plus(J(i,r,c,1)),se(a.d).slice(0,c)===se(s.d).slice(0,c)){for(o=d;o--;)s=K(s.times(s),c,1);if(t==null)if(u<3&&nt(s.d,c-n,p,u))f.precision=c+=10,r=i=a=new f(1),l=0,u++;else return K(s,f.precision=g,p,W=!0);else return f.precision=g,s}s=a}}function _e(e,t){var r,n,o,i,s,a,c,u,l,d,f,p=1,g=10,m=e,b=m.d,w=m.constructor,k=w.rounding,x=w.precision;if(m.s<0||!b||!b[0]||!m.e&&b[0]==1&&b.length==1)return new w(b&&!b[0]?-1/0:m.s!=1?NaN:b?0:m);if(t==null?(W=!1,l=x):l=t,w.precision=l+=g,r=se(b),n=r.charAt(0),Math.abs(i=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=se(m.d),n=r.charAt(0),p++;i=m.e,n>1?(m=new w("0."+r),i++):m=new w(n+"."+r.slice(1))}else return u=At(w,l+2,x).times(i+""),m=_e(new w(n+"."+r.slice(1)),l-g).plus(u),w.precision=x,t==null?K(m,x,k,W=!0):m;for(d=m,c=s=m=J(m.minus(1),m.plus(1),l,1),f=K(m.times(m),l,1),o=3;;){if(s=K(s.times(f),l,1),u=c.plus(J(s,new w(o),l,1)),se(u.d).slice(0,l)===se(c.d).slice(0,l))if(c=c.times(2),i!==0&&(c=c.plus(At(w,l+2,x).times(i+""))),c=J(c,new w(p),l,1),t==null)if(nt(c.d,l-g,k,a))w.precision=l+=g,u=s=m=J(d.minus(1),d.plus(1),l,1),f=K(m.times(m),l,1),o=a=1;else return K(c,w.precision=x,k,W=!0);else return w.precision=x,c;c=u,o+=2}}function cn(e){return String(e.s*e.s/0)}function Pt(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(n,o),t){if(o-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%v,r<0&&(n+=v),n<o){for(n&&e.d.push(+t.slice(0,n)),o-=v;n<o;)e.d.push(+t.slice(n,n+=v));t=t.slice(n),n=v-t.length}else n-=o;for(;n--;)t+="0";e.d.push(+t),W&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Io(e,t){var r,n,o,i,s,a,c,u,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),on.test(t))return Pt(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(wo.test(t))r=16,t=t.toLowerCase();else if(bo.test(t))r=2;else if(To.test(t))r=8;else throw Error(Fe+t);for(i=t.search(/p/i),i>0?(c=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),s=i>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,i=a-i,o=an(n,new n(r),i,i*2)),u=xt(t,r,me),l=u.length-1,i=l;u[i]===0;--i)u.pop();return i<0?new n(e.s*0):(e.e=Lt(u,l),e.d=u,W=!1,s&&(e=J(e,o,a*4)),c&&(e=e.times(Math.abs(c)<54?ne(2,c):ot.pow(2,c))),W=!0,e)}function Ao(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:je(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Rt(5,r)),t=je(e,2,t,t);for(var o,i=new e(5),s=new e(16),a=new e(20);r--;)o=t.times(t),t=t.times(i.plus(o.times(s.times(o).minus(a))));return t}function je(e,t,r,n,o){var i,s,a,c,u=1,l=e.precision,d=Math.ceil(l/v);for(W=!1,c=r.times(r),a=new e(n);;){if(s=J(a.times(c),new e(t++*t++),l,1),a=o?n.plus(s):n.minus(s),n=J(s.times(c),new e(t++*t++),l,1),s=a.plus(n),s.d[d]!==void 0){for(i=d;s.d[i]===a.d[i]&&i--;);if(i==-1)break}i=a,a=n,n=s,s=i,u++}return W=!0,s.d.length=d+1,s}function Rt(e,t){for(var r=e;--t;)r*=e;return r}function ln(e,t){var r,n=t.s<0,o=be(e,e.precision,1),i=o.times(.5);if(t=t.abs(),t.lte(i))return Ie=n?4:1,t;if(r=t.divToInt(o),r.isZero())Ie=n?3:2;else{if(t=t.minus(r.times(o)),t.lte(i))return Ie=Xr(r)?n?2:3:n?4:1,t;Ie=Xr(r)?n?1:4:n?3:2}return t.minus(o).abs()}function rr(e,t,r,n){var o,i,s,a,c,u,l,d,f,p=e.constructor,g=r!==void 0;if(g?(le(r,1,Ne),n===void 0?n=p.rounding:le(n,0,8)):(r=p.precision,n=p.rounding),!e.isFinite())l=cn(e);else{for(l=we(e),s=l.indexOf("."),g?(o=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):o=t,s>=0&&(l=l.replace(".",""),f=new p(1),f.e=l.length-s,f.d=xt(we(f),10,o),f.e=f.d.length),d=xt(l,10,o),i=c=d.length;d[--c]==0;)d.pop();if(!d[0])l=g?"0p+0":"0";else{if(s<0?i--:(e=new p(e),e.d=d,e.e=i,e=J(e,f,r,n,0,o),d=e.d,i=e.e,u=en),s=d[r],a=o/2,u=u||d[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&d[r-1]&1||n===(e.s<0?8:7)),d.length=r,u)for(;++d[--r]>o-1;)d[r]=0,r||(++i,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,l="";s<c;s++)l+=Qt.charAt(d[s]);if(g){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)l+="0";for(d=xt(l,o,t),c=d.length;!d[c-1];--c);for(s=1,l="1.";s<c;s++)l+=Qt.charAt(d[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)l="0"+l;l="0."+l}else if(++i>c)for(i-=c;i--;)l+="0";else i<c&&(l=l.slice(0,i)+"."+l.slice(i))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function Qr(e,t){if(e.length>t)return e.length=t,!0}function So(e){return new this(e).abs()}function Lo(e){return new this(e).acos()}function Ro(e){return new this(e).acosh()}function Bo(e,t){return new this(e).plus(t)}function Ko(e){return new this(e).asin()}function Co(e){return new this(e).asinh()}function _o(e){return new this(e).atan()}function Fo(e){return new this(e).atanh()}function No(e,t){e=new this(e),t=new this(t);var r,n=this.precision,o=this.rounding,i=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=be(this,i,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?be(this,n,o):new this(0),r.s=e.s):!e.d||t.isZero()?(r=be(this,i,1).times(.5),r.s=e.s):t.s<0?(this.precision=i,this.rounding=1,r=this.atan(J(e,t,i,1)),t=be(this,i,1),this.precision=n,this.rounding=o,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(J(e,t,i,1)),r}function Vo(e){return new this(e).cbrt()}function Mo(e){return K(e=new this(e),e.e+1,2)}function vo(e,t,r){return new this(e).clamp(t,r)}function Eo(e){if(!e||typeof e!="object")throw Error(St+"Object expected");var t,r,n,o=e.defaults===!0,i=["precision",1,Ne,"rounding",0,8,"toExpNeg",-He,0,"toExpPos",0,He,"maxE",0,He,"minE",-He,0,"modulo",0,9];for(t=0;t<i.length;t+=3)if(r=i[t],o&&(this[r]=$t[r]),(n=e[r])!==void 0)if(ae(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Fe+r+": "+n);if(r="crypto",o&&(this[r]=$t[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(rn);else this[r]=!1;else throw Error(Fe+r+": "+n);return this}function Do(e){return new this(e).cos()}function Oo(e){return new this(e).cosh()}function dn(e){var t,r,n;function o(i){var s,a,c,u=this;if(!(u instanceof o))return new o(i);if(u.constructor=o,$r(i)){u.s=i.s,W?!i.d||i.e>o.maxE?(u.e=NaN,u.d=null):i.e<o.minE?(u.e=0,u.d=[0]):(u.e=i.e,u.d=i.d.slice()):(u.e=i.e,u.d=i.d?i.d.slice():i.d);return}if(c=typeof i,c==="number"){if(i===0){u.s=1/i<0?-1:1,u.e=0,u.d=[0];return}if(i<0?(i=-i,u.s=-1):u.s=1,i===~~i&&i<1e7){for(s=0,a=i;a>=10;a/=10)s++;W?s>o.maxE?(u.e=NaN,u.d=null):s<o.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[i]):(u.e=s,u.d=[i]);return}if(i*0!==0){i||(u.s=NaN),u.e=NaN,u.d=null;return}return Pt(u,i.toString())}if(c==="string")return(a=i.charCodeAt(0))===45?(i=i.slice(1),u.s=-1):(a===43&&(i=i.slice(1)),u.s=1),on.test(i)?Pt(u,i):Io(u,i);if(c==="bigint")return i<0?(i=-i,u.s=-1):u.s=1,Pt(u,i.toString());throw Error(Fe+i)}if(o.prototype=h,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=Eo,o.clone=dn,o.isDecimal=$r,o.abs=So,o.acos=Lo,o.acosh=Ro,o.add=Bo,o.asin=Ko,o.asinh=Co,o.atan=_o,o.atanh=Fo,o.atan2=No,o.cbrt=Vo,o.ceil=Mo,o.clamp=vo,o.cos=Do,o.cosh=Oo,o.div=Wo,o.exp=Uo,o.floor=qo,o.hypot=Go,o.ln=Ho,o.log=jo,o.log10=Zo,o.log2=Yo,o.max=zo,o.min=Jo,o.mod=Xo,o.mul=Qo,o.pow=$o,o.random=ei,o.round=ti,o.sign=ri,o.sin=ni,o.sinh=oi,o.sqrt=ii,o.sub=si,o.sum=ai,o.tan=ui,o.tanh=ci,o.trunc=li,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return o.config(e),o}function Wo(e,t){return new this(e).div(t)}function Uo(e){return new this(e).exp()}function qo(e){return K(e=new this(e),e.e+1,3)}function Go(){var e,t,r=new this(0);for(W=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return W=!0,new this(1/0);r=t}return W=!0,r.sqrt()}function $r(e){return e instanceof ot||e&&e.toStringTag===nn||!1}function Ho(e){return new this(e).ln()}function jo(e,t){return new this(e).log(t)}function Yo(e){return new this(e).log(2)}function Zo(e){return new this(e).log(10)}function zo(){return un(this,arguments,-1)}function Jo(){return un(this,arguments,1)}function Xo(e,t){return new this(e).mod(t)}function Qo(e,t){return new this(e).mul(t)}function $o(e,t){return new this(e).pow(t)}function ei(e){var t,r,n,o,i=0,s=new this(1),a=[];if(e===void 0?e=this.precision:le(e,1,Ne),n=Math.ceil(e/v),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));i<n;)o=t[i],o>=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);i<n;)o=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+((t[i+3]&127)<<24),o>=214e7?crypto.randomBytes(4).copy(t,i):(a.push(o%1e7),i+=4);i=n/4}else throw Error(rn);else for(;i<n;)a[i++]=Math.random()*1e7|0;for(n=a[--i],e%=v,n&&e&&(o=ne(10,v-e),a[i]=(n/o|0)*o);a[i]===0;i--)a.pop();if(i<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=v)a.shift();for(n=1,o=a[0];o>=10;o/=10)n++;n<v&&(r-=v-n)}return s.e=r,s.d=a,s}function ti(e){return K(e=new this(e),e.e+1,this.rounding)}function ri(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function ni(e){return new this(e).sin()}function oi(e){return new this(e).sinh()}function ii(e){return new this(e).sqrt()}function si(e,t){return new this(e).sub(t)}function ai(){var e=0,t=arguments,r=new this(t[e]);for(W=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return W=!0,K(r,this.precision,this.rounding)}function ui(e){return new this(e).tan()}function ci(e){return new this(e).tanh()}function li(e){return K(e=new this(e),e.e+1,1)}h[Symbol.for("nodejs.util.inspect.custom")]=h.toString;h[Symbol.toStringTag]="Decimal";var ot=h.constructor=dn($t);kt=new ot(kt);It=new ot(It);var nr=ot;var hn=oe(require("big.js")),ut=oe(require("bn.js"));var fn=oe(require("toformat")),di=fn.default,it=di;var st=oe(require("big.js")),mn=oe(require("bn.js")),gn=oe(require("decimal.js-light"));var Ye=oe(require("bn.js"));var pn=9007199254740991;function q(e){let t=ee("Raydium_parseBigNumberish");if(e instanceof Ye.default)return e;if(typeof e=="string"){if(e.match(/^-?[0-9]+$/))return new Ye.default(e);t.logWithError(`invalid BigNumberish string: ${e}`)}return typeof e=="number"?(e%1&&t.logWithError(`BigNumberish number underflow: ${e}`),(e>=pn||e<=-pn)&&t.logWithError(`BigNumberish number overflow: ${e}`),new Ye.default(String(e))):typeof e=="bigint"?new Ye.default(e.toString()):(t.error(`invalid BigNumberish value: ${e}`),new Ye.default(0))}var Bt=ee("module/fraction"),or=it(st.default),at=it(gn.default),pi={[0]:at.ROUND_DOWN,[1]:at.ROUND_HALF_UP,[2]:at.ROUND_UP},mi={[0]:st.default.roundDown,[1]:st.default.roundHalfUp,[2]:st.default.roundUp},j=class{constructor(t,r=new mn.default(1)){this.numerator=q(t),this.denominator=q(r)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new j(this.denominator,this.numerator)}add(t){let r=t instanceof j?t:new j(q(t));return this.denominator.eq(r.denominator)?new j(this.numerator.add(r.numerator),this.denominator):new j(this.numerator.mul(r.denominator).add(r.numerator.mul(this.denominator)),this.denominator.mul(r.denominator))}sub(t){let r=t instanceof j?t:new j(q(t));return this.denominator.eq(r.denominator)?new j(this.numerator.sub(r.numerator),this.denominator):new j(this.numerator.mul(r.denominator).sub(r.numerator.mul(this.denominator)),this.denominator.mul(r.denominator))}mul(t){let r=t instanceof j?t:new j(q(t));return new j(this.numerator.mul(r.numerator),this.denominator.mul(r.denominator))}div(t){let r=t instanceof j?t:new j(q(t));return new j(this.numerator.mul(r.denominator),this.denominator.mul(r.numerator))}toSignificant(t,r={groupSeparator:""},n=1){Number.isInteger(t)||Bt.logWithError(`${t} is not an integer.`),t<=0&&Bt.logWithError(`${t} is not positive.`),at.set({precision:t+1,rounding:pi[n]});let o=new at(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return o.toFormat(o.decimalPlaces(),r)}toFixed(t,r={groupSeparator:""},n=1){return Number.isInteger(t)||Bt.logWithError(`${t} is not an integer.`),t<0&&Bt.logWithError(`${t} is negative.`),or.DP=t,or.RM=mi[n]||1,new or(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,r)}isZero(){return this.numerator.isZero()}};var gi=ee("Raydium_amount"),yn=it(hn.default);function yi(e,t){let r="0",n="0";if(e.includes(".")){let o=e.split(".");o.length===2?([r,n]=o,n=n.padEnd(t,"0")):gi.logWithError(`invalid number string, num: ${e}`)}else r=e;return[r,n.slice(0,t)||n]}var Ae=class extends j{constructor(r,n,o=!0,i){let s=new ut.default(0),a=ir.pow(new ut.default(r.decimals));if(o)s=q(n);else{let c=new ut.default(0),u=new ut.default(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,d]=yi(n.toString(),r.decimals);c=q(l),u=q(d)}c=c.mul(a),s=c.add(u)}super(s,a);this.logger=ee(i||"TokenAmount"),this.token=r}get raw(){return this.numerator}isZero(){return this.raw.isZero()}gt(r){return this.token.equals(r.token)||this.logger.logWithError("gt token not equals"),this.raw.gt(r.raw)}lt(r){return this.token.equals(r.token)||this.logger.logWithError("lt token not equals"),this.raw.lt(r.raw)}add(r){return this.token.equals(r.token)||this.logger.logWithError("add token not equals"),new Ae(this.token,this.raw.add(r.raw))}subtract(r){return this.token.equals(r.token)||this.logger.logWithError("sub token not equals"),new Ae(this.token,this.raw.sub(r.raw))}toSignificant(r=this.token.decimals,n,o=0){return super.toSignificant(r,n,o)}toFixed(r=this.token.decimals,n,o=0){return r>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(r,n,o)}toExact(r={groupSeparator:""}){return yn.DP=this.token.decimals,new yn(this.numerator.toString()).div(this.denominator.toString()).toFormat(r)}};var bn=require("@solana/web3.js"),sr=require("@solana/spl-token"),wn={chainId:101,address:bn.PublicKey.default.toBase58(),programId:sr.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},ce={chainId:101,address:"So11111111111111111111111111111111111111112",programId:sr.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var Kt=require("@solana/web3.js");var Z=require("@solana/web3.js"),Tn=require("@solana/spl-token");function y({pubkey:e,isSigner:t=!1,isWritable:r=!0}){return{pubkey:e,isWritable:r,isSigner:t}}var ar=[y({pubkey:Tn.TOKEN_PROGRAM_ID,isWritable:!1}),y({pubkey:Z.SystemProgram.programId,isWritable:!1}),y({pubkey:Z.SYSVAR_RENT_PUBKEY,isWritable:!1})];function ur({publicKey:e,transformSol:t}){let r=cr(e.toString());if(r instanceof Z.PublicKey)return t&&r.equals(ie)?ke:r;if(t&&r.toString()===ie.toBase58())return ke;if(typeof r=="string"){if(r===Z.PublicKey.default.toBase58())return Z.PublicKey.default;try{return new Z.PublicKey(r)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function cr(e){try{return new Z.PublicKey(e)}catch{return e}}var Ss=new Z.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Ls=new Z.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),hi=new Z.PublicKey("SysvarRent111111111111111111111111111111111"),Rs=new Z.PublicKey("SysvarC1ock11111111111111111111111111111111"),Bs=new Z.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),bi=new Z.PublicKey("Sysvar1nstructions1111111111111111111111111"),Ks=Z.SystemProgram.programId,Cs=new Z.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),_s=new Z.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),Fs=new Z.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),Ns=new Z.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),Vs=new Z.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),Ms=new Z.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),vs=new Z.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),Es=new Z.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),Ds=new Z.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Os=new Z.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Ws=new Z.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),ke=new Z.PublicKey("So11111111111111111111111111111111111111112"),ie=Z.PublicKey.default;function Tt(e){return ur({publicKey:e,transformSol:!0})}var lr=class{constructor({mint:t,decimals:r,symbol:n,name:o,skipMint:i=!1,isToken2022:s=!1}){if(t===ie.toBase58()||t instanceof Kt.PublicKey&&ie.equals(t)){this.decimals=ce.decimals,this.symbol=ce.symbol,this.name=ce.name,this.mint=new Kt.PublicKey(ce.address),this.isToken2022=!1;return}this.decimals=r,this.symbol=n||t.toString().substring(0,6),this.name=o||t.toString().substring(0,6),this.mint=i?Kt.PublicKey.default:ur({publicKey:t}),this.isToken2022=s}equals(t){return this===t?!0:this.mint.equals(t.mint)}},De=lr;De.WSOL=new lr(re(X({},ce),{mint:ce.address}));var dr=class{constructor({decimals:t,symbol:r="UNKNOWN",name:n="UNKNOWN"}){this.decimals=t,this.symbol=r,this.name=n}equals(t){return this===t}},Ct=dr;Ct.SOL=new dr(wn);var Pn=oe(require("bn.js"));var xn=new j(new Pn.default(100)),Ze=class extends j{toSignificant(t=5,r,n){return this.mul(xn).toSignificant(t,r,n)}toFixed(t=2,r,n){return this.mul(xn).toFixed(t,r,n)}};var wi=ee("Raydium_price"),Se=class extends j{constructor(r){let{baseToken:n,quoteToken:o,numerator:i,denominator:s}=r;super(i,s);this.baseToken=n,this.quoteToken=o,this.scalar=new j(fr(n.decimals),fr(o.decimals))}get raw(){return new j(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new Se({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(r){this.quoteToken!==r.baseToken&&wi.logWithError("mul token not equals");let n=super.mul(r);return new Se({baseToken:this.baseToken,quoteToken:r.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(r=this.quoteToken.decimals,n,o){return this.adjusted.toSignificant(r,n,o)}toFixed(r=this.quoteToken.decimals,n,o){return this.adjusted.toFixed(r,n,o)}};var pr=new Te.default(0),La=new Te.default(1),Ra=new Te.default(2),Ba=new Te.default(3),Ka=new Te.default(5),ir=new Te.default(10),Ca=new Te.default(100),_a=new Te.default(1e3),Fa=new Te.default(1e4);function fr(e){return ir.pow(q(e))}function Xt(e,t=1,r=[]){let n=[...e];if(t<=0)return r;for(;n.length;)r.push(n.splice(0,t));return r}var Sn=require("@solana/web3.js"),Ln=require("@solana/spl-token");var ue=require("@solana/web3.js");var z={CreateAccount:"CreateAccount",InitAccount:"InitAccount",CreateATA:"CreateATA",CloseAccount:"CloseAccount",TransferAmount:"TransferAmount",InitMint:"InitMint",MintTo:"MintTo",InitMarket:"InitMarket",Util1216OwnerClaim:"Util1216OwnerClaim",SetComputeUnitPrice:"SetComputeUnitPrice",SetComputeUnitLimit:"SetComputeUnitLimit",ClmmCreatePool:"ClmmCreatePool",ClmmOpenPosition:"ClmmOpenPosition",ClmmIncreasePosition:"ClmmIncreasePosition",ClmmDecreasePosition:"ClmmDecreasePosition",ClmmClosePosition:"ClmmClosePosition",ClmmSwapBaseIn:"ClmmSwapBaseIn",ClmmSwapBaseOut:"ClmmSwapBaseOut",ClmmInitReward:"ClmmInitReward",ClmmSetReward:"ClmmSetReward",ClmmCollectReward:"ClmmCollectReward",ClmmLockPosition:"ClmmLockPosition",ClmmHarvestLockPosition:"ClmmHarvestLockPosition",AmmV4Swap:"AmmV4Swap",AmmV4AddLiquidity:"AmmV4AddLiquidity",AmmV4RemoveLiquidity:"AmmV4RemoveLiquidity",AmmV4SimulatePoolInfo:"AmmV4SimulatePoolInfo",AmmV4SwapBaseIn:"AmmV4SwapBaseIn",AmmV4SwapBaseOut:"AmmV4SwapBaseOut",AmmV4CreatePool:"AmmV4CreatePool",AmmV4InitPool:"AmmV4InitPool",AmmV5AddLiquidity:"AmmV5AddLiquidity",AmmV5RemoveLiquidity:"AmmV5RemoveLiquidity",AmmV5SimulatePoolInfo:"AmmV5SimulatePoolInfo",AmmV5SwapBaseIn:"AmmV5SwapBaseIn",AmmV5SwapBaseOut:"AmmV5SwapBaseOut",RouteSwap:"RouteSwap",RouteSwap1:"RouteSwap1",RouteSwap2:"RouteSwap2",FarmV3Deposit:"FarmV3Deposit",FarmV3Withdraw:"FarmV3Withdraw",FarmV3CreateLedger:"FarmV3CreateLedger",FarmV4Withdraw:"FarmV4Withdraw",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut",CpmmLockLp:"CpmmLockLp",CpmmCollectLockFee:"CpmmCollectLockFee",TransferTip:"TransferTip"};var In=require("@solana/spl-token"),kn=ee("Raydium_txUtil"),An=1644;function _t(e){let t=[],r=[];return e.microLamports&&(t.push(ue.ComputeBudgetProgram.setComputeUnitPrice({microLamports:e.microLamports})),r.push(z.SetComputeUnitPrice)),e.units&&(t.push(ue.ComputeBudgetProgram.setComputeUnitLimit({units:e.units})),r.push(z.SetComputeUnitLimit)),{instructions:t,instructionTypes:r}}async function ze(e,t){var n,o;let r=t!=null?t:"confirmed";return(o=await((n=e.getLatestBlockhash)==null?void 0:n.call(e,{commitment:r})))==null?void 0:o.blockhash}async function Ft(e,t){return e.getSignatureStatuses([t]),new Promise((r,n)=>{let o=setTimeout(n,6e4);e.onSignature(t,i=>{if(clearTimeout(o),!i.err){r("");return}n(Object.assign(i.err,{txId:t}))},"confirmed")})}function Ti(e,t){e.length<1&&kn.logWithError(`no instructions provided: ${e.toString()}`),t.length<1&&kn.logWithError(`no signers provided:, ${t.toString()}`);let r=new ue.Transaction;r.recentBlockhash="11111111111111111111111111111111",r.feePayer=t[0],r.add(...e);try{return Buffer.from(r.serialize({verifySignatures:!1})).toString("base64").length<An}catch{return!1}}function Oe(e,t){let[r,n]=ue.PublicKey.findProgramAddressSync(e,t);return{publicKey:r,nonce:n}}function ct({instructions:e,payer:t,signers:r}){return Ti(e,[t,...r])}function lt({instructions:e,payer:t,lookupTableAddressAccount:r,recentBlockhash:n=ue.Keypair.generate().publicKey.toString()}){let i=new ue.TransactionMessage({payerKey:t,recentBlockhash:n,instructions:e}).compileToV0Message(Object.values(r!=null?r:{}));try{return Buffer.from(new ue.VersionedTransaction(i).serialize()).toString("base64").length<An}catch{return!1}}var xi=e=>Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e),Pi=e=>{let t=e.serialize({requireAllSignatures:!1,verifySignatures:!1});e instanceof ue.VersionedTransaction&&(t=xi(t));try{return t instanceof Buffer?t.toString("base64"):Buffer.from(t).toString("base64")}catch{return t.toString("base64")}};function We(e){let t=[];return e.forEach(r=>{r instanceof ue.Transaction&&(r.recentBlockhash||(r.recentBlockhash=In.TOKEN_PROGRAM_ID.toBase58()),r.feePayer||(r.feePayer=ue.Keypair.generate().publicKey)),t.push(Pi(r))}),console.log("simulate tx string:",t),t}function Je(e,t,r){return Oe([e.toBuffer(),(r!=null?r:Ln.TOKEN_PROGRAM_ID).toBuffer(),t.toBuffer()],new Sn.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}var C=require("@solana/web3.js"),Rn=new C.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),Bn=new C.PublicKey("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Kn=new C.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),dt=new C.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),za=new C.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),Ja=new C.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Xa=new C.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),Qa=new C.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),$a=new C.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),eu=new C.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),tu=new C.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),ru=new C.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),nu=new C.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),ou=new C.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),iu=new C.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),su=new C.PublicKey("7